aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2015-03-31 00:19:31 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-04-08 10:04:55 -0300
commit814c8c38e13c7050259c72f89bb01f3fc903f642 (patch)
treebcefeebf548cb2bef07ee42b81518a19ccfe7795 /tools/perf/util/header.c
parentperf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10 (diff)
downloadlinux-dev-814c8c38e13c7050259c72f89bb01f3fc903f642.tar.xz
linux-dev-814c8c38e13c7050259c72f89bb01f3fc903f642.zip
perf record: Add clockid parameter
Teach perf-record about the new perf_event_attr::{use_clockid, clockid} fields. Add a simple parameter to set the clock (if any) to be used for the events to be recorded into the data file. Since we store the entire perf_event_attr in the EVENT_DESC section we also already store the used clockid in the data file. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: David Ahern <dsahern@gmail.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yunlong Song <yunlong.song@huawei.com> Link: http://lkml.kernel.org/r/20150407154851.GR23123@twins.programming.kicks-ass.net [ Conditionally define CLOCK_BOOTTIME, at least rhel6 doesn't have it - dsahern Ditto for CLOCK_MONOTONIC_RAW, sles11sp2 doesn't have it - yunlong.song ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index fb432153e2aa..de5f4669ba5f 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1098,6 +1098,9 @@ static void print_event_desc(struct perf_header *ph, int fd, FILE *fp)
}
fprintf(fp, " }");
}
+ if (evsel->attr.use_clockid)
+ fprintf(fp, ", clockid = %d", evsel->attr.clockid);
+
fputc('\n', fp);
}