Skip to content

Commit

Permalink
perf ordered_events: Pass timestamp arg in perf_session__queue_event
Browse files Browse the repository at this point in the history
There's no need to pass whole sample data, because it's only timestamp
that is used.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-xd1hpoze3kgb1rb639o3vehb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Nov 17, 2017
1 parent 0146812 commit dc83e13
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tools/perf/builtin-kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx,
return -1;
}

err = perf_session__queue_event(kvm->session, event, &sample, 0);
err = perf_session__queue_event(kvm->session, event, sample.time, 0);
/*
* FIXME: Here we can't consume the event, as perf_session__queue_event will
* point to it, and it'll get possibly overwritten by the kernel.
Expand Down
3 changes: 1 addition & 2 deletions tools/perf/util/ordered-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ void ordered_events__delete(struct ordered_events *oe, struct ordered_event *eve
}

int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
struct perf_sample *sample, u64 file_offset)
u64 timestamp, u64 file_offset)
{
u64 timestamp = sample->time;
struct ordered_event *oevent;

if (!timestamp || timestamp == ~0ULL)
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/ordered-events.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct ordered_events {
};

int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
struct perf_sample *sample, u64 file_offset);
u64 timestamp, u64 file_offset);
void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver);
Expand Down
6 changes: 3 additions & 3 deletions tools/perf/util/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,9 @@ static int process_finished_round(struct perf_tool *tool __maybe_unused,
}

int perf_session__queue_event(struct perf_session *s, union perf_event *event,
struct perf_sample *sample, u64 file_offset)
u64 timestamp, u64 file_offset)
{
return ordered_events__queue(&s->ordered_events, event, sample, file_offset);
return ordered_events__queue(&s->ordered_events, event, timestamp, file_offset);
}

static void callchain__lbr_callstack_printf(struct perf_sample *sample)
Expand Down Expand Up @@ -1517,7 +1517,7 @@ static s64 perf_session__process_event(struct perf_session *session,
return ret;

if (tool->ordered_events) {
ret = perf_session__queue_event(session, event, &sample, file_offset);
ret = perf_session__queue_event(session, event, sample.time, file_offset);
if (ret != -ETIME)
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int perf_session__peek_event(struct perf_session *session, off_t file_offset,
int perf_session__process_events(struct perf_session *session);

int perf_session__queue_event(struct perf_session *s, union perf_event *event,
struct perf_sample *sample, u64 file_offset);
u64 timestamp, u64 file_offset);

void perf_tool__fill_defaults(struct perf_tool *tool);

Expand Down

0 comments on commit dc83e13

Please sign in to comment.