[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ZNf7W+EIrrCSHZN0@yoga>
Date: Sun, 13 Aug 2023 03:06:27 +0530
From: Anup Sharma <anupnewsmail@...il.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Anup Sharma <anupnewsmail@...il.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [RFC PATCH] perf scripts python: Add support for input args in gecko
script
Refines the argument handling mechanism in the "gecko-report"
script to enable better compatibility and improved user
experience. The script now differentiates between scenarios
where arguments are provided for record and report cases
where gecko.py arguments are passed.
Signed-off-by: Anup Sharma <anupnewsmail@...il.com>
---
Hi Arnaldo,
Thanks for providing such a detail insights here:
https://lore.kernel.org/linux-perf-users/ZMJaDGhSnhIlK3Nd@kernel.org/
I've successfully confirmed that the command "perf script gecko -a sleep 1"
is functioning as expected. However, I encountered an issue when attempting
to provide arguments such as "--user-color" and "--save-only" to the
"gecko.py" script while using the "perf script gecko" or "perf script report
gecko" commands.
In order to understand the inner workings of how these commands are executed,
I delved into the "buildin-script.c" code. From my investigation, it seems
that the arguments are taken into account for the "record" functionality,
rather than for "report."
To address this I added this changes.
I've also documented the usage of this command in our wiki:
https://perf.wiki.kernel.org/index.php/Tutorial#Firefox_Profiler
For most cases where users do not require specific "gecko.py" arguments, the
command "perf script gecko -a sleep 0.5" is sufficient. However, if users
intend to provide particular arguments to "gecko.py," they should employ the
command "perf script report gecko --save-only=cloud_cpu.json."
I believe there might be an intelligent solution to streamline this process.
Therefore, I would greatly appreciate your insights on this matter.
---
tools/perf/scripts/python/bin/gecko-report | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
mode change 100644 => 100755 tools/perf/scripts/python/bin/gecko-report
diff --git a/tools/perf/scripts/python/bin/gecko-report b/tools/perf/scripts/python/bin/gecko-report
old mode 100644
new mode 100755
index 0c12cc08f3ab..1867ec8d9757
--- a/tools/perf/scripts/python/bin/gecko-report
+++ b/tools/perf/scripts/python/bin/gecko-report
@@ -1,3 +1,7 @@
#!/bin/bash
# description: create firefox gecko profile json format from perf.data
-perf script "$@" -s "$PERF_EXEC_PATH"/scripts/python/gecko.py
+if [ "$*" = "-i -" ]; then
+perf script -s "$PERF_EXEC_PATH"/scripts/python/gecko.py
+else
+perf script -s "$PERF_EXEC_PATH"/scripts/python/gecko.py -- "$@"
+fi
--
2.34.1
Powered by blists - more mailing lists