summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-10-25 15:51:26 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-12-17 18:38:18 +0100
commiteb12a1afdc02e59fc09934743490549c77327b1a (patch)
tree5b7001c0cdd905fe342714e6576fe438d0f8031a
parentperf cpu_map: Add cpu_map__new_event function (diff)
downloadlinux-eb12a1afdc02e59fc09934743490549c77327b1a.tar.xz
linux-eb12a1afdc02e59fc09934743490549c77327b1a.zip
perf cpu_map: Add perf_event__fprintf_cpu_map function
To display a cpu_map event for 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-11-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/event.c16
-rw-r--r--tools/perf/util/event.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 15d6466a4b8f..f31ab3b8f918 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -968,6 +968,22 @@ size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp)
return ret;
}
+size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp)
+{
+ struct cpu_map *cpus = cpu_map__new_data(&event->cpu_map.data);
+ size_t ret;
+
+ ret = fprintf(fp, " nr: ");
+
+ if (cpus)
+ ret += cpu_map__fprintf(cpus, fp);
+ else
+ ret += fprintf(fp, "failed to get cpumap from event\n");
+
+ cpu_map__put(cpus);
+ return ret;
+}
+
int perf_event__process_mmap(struct perf_tool *tool __maybe_unused,
union perf_event *event,
struct perf_sample *sample,
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index de18ee0e9c96..74a434116b2c 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -550,6 +550,7 @@ size_t perf_event__fprintf_aux(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_itrace_start(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp);
size_t perf_event__fprintf_thread_map(union perf_event *event, FILE *fp);
+size_t perf_event__fprintf_cpu_map(union perf_event *event, FILE *fp);
size_t perf_event__fprintf(union perf_event *event, FILE *fp);
u64 kallsyms__get_function_start(const char *kallsyms_filename,