| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 944ed9b commit 1587a60
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ This a list of all the dependencies: | |||
| 28 | 28 | * [ngtcp2][] | |
| 29 | 29 | * [npm][] | |
| 30 | 30 | * [openssl][] | |
| 31 | + * [perfetto][] | ||
| 31 | 32 | * [postject][] | |
| 32 | 33 | * [simdjson][] | |
| 33 | 34 | * [sqlite][] | |
@@ -353,6 +354,11 @@ the main openssl/openssl releases with the addition of APIs to support | |||
| 353 | 354 | the QUIC protocol. | |
| 354 | 355 | See [maintaining-openssl][] for more information. | |
| 355 | 356 | ||
| 357 | + ### perfetto | ||
| 358 | + | ||
| 359 | + The [perfetto](https://github.com/google/perfetto) dependency is used to | ||
| 360 | + generate performance traces for Node.js and V8. | ||
| 361 | + | ||
| 356 | 362 | ### postject | |
| 357 | 363 | ||
| 358 | 364 | The [postject](https://github.com/nodejs/postject) dependency is used for the | |
@@ -427,6 +433,7 @@ according to [RFC 8878](https://datatracker.ietf.org/doc/html/rfc8878). | |||
| 427 | 433 | [ngtcp2]: #ngtcp2 | |
| 428 | 434 | [npm]: #npm | |
| 429 | 435 | [openssl]: #openssl | |
| 436 | + [perfetto]: #perfetto | ||
| 430 | 437 | [postject]: #postject | |
| 431 | 438 | [simdjson]: #simdjson | |
| 432 | 439 | [sqlite]: #sqlite | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,75 @@ | |||
| 1 | + #!/bin/sh | ||
| 2 | + set -e | ||
| 3 | + # Shell script to update perfetto in the source tree to specific version | ||
| 4 | + | ||
| 5 | + BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) | ||
| 6 | + DEPS_DIR="$BASE_DIR/deps" | ||
| 7 | + | ||
| 8 | + [ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node" | ||
| 9 | + [ -x "$NODE" ] || NODE=$(command -v node) | ||
| 10 | + | ||
| 11 | + # shellcheck disable=SC1091 | ||
| 12 | + . "$BASE_DIR/tools/dep_updaters/utils.sh" | ||
| 13 | + | ||
| 14 | + NEW_VERSION="$("$NODE" --input-type=module <<'EOF' | ||
| 15 | + const res = await fetch('https://api.github.com/repos/google/perfetto/releases/latest', | ||
| 16 | + process.env.GITHUB_TOKEN && { | ||
| 17 | + headers: { | ||
| 18 | + "Authorization": `Bearer ${process.env.GITHUB_TOKEN}` | ||
| 19 | + }, | ||
| 20 | + }); | ||
| 21 | + if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); | ||
| 22 | + const { tag_name } = await res.json(); | ||
| 23 | + console.log(tag_name.replace('v', '')); | ||
| 24 | + EOF | ||
| 25 | + )" | ||
| 26 | + | ||
| 27 | + CURRENT_VERSION=$(cat ./deps/perfetto/VERSION) | ||
| 28 | + | ||
| 29 | + # This function exit with 0 if new version and current version are the same | ||
| 30 | + compare_dependency_version "perfetto" "$NEW_VERSION" "$CURRENT_VERSION" | ||
| 31 | + | ||
| 32 | + echo "Making temporary workspace" | ||
| 33 | + | ||
| 34 | + WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') | ||
| 35 | + | ||
| 36 | + cleanup () { | ||
| 37 | + EXIT_CODE=$? | ||
| 38 | + [ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE" | ||
| 39 | + exit $EXIT_CODE | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + trap cleanup INT TERM EXIT | ||
| 43 | + | ||
| 44 | + PERFETTO_REF="v$NEW_VERSION" | ||
| 45 | + PERFETTO_SDK_ZIP="perfetto-cpp-sdk-src.zip" | ||
| 46 | + | ||
| 47 | + cd "$WORKSPACE" | ||
| 48 | + | ||
| 49 | + echo "Fetching perfetto sdk archive" | ||
| 50 | + curl -sL -o "$PERFETTO_SDK_ZIP" "https://github.com/google/perfetto/releases/download/$PERFETTO_REF/$PERFETTO_SDK_ZIP" | ||
| 51 | + | ||
| 52 | + echo "Unpacking archive" | ||
| 53 | + mkdir -p perfetto/sdk | ||
| 54 | + unzip -d perfetto/sdk "$PERFETTO_SDK_ZIP" | ||
| 55 | + rm "$PERFETTO_SDK_ZIP" | ||
| 56 | + echo "$NEW_VERSION" > perfetto/VERSION | ||
| 57 | + curl -sL -o "perfetto/LICENSE" "https://raw.githubusercontent.com/google/perfetto/refs/tags/$PERFETTO_REF/LICENSE" | ||
| 58 | + | ||
| 59 | + # Remove C API headers. Only keep C++ API headers. | ||
| 60 | + rm perfetto/sdk/perfetto_c.h perfetto/sdk/perfetto_c.cc | ||
| 61 | + | ||
| 62 | + echo "Copying existing gyp files" | ||
| 63 | + cp "$DEPS_DIR/perfetto/perfetto.gyp" "$WORKSPACE/perfetto" | ||
| 64 | + | ||
| 65 | + echo "Copying existing GN files" | ||
| 66 | + cp "$DEPS_DIR/perfetto/"*.gn "$DEPS_DIR/perfetto/"*.gni "$WORKSPACE/perfetto" | ||
| 67 | + | ||
| 68 | + echo "Replacing existing perfetto" | ||
| 69 | + rm -rf "$DEPS_DIR/perfetto" | ||
| 70 | + mv "$WORKSPACE/perfetto" "$DEPS_DIR/" | ||
| 71 | + | ||
| 72 | + # Update the version number on maintaining-dependencies.md | ||
| 73 | + # and print the new version as the last line of the script as we need | ||
| 74 | + # to add it to $GITHUB_ENV variable | ||
| 75 | + finalize_version_update "perfetto" "$NEW_VERSION" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments