summaryrefslogtreecommitdiff
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 8e4f0755d2aa..b8da60d1ecb5 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -16,6 +16,19 @@
#include "cpumap.h"
#include "event-parse.h"
+int perf_session__parse_sample(struct perf_session *session,
+ const union perf_event *event,
+ struct perf_sample *sample)
+{
+ struct perf_evsel *first;
+ first = list_entry(session->evlist->entries.next, struct perf_evsel, node);
+
+ return perf_event__parse_sample(event, session->sample_type,
+ first->sample_size,
+ session->sample_id_all, sample,
+ session->header.needs_swap);
+}
+
static int perf_session__open(struct perf_session *self, bool force)
{
struct stat input_stat;
@@ -83,7 +96,6 @@ out_close:
void perf_session__update_sample_type(struct perf_session *self)
{
self->sample_type = perf_evlist__sample_type(self->evlist);
- self->sample_size = __perf_evsel__sample_size(self->sample_type);
self->sample_id_all = perf_evlist__sample_id_all(self->evlist);
self->id_hdr_size = perf_evlist__id_hdr_size(self->evlist);
self->host_machine.id_hdr_size = self->id_hdr_size;