perf ordered_events: Allow tools to specify a deliver method
So that we can simplify the deliver method to pass just: (ordered_events, ordered_event, sample); Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-j0s4bpxs5qza5tnkvjwom9rw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
#include "perf_regs.h"
|
||||
#include "asm/bug.h"
|
||||
|
||||
static int machines__deliver_event(struct machines *machines,
|
||||
struct perf_evlist *evlist,
|
||||
union perf_event *event,
|
||||
struct perf_sample *sample,
|
||||
struct perf_tool *tool, u64 file_offset);
|
||||
|
||||
static int perf_session__open(struct perf_session *session)
|
||||
{
|
||||
struct perf_data_file *file = session->file;
|
||||
@@ -86,6 +92,14 @@ static void perf_session__set_comm_exec(struct perf_session *session)
|
||||
machines__set_comm_exec(&session->machines, comm_exec);
|
||||
}
|
||||
|
||||
static int ordered_events__deliver_event(struct ordered_events *oe,
|
||||
struct ordered_event *event,
|
||||
struct perf_sample *sample)
|
||||
{
|
||||
return machines__deliver_event(oe->machines, oe->evlist, event->event,
|
||||
sample, oe->tool, event->file_offset);
|
||||
}
|
||||
|
||||
struct perf_session *perf_session__new(struct perf_data_file *file,
|
||||
bool repipe, struct perf_tool *tool)
|
||||
{
|
||||
@@ -125,8 +139,10 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
|
||||
tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) {
|
||||
dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
|
||||
tool->ordered_events = false;
|
||||
} else
|
||||
ordered_events__init(&session->ordered_events, &session->machines, session->evlist, tool);
|
||||
} else {
|
||||
ordered_events__init(&session->ordered_events, &session->machines,
|
||||
session->evlist, tool, ordered_events__deliver_event);
|
||||
}
|
||||
|
||||
return session;
|
||||
|
||||
@@ -888,11 +904,11 @@ static int
|
||||
&sample->read.one, machine);
|
||||
}
|
||||
|
||||
int machines__deliver_event(struct machines *machines,
|
||||
struct perf_evlist *evlist,
|
||||
union perf_event *event,
|
||||
struct perf_sample *sample,
|
||||
struct perf_tool *tool, u64 file_offset)
|
||||
static int machines__deliver_event(struct machines *machines,
|
||||
struct perf_evlist *evlist,
|
||||
union perf_event *event,
|
||||
struct perf_sample *sample,
|
||||
struct perf_tool *tool, u64 file_offset)
|
||||
{
|
||||
struct perf_evsel *evsel;
|
||||
struct machine *machine;
|
||||
|
Reference in New Issue
Block a user