Commit Graph

2 Commits

Author SHA1 Message Date
Michael Petlan bc1878a301 perf scripts python: Fix passing arguments to stackcollapse report
Bugzilla: https://bugzilla.redhat.com/2069070

upstream
========
commit 51ae7fa62dcb0ab96ea5f83aec254a1fb6d4d371
Author: Michael Petlan <mpetlan@redhat.com>
Date: Mon Apr 27 16:23:27 2020 +0200

description
===========
The '--' prevented arguments from being passed to the script, such as:

  $ perf script report stackcollapse -i my_perf.data

LPU-Reference: 20200427142327.21172-1-mpetlan@redhat.com

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
2022-04-25 12:33:11 +02:00
Paolo Bonzini 6745d8ea82 perf script: Add stackcollapse.py script
Add stackcollapse.py script as an example of parsing call chains, and
also of using optparse to access command line options.

The flame graph tools include a set of scripts that parse output from
various tools (including "perf script"), remove the offsets in the
function and collapse each stack to a single line.  The website also
says "perf report could have a report style [...] that output folded
stacks directly, obviating the need for stackcollapse-perf.pl", so here
it is.

This script is a Python rewrite of stackcollapse-perf.pl, using the perf
scripting interface to access the perf data directly from Python.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Brendan Gregg <bgregg@netflix.com>
Link: http://lkml.kernel.org/r/1460467573-22989-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-06-21 13:18:35 -03:00