forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit 7f70b01
authored
feat: support CPU profiling via environment variables (oven-sh#26313)
Adds environment variable support for enabling CPU profiling without CLI
flags:
- `BUN_CPU_PROFILE=1` — enables the CPU profiler
- `BUN_CPU_PROFILE_DIR=<path>` — sets the output directory for the
profile
- `BUN_CPU_PROFILE_NAME=<name>` — sets the profile file name
These are used as fallbacks when the corresponding `--cpu-prof` CLI
options are not provided. This is useful for profiling in contexts where
modifying the command line isn't practical (e.g. scripts invoked by
other tools).1 parent 08103aa commit 7f70b01
3 files changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | - | ||
280 | + | ||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | - | ||
285 | - | ||
284 | + | ||
285 | + | ||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | - | ||
394 | - | ||
393 | + | ||
394 | + | ||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | + | ||
41 | + | ||
42 | + | ||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
0 commit comments