diff options
Diffstat (limited to 'tools/perf/builtin-inject.c')
-rw-r--r-- | tools/perf/builtin-inject.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 8e3e47b064ce..4b66b8579410 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -16,8 +16,8 @@ | |||
16 | static char const *input_name = "-"; | 16 | static char const *input_name = "-"; |
17 | static bool inject_build_ids; | 17 | static bool inject_build_ids; |
18 | 18 | ||
19 | static int event__repipe(event_t *event __used, | 19 | static int event__repipe_synth(event_t *event, |
20 | struct perf_session *session __used) | 20 | struct perf_session *session __used) |
21 | { | 21 | { |
22 | uint32_t size; | 22 | uint32_t size; |
23 | void *buf = event; | 23 | void *buf = event; |
@@ -36,22 +36,30 @@ static int event__repipe(event_t *event __used, | |||
36 | return 0; | 36 | return 0; |
37 | } | 37 | } |
38 | 38 | ||
39 | static int event__repipe_mmap(event_t *self, struct perf_session *session) | 39 | static int event__repipe(event_t *event, struct sample_data *sample __used, |
40 | struct perf_session *session) | ||
41 | { | ||
42 | return event__repipe_synth(event, session); | ||
43 | } | ||
44 | |||
45 | static int event__repipe_mmap(event_t *self, struct sample_data *sample, | ||
46 | struct perf_session *session) | ||
40 | { | 47 | { |
41 | int err; | 48 | int err; |
42 | 49 | ||
43 | err = event__process_mmap(self, session); | 50 | err = event__process_mmap(self, sample, session); |
44 | event__repipe(self, session); | 51 | event__repipe(self, sample, session); |
45 | 52 | ||
46 | return err; | 53 | return err; |
47 | } | 54 | } |
48 | 55 | ||
49 | static int event__repipe_task(event_t *self, struct perf_session *session) | 56 | static int event__repipe_task(event_t *self, struct sample_data *sample, |
57 | struct perf_session *session) | ||
50 | { | 58 | { |
51 | int err; | 59 | int err; |
52 | 60 | ||
53 | err = event__process_task(self, session); | 61 | err = event__process_task(self, sample, session); |
54 | event__repipe(self, session); | 62 | event__repipe(self, sample, session); |
55 | 63 | ||
56 | return err; | 64 | return err; |
57 | } | 65 | } |
@@ -61,7 +69,7 @@ static int event__repipe_tracing_data(event_t *self, | |||
61 | { | 69 | { |
62 | int err; | 70 | int err; |
63 | 71 | ||
64 | event__repipe(self, session); | 72 | event__repipe_synth(self, session); |
65 | err = event__process_tracing_data(self, session); | 73 | err = event__process_tracing_data(self, session); |
66 | 74 | ||
67 | return err; | 75 | return err; |
@@ -111,7 +119,8 @@ static int dso__inject_build_id(struct dso *self, struct perf_session *session) | |||
111 | return 0; | 119 | return 0; |
112 | } | 120 | } |
113 | 121 | ||
114 | static int event__inject_buildid(event_t *event, struct perf_session *session) | 122 | static int event__inject_buildid(event_t *event, struct sample_data *sample, |
123 | struct perf_session *session) | ||
115 | { | 124 | { |
116 | struct addr_location al; | 125 | struct addr_location al; |
117 | struct thread *thread; | 126 | struct thread *thread; |
@@ -146,7 +155,7 @@ static int event__inject_buildid(event_t *event, struct perf_session *session) | |||
146 | } | 155 | } |
147 | 156 | ||
148 | repipe: | 157 | repipe: |
149 | event__repipe(event, session); | 158 | event__repipe(event, sample, session); |
150 | return 0; | 159 | return 0; |
151 | } | 160 | } |
152 | 161 | ||
@@ -160,10 +169,10 @@ struct perf_event_ops inject_ops = { | |||
160 | .read = event__repipe, | 169 | .read = event__repipe, |
161 | .throttle = event__repipe, | 170 | .throttle = event__repipe, |
162 | .unthrottle = event__repipe, | 171 | .unthrottle = event__repipe, |
163 | .attr = event__repipe, | 172 | .attr = event__repipe_synth, |
164 | .event_type = event__repipe, | 173 | .event_type = event__repipe_synth, |
165 | .tracing_data = event__repipe, | 174 | .tracing_data = event__repipe_synth, |
166 | .build_id = event__repipe, | 175 | .build_id = event__repipe_synth, |
167 | }; | 176 | }; |
168 | 177 | ||
169 | extern volatile int session_done; | 178 | extern volatile int session_done; |