All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools/perf/python/tracepoint.py: Added comments and sample output
@ 2022-04-05  5:03 Tanusree Debnath
  0 siblings, 0 replies; only message in thread
From: Tanusree Debnath @ 2022-04-05  5:03 UTC (permalink / raw)
  To: linux-perf-users; +Cc: mingo, acme, peterz, arnaldo.melo, Jiri Olsa

Hi,
I have added some comments and one sample output for the tracepoint.py file.

Signed-off-by: Tanusree Debnath <tanu235m@gmail.com>

---
tools/perf/python/tracepoint.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/tools/perf/python/tracepoint.py b/tools/perf/python/tracepoint.py
index bba68a6d451..9392dee199a 100755
--- a/tools/perf/python/tracepoint.py
+++ b/tools/perf/python/tracepoint.py
@@ -14,6 +14,22 @@ class tracepoint(perf.evsel):
freq = 0, sample_period = 1, wakeup_events = 1,
sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | perf.SAMPLE_CPU |
perf.SAMPLE_RAW | perf.SAMPLE_TIME)
+
+'''
+Prints sampled time, command, pid, priority, state of previous event and
+command, priority, pid of next event.
+
+Command to run:
+sudo perf script -s tracepoint.py -i perf.data
+
+Example output:
+
+time 656699805729247 prev_comm=perf prev_pid=174965 prev_prio=120
prev_state=0x1 ==> next_comm=swapper/4 next_pid=0 next_prio=120
+time 656699805736173 prev_comm=swapper/4 prev_pid=0 prev_prio=120
prev_state=0x0 ==> next_comm=perf next_pid=174965 next_prio=120
+time 656699805778216 prev_comm=perf prev_pid=174965 prev_prio=120
prev_state=0x1 ==> next_comm=swapper/4 next_pid=0 next_prio=120
+
+'''
+
def main():
tp = tracepoint("sched", "sched_switch")
cpus = perf.cpu_map()
-- 
2.25.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-05  5:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05  5:03 [PATCH] perf tools/perf/python/tracepoint.py: Added comments and sample output Tanusree Debnath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.