mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
perf session: Remove sample_type_check from event_ops
This is really something tools need to do before asking for the events to be processed, leaving perf_session__process_events to do just that, process events. Also add a msg parameter to perf_session__has_traces() so that the right message can be printed, fixing a regression added by me in the previous cset (right timechart message) and also fixing 'perf kmem', that was not asking if 'perf kmem record' was ran. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1261957026-15580-6-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
27295592c2
commit
d549c76901
7 changed files with 31 additions and 27 deletions
|
@ -1657,17 +1657,18 @@ static struct perf_event_ops event_ops = {
|
|||
.process_sample_event = process_sample_event,
|
||||
.process_comm_event = event__process_comm,
|
||||
.process_lost_event = process_lost_event,
|
||||
.sample_type_check = perf_session__has_traces,
|
||||
};
|
||||
|
||||
static int read_events(void)
|
||||
{
|
||||
int err;
|
||||
int err = -EINVAL;
|
||||
struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0);
|
||||
if (session == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
err = perf_session__process_events(session, &event_ops);
|
||||
if (perf_session__has_traces(session, "record -R"))
|
||||
err = perf_session__process_events(session, &event_ops);
|
||||
|
||||
perf_session__delete(session);
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue