Skip to content

Commit

Permalink
feat(flame): add kernel-tracing option (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS authored Dec 30, 2021
1 parent a495dd2 commit cfaf8da
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ these factors together.
## Supported Node.js versions

Clinic.js relies heavily on Node.js core instrumentation available in later versions.
Currently the supported Node.js versions are `>= 10.12.0`.
Currently the supported Node.js versions are `>= 12.13.0`.

## Examples and Demos

Expand Down
6 changes: 4 additions & 2 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ const result = commist()
'version',
'collect-only',
'open',
'debug'
'debug',
'kernel-tracing'
],
string: [
'visualize-only',
Expand Down Expand Up @@ -317,7 +318,8 @@ async function runTool (toolName, Tool, version, args, uiOptions) {
sampleInterval: parseInt(args['sample-interval'], 10),
detectPort: !!onPort,
dest: args.dest,
debug: args.debug
debug: args.debug,
kernelTracing: args['kernel-tracing']
})

const spinner = ora({
Expand Down
5 changes: 5 additions & 0 deletions docs/clinic-flame.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
Note that dollar signs ($) appearing in the URL must be escaped, else they
will be treated as environment variables as well.

You can profile the application using kernel tracing. This will capture native stack frames (C++ modules and Libuv I/O)

<code>clinic flame --kernel-tracing -- node server.js</code>

<h1>Flags</h1>
-h | --help Display Help
-v | --version Display Version
Expand All @@ -45,3 +49,4 @@
--autocannon Run the autocannon benchmarking tool when the server starts listening on a port.
--open Boolean to enable or disable your report opening in your web browser.
--dest Destination for the collected data (default <code>.clinic/</code>).
--kernel-tracing Profile application using linux_perf (linux only).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@clinic/bubbleprof": "^8.0.0",
"@clinic/doctor": "^9.0.0",
"@clinic/flame": "^10.0.0",
"@clinic/flame": "^11.0.0",
"@clinic/heap-profiler": "^3.0.0",
"any-shell-escape": "^0.1.1",
"async": "^3.0.1",
Expand Down

0 comments on commit cfaf8da

Please sign in to comment.