diff options
| author | Anup Sharma <[email protected]> | 2023-07-21 17:52:28 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2023-07-28 22:01:16 +0000 |
| commit | 1699d3efe111e33e275ca7d4163c8b1470ba79b3 (patch) | |
| tree | 939dd605828201c3b19d30501c9d59450fae8c6c /tools/perf/scripts/python/gecko.py | |
| parent | perf doc: Fix typo in perf.data-file-format.txt (diff) | |
| download | kernel-1699d3efe111e33e275ca7d4163c8b1470ba79b3.tar.gz kernel-1699d3efe111e33e275ca7d4163c8b1470ba79b3.zip | |
perf scripts python: Add initial script file with usage information
Added necessary modules, including the Perf-Trace-Util
library, and defines the required functions and variables
for using perf script python. The perf_trace_context and
Core modules for tracing and processing events has been
also imported. Added usage information.
Signed-off-by: Anup Sharma <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: https://lore.kernel.org/r/f2f1a62f1cc69f44a5414da46a26a4cf124d2744.1689961706.git.anupnewsmail@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
| -rw-r--r-- | tools/perf/scripts/python/gecko.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/perf/scripts/python/gecko.py b/tools/perf/scripts/python/gecko.py new file mode 100644 index 000000000000..7a62c1b411d9 --- /dev/null +++ b/tools/perf/scripts/python/gecko.py @@ -0,0 +1,31 @@ +# firefox-gecko-converter.py - Convert perf record output to Firefox's gecko profile format +# SPDX-License-Identifier: GPL-2.0 +# +# The script converts perf.data to Gecko Profile Format, +# which can be read by https://profiler.firefox.com/. +# +# Usage: +# +# perf record -a -g -F 99 sleep 60 +# perf script report gecko > output.json + +import os +import sys +from typing import Dict + +# Add the Perf-Trace-Util library to the Python path +sys.path.append(os.environ['PERF_EXEC_PATH'] + \ + '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') + +from perf_trace_context import * +from Core import * + +# Uses perf script python interface to parse each +# event and store the data in the thread builder. +def process_event(param_dict: Dict) -> None: + pass + +# Trace_end runs at the end and will be used to aggregate +# the data into the final json object and print it out to stdout. +def trace_end() -> None: + pass |
