-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
frontend/node_modules | ||
frontend/dist/**/ | ||
frontend/.parcel-cache | ||
frontend/static/perfetto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
commit_hash="c74251226a8caa0b43377902ee06d2570faa0c15" | ||
git clone https://github.com/google/perfetto.git perfetto_tmp | ||
|
||
cd perfetto_tmp | ||
git checkout $commit_hash || exit 1 | ||
|
||
function allow_url_in_csp() { | ||
url=$1 | ||
sed -i.bak "1,/^[[:space:]]*'blob:'/s/^\([[:space:]]*\)'blob:'/\1'$(echo "$url" | sed 's/\//\\\//g')',\n\1'blob:'/" ui/src/frontend/index.ts | ||
} | ||
|
||
allow_url_in_csp 'https://perf.rust-lang.org' | ||
allow_url_in_csp 'http://localhost:2346' | ||
|
||
patch -u ui/src/frontend/trace_url_handler.ts < ../perfetto_trace_url_handler.patch | ||
|
||
tools/install-build-deps --ui | ||
ui/build | ||
|
||
cd .. | ||
|
||
rm -rf static/perfetto | ||
mkdir -p static/perfetto | ||
mv perfetto_tmp/out/ui/ui/dist/* static/perfetto/ | ||
|
||
if [ "$DEBUG_EMBEDDED_PERFETTO" != true ] ; then | ||
echo "Removing temporal perfetto repository" | ||
rm -rf perfetto_tmp | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- ui/src/frontend/trace_url_handler.ts.bak 2024-09-15 21:20:31 | ||
+++ ui/src/frontend/trace_url_handler.ts 2024-09-15 21:34:02 | ||
@@ -217,11 +217,7 @@ | ||
} | ||
|
||
function loadTraceFromUrl(url: string) { | ||
- const isLocalhostTraceUrl = ['127.0.0.1', 'localhost'].includes( | ||
- new URL(url).hostname, | ||
- ); | ||
- | ||
- if (isLocalhostTraceUrl) { | ||
+ if (false) { | ||
// This handles the special case of tools/record_android_trace serving the | ||
// traces from a local webserver and killing it immediately after having | ||
// seen the HTTP GET request. In those cases store the trace as a file, so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import Compare from "./compare/page.vue"; | ||
import {createApp} from "vue"; | ||
import {createApp, ref} from "vue"; | ||
import WithSuspense from "../components/with-suspense.vue"; | ||
import {checkIsEmbeddedPerfettoEnabled} from "../perfetto"; | ||
|
||
const isEmbeddedPerfettoEnabled = ref(null); | ||
(async () => { | ||
isEmbeddedPerfettoEnabled.value = await checkIsEmbeddedPerfettoEnabled(); | ||
})(); | ||
|
||
const app = createApp(WithSuspense, { | ||
component: Compare, | ||
}); | ||
app.provide("isEmbeddedPerfettoEnabled", isEmbeddedPerfettoEnabled); | ||
app.mount("#app"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters