summaryrefslogtreecommitdiff
path: root/tools/perf/util/event.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2013-08-27 11:23:12 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-08-29 16:44:26 -0300
commitb1cf6f65aa7096984836addab7cec6b5b6d4393a (patch)
tree3277b767bb9744acf84bcbdd67798ab114cb817f /tools/perf/util/event.h
parentd03f2170546d2f0c236a42706d211e15ffb64184 (diff)
perf tools: Add a function to calculate sample event size
Add perf_event__sample_event_size() which can be used when synthesizing sample events to determine how big the resulting event will be, and therefore how much memory to allocate. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1377591794-30553-11-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r--tools/perf/util/event.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 1c80e1304e48..93130d856bf0 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -229,6 +229,8 @@ int perf_event__preprocess_sample(const union perf_event *self,
const char *perf_event__name(unsigned int id);
+size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
+ u64 sample_regs_user, u64 read_format);
int perf_event__synthesize_sample(union perf_event *event, u64 type,
u64 sample_regs_user, u64 read_format,
const struct perf_sample *sample,