summaryrefslogtreecommitdiff
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-10-25 17:51:22 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-12-17 20:38:17 +0300
commitec7fa596f514b76a5f1003ffe9e6dfb50cb9e811 (patch)
tree41a89d5abf5b02a10f7d55a76e7e07b0f5181868 /tools/perf/util/event.c
parent59660942397b57b37eccba014544623cf4beb12b (diff)
downloadlinux-ec7fa596f514b76a5f1003ffe9e6dfb50cb9e811.tar.xz
perf thread_map: Add perf_event__fprintf_thread_map function
To display a thread_map event for a raw dump. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Kan Liang <kan.liang@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1445784728-21732-7-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r--tools/perf/util/event.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index b13373a60337..938f006c758e 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -820,6 +820,22 @@ size_t perf_event__fprintf_mmap2(union perf_event *event, FILE *fp)
event->mmap2.filename);
}
+size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp)
+{
+ struct thread_map *threads = thread_map__new_event(&event->thread_map);
+ size_t ret;
+
+ ret = fprintf(fp, " nr: ");
+
+ if (threads)
+ ret += thread_map__fprintf(threads, fp);
+ else
+ ret += fprintf(fp, "failed to get threads from event\n");
+
+ thread_map__put(threads);
+ return ret;
+}
+
int perf_event__process_mmap(struct perf_tool *tool __maybe_unused,
union perf_event *event,
struct perf_sample *sample,