From cfaf8da1101a477c3e76ee88e3f9ed18e325c468 Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Thu, 30 Dec 2021 18:17:57 -0300 Subject: [PATCH] feat(flame): add kernel-tracing option (#319) --- README.md | 2 +- bin.js | 6 ++++-- docs/clinic-flame.txt | 5 +++++ package.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e5694ee..84e78da 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin.js b/bin.js index f2c1189..6fa02c8 100755 --- a/bin.js +++ b/bin.js @@ -153,7 +153,8 @@ const result = commist() 'version', 'collect-only', 'open', - 'debug' + 'debug', + 'kernel-tracing' ], string: [ 'visualize-only', @@ -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({ diff --git a/docs/clinic-flame.txt b/docs/clinic-flame.txt index f07d268..3f02987 100644 --- a/docs/clinic-flame.txt +++ b/docs/clinic-flame.txt @@ -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) + + clinic flame --kernel-tracing -- node server.js +

Flags

-h | --help Display Help -v | --version Display Version @@ -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 .clinic/). + --kernel-tracing Profile application using linux_perf (linux only). diff --git a/package.json b/package.json index b326a6c..cee7c83 100644 --- a/package.json +++ b/package.json @@ -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",