aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/scripting-engines
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2019-02-28 15:00:24 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-03-01 14:50:47 -0300
commitf435887ec0c941b97301bd6ed1f3e4b5200df409 (patch)
treee9a1be1b4803aa39ae58d93b000b9e773bbd35ef /tools/perf/util/scripting-engines
parentperf intel-pt: Fix divide by zero when TSC is not available (diff)
downloadlinux-dev-f435887ec0c941b97301bd6ed1f3e4b5200df409.tar.xz
linux-dev-f435887ec0c941b97301bd6ed1f3e4b5200df409.zip
perf db-export: Add calls parent_id to enable creation of call trees
The call_path can be used to find the parent symbol for a call but not the exact parent call. To do that add parent_id to the call_return export. This enables the creation of a call tree from the exported data. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: https://lkml.kernel.org/n/tip-6j7tzdxo67cox6kan7k22oo6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/scripting-engines')
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 0e17db41b49b..09604c6508f0 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -1173,7 +1173,7 @@ static int python_export_call_return(struct db_export *dbe,
u64 comm_db_id = cr->comm ? cr->comm->db_id : 0;
PyObject *t;
- t = tuple_new(11);
+ t = tuple_new(12);
tuple_set_u64(t, 0, cr->db_id);
tuple_set_u64(t, 1, cr->thread->db_id);
@@ -1186,6 +1186,7 @@ static int python_export_call_return(struct db_export *dbe,
tuple_set_u64(t, 8, cr->return_ref);
tuple_set_u64(t, 9, cr->cp->parent->db_id);
tuple_set_s32(t, 10, cr->flags);
+ tuple_set_u64(t, 11, cr->parent_db_id);
call_object(tables->call_return_handler, t, "call_return_table");
@@ -1194,11 +1195,12 @@ static int python_export_call_return(struct db_export *dbe,
return 0;
}
-static int python_process_call_return(struct call_return *cr, void *data)
+static int python_process_call_return(struct call_return *cr, u64 *parent_db_id,
+ void *data)
{
struct db_export *dbe = data;
- return db_export__call_return(dbe, cr);
+ return db_export__call_return(dbe, cr, parent_db_id);
}
static void python_process_general_event(struct perf_sample *sample,