aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/thread-stack.h
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/thread-stack.h
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/thread-stack.h')
-rw-r--r--tools/perf/util/thread-stack.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/thread-stack.h b/tools/perf/util/thread-stack.h
index b7c04e19ad41..9c45f947f5a9 100644
--- a/tools/perf/util/thread-stack.h
+++ b/tools/perf/util/thread-stack.h
@@ -55,6 +55,7 @@ enum {
* @call_ref: external reference to 'call' sample (e.g. db_id)
* @return_ref: external reference to 'return' sample (e.g. db_id)
* @db_id: id used for db-export
+ * @parent_db_id: id of parent call used for db-export
* @flags: Call/Return flags
*/
struct call_return {
@@ -67,6 +68,7 @@ struct call_return {
u64 call_ref;
u64 return_ref;
u64 db_id;
+ u64 parent_db_id;
u32 flags;
};
@@ -79,7 +81,7 @@ struct call_return {
*/
struct call_return_processor {
struct call_path_root *cpr;
- int (*process)(struct call_return *cr, void *data);
+ int (*process)(struct call_return *cr, u64 *parent_db_id, void *data);
void *data;
};
@@ -93,7 +95,7 @@ void thread_stack__free(struct thread *thread);
size_t thread_stack__depth(struct thread *thread, int cpu);
struct call_return_processor *
-call_return_processor__new(int (*process)(struct call_return *cr, void *data),
+call_return_processor__new(int (*process)(struct call_return *cr, u64 *parent_db_id, void *data),
void *data);
void call_return_processor__free(struct call_return_processor *crp);
int thread_stack__process(struct thread *thread, struct comm *comm,