diff options
author | David Ahern <daahern@cisco.com> | 2011-03-10 00:23:23 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-14 16:05:50 -0400 |
commit | be6d842a65babc54e2b204b382df2529e304be48 (patch) | |
tree | d8f3c9fb9f1457dcfa782102d2b27e0212bad009 /tools/perf/builtin-script.c | |
parent | cfd748ae066e776d45bdce550b47cd00c67d55de (diff) |
perf script: Change process_event prototype
Prepare for handling of samples for any event type.
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <1299734608-5223-2-git-send-email-daahern@cisco.com>
Signed-off-by: David Ahern <daahern@cisco.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 5f40df635dcb..b2bdd5534026 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -20,6 +20,20 @@ static u64 last_timestamp; | |||
20 | static u64 nr_unordered; | 20 | static u64 nr_unordered; |
21 | extern const struct option record_options[]; | 21 | extern const struct option record_options[]; |
22 | 22 | ||
23 | static void process_event(union perf_event *event __unused, | ||
24 | struct perf_sample *sample, | ||
25 | struct perf_session *session __unused, | ||
26 | struct thread *thread) | ||
27 | { | ||
28 | /* | ||
29 | * FIXME: better resolve from pid from the struct trace_entry | ||
30 | * field, although it should be the same than this perf | ||
31 | * event pid | ||
32 | */ | ||
33 | print_event(sample->cpu, sample->raw_data, sample->raw_size, | ||
34 | sample->time, thread->comm); | ||
35 | } | ||
36 | |||
23 | static int default_start_script(const char *script __unused, | 37 | static int default_start_script(const char *script __unused, |
24 | int argc __unused, | 38 | int argc __unused, |
25 | const char **argv __unused) | 39 | const char **argv __unused) |
@@ -40,7 +54,7 @@ static int default_generate_script(const char *outfile __unused) | |||
40 | static struct scripting_ops default_scripting_ops = { | 54 | static struct scripting_ops default_scripting_ops = { |
41 | .start_script = default_start_script, | 55 | .start_script = default_start_script, |
42 | .stop_script = default_stop_script, | 56 | .stop_script = default_stop_script, |
43 | .process_event = print_event, | 57 | .process_event = process_event, |
44 | .generate_script = default_generate_script, | 58 | .generate_script = default_generate_script, |
45 | }; | 59 | }; |
46 | 60 | ||
@@ -86,14 +100,7 @@ static int process_sample_event(union perf_event *event, | |||
86 | last_timestamp = sample->time; | 100 | last_timestamp = sample->time; |
87 | return 0; | 101 | return 0; |
88 | } | 102 | } |
89 | /* | 103 | scripting_ops->process_event(event, sample, session, thread); |
90 | * FIXME: better resolve from pid from the struct trace_entry | ||
91 | * field, although it should be the same than this perf | ||
92 | * event pid | ||
93 | */ | ||
94 | scripting_ops->process_event(sample->cpu, sample->raw_data, | ||
95 | sample->raw_size, | ||
96 | sample->time, thread->comm); | ||
97 | } | 104 | } |
98 | 105 | ||
99 | session->hists.stats.total_period += sample->period; | 106 | session->hists.stats.total_period += sample->period; |