From dfa40291759c788a8ce9aa7b2ab2deb9ea1dbc31 Mon Sep 17 00:00:00 2001 From: Eugenio Ceschia Date: Thu, 13 Mar 2025 09:28:24 +0100 Subject: [PATCH 1/3] cli: clarify --cpu-prof-name allowed values Refs: https://github.com/nodejs/node/issues/57418 --- doc/api/cli.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index f4c87b8276728d..c1e1ae261963cf 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -495,6 +495,8 @@ in the current working directory. If `--cpu-prof-name` is not specified, the generated profile is named `CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile`. +If `--cpu-prof-name` is specified, the provided value will be used as-is; patterns such as `${hhmmss}` or `${pid}` are not supported. + ```console $ node --cpu-prof index.js $ ls *.cpuprofile From fe51838a070e6c21ce479b82249140c4b78b0a7e Mon Sep 17 00:00:00 2001 From: Eugenio Ceschia Date: Fri, 14 Mar 2025 10:15:48 +0100 Subject: [PATCH 2/3] cli: add --cpu-prof-name example --- doc/api/cli.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index c1e1ae261963cf..a4efeaa5f246a8 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -495,14 +495,20 @@ in the current working directory. If `--cpu-prof-name` is not specified, the generated profile is named `CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile`. -If `--cpu-prof-name` is specified, the provided value will be used as-is; patterns such as `${hhmmss}` or `${pid}` are not supported. - ```console $ node --cpu-prof index.js $ ls *.cpuprofile CPU.20190409.202950.15293.0.0.cpuprofile ``` +If `--cpu-prof-name` is specified, the provided value will be used as-is; patterns such as `${hhmmss}` or `${pid}` are not supported. + +```console +$ node --cpu-prof --cpu-prof-name 'CPU.${pid}.cpuprofile' index.js +$ ls *.cpuprofile +'CPU.${pid}.cpuprofile' +``` + ### `--cpu-prof-dir`