Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <anupnewsmail@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/f2f1a62f1cc69f44a5414da46a26a4cf124d2744.1689961706.git.anupnewsmail@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Anup Sharma and committed by
Arnaldo Carvalho de Melo
1699d3ef 1e372014

+31
+31
tools/perf/scripts/python/gecko.py
··· 1 + # firefox-gecko-converter.py - Convert perf record output to Firefox's gecko profile format 2 + # SPDX-License-Identifier: GPL-2.0 3 + # 4 + # The script converts perf.data to Gecko Profile Format, 5 + # which can be read by https://profiler.firefox.com/. 6 + # 7 + # Usage: 8 + # 9 + # perf record -a -g -F 99 sleep 60 10 + # perf script report gecko > output.json 11 + 12 + import os 13 + import sys 14 + from typing import Dict 15 + 16 + # Add the Perf-Trace-Util library to the Python path 17 + sys.path.append(os.environ['PERF_EXEC_PATH'] + \ 18 + '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') 19 + 20 + from perf_trace_context import * 21 + from Core import * 22 + 23 + # Uses perf script python interface to parse each 24 + # event and store the data in the thread builder. 25 + def process_event(param_dict: Dict) -> None: 26 + pass 27 + 28 + # Trace_end runs at the end and will be used to aggregate 29 + # the data into the final json object and print it out to stdout. 30 + def trace_end() -> None: 31 + pass