-
-
Notifications
You must be signed in to change notification settings - Fork 733
feat: add tracy profiler support #12048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
22a1fa9
3943fe8
57314fd
4ff5db8
69d5a63
fcf647f
f6c46fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| /*.node | ||
| /*.wasm | ||
| /*.wasm | ||
| /*.dSYM |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ const { values, positionals } = require("util").parseArgs({ | |
| allowPositionals: true | ||
| }); | ||
|
|
||
| const { spawn } = require("child_process"); | ||
| const { spawn, spawnSync } = require("child_process"); | ||
|
|
||
| const NAPI_BINDING_DTS = "napi-binding.d.ts" | ||
| const CARGO_SAFELY_EXIT_CODE = 0; | ||
|
|
@@ -82,6 +82,9 @@ async function build() { | |
| features.push("allocative"); | ||
| rustflags.push("--cfg=allocative"); | ||
| } | ||
| if (process.env.TRACY) { | ||
| features.push("tracy-client"); | ||
| } | ||
| if (values.profile === "release") { | ||
| features.push("info-level"); | ||
| } | ||
|
|
@@ -138,6 +141,16 @@ async function build() { | |
| renameSync("rspack.wasm32-wasi.debug.wasm", "rspack.browser.debug.wasm") | ||
| renameSync("rspack.wasm32-wasi.wasm", "rspack.browser.wasm") | ||
| } | ||
|
|
||
| if(process.env.TRACY){ | ||
| // split debug symbols for tracy | ||
| spawnSync('dsymutil', [ | ||
| path.resolve(__dirname, "..", "rspack.darwin-arm64.node") | ||
| ], { | ||
| stdio: "inherit", | ||
| shell: true, | ||
| }) | ||
| } | ||
|
Comment on lines
+145
to
+153
|
||
| } | ||
| resolve(code); | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,9 +6,12 @@ name = "rspack_allocator" | |||||
| repository = "https://github.com/web-infra-dev/rspack" | ||||||
| version.workspace = true | ||||||
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||||||
| [dependencies] | ||||||
|
|
||||||
| [target.'cfg(not(target_family = "wasm"))'.dependencies] | ||||||
| sftrace-setup = { workspace = true, optional = true } | ||||||
| sftrace-setup = { workspace = true, optional = true } | ||||||
| tracy-client = { workspace = true, optional = true } | ||||||
| tracy-client-sys = { version = "=0.26.0" } | ||||||
|
||||||
| tracy-client-sys = { version = "=0.26.0" } | |
| tracy-client-sys = { version = "=0.26.0", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after
ifkeyword. JavaScript style conventions typically require a space betweenifand the opening parenthesis.Suggestion: