diff options
Diffstat (limited to 'tools/perf/builtin-inject.c')
| -rw-r--r-- | tools/perf/builtin-inject.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 3beab489afc5..1eaa6617c814 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
| @@ -17,9 +17,9 @@ | |||
| 17 | static char const *input_name = "-"; | 17 | static char const *input_name = "-"; |
| 18 | static bool inject_build_ids; | 18 | static bool inject_build_ids; |
| 19 | 19 | ||
| 20 | static int perf_event__repipe_synth(struct perf_tool *tool __used, | 20 | static int perf_event__repipe_synth(struct perf_tool *tool __maybe_unused, |
| 21 | union perf_event *event, | 21 | union perf_event *event, |
| 22 | struct machine *machine __used) | 22 | struct machine *machine __maybe_unused) |
| 23 | { | 23 | { |
| 24 | uint32_t size; | 24 | uint32_t size; |
| 25 | void *buf = event; | 25 | void *buf = event; |
| @@ -40,7 +40,8 @@ static int perf_event__repipe_synth(struct perf_tool *tool __used, | |||
| 40 | 40 | ||
| 41 | static int perf_event__repipe_op2_synth(struct perf_tool *tool, | 41 | static int perf_event__repipe_op2_synth(struct perf_tool *tool, |
| 42 | union perf_event *event, | 42 | union perf_event *event, |
| 43 | struct perf_session *session __used) | 43 | struct perf_session *session |
| 44 | __maybe_unused) | ||
| 44 | { | 45 | { |
| 45 | return perf_event__repipe_synth(tool, event, NULL); | 46 | return perf_event__repipe_synth(tool, event, NULL); |
| 46 | } | 47 | } |
| @@ -52,13 +53,14 @@ static int perf_event__repipe_event_type_synth(struct perf_tool *tool, | |||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | static int perf_event__repipe_tracing_data_synth(union perf_event *event, | 55 | static int perf_event__repipe_tracing_data_synth(union perf_event *event, |
| 55 | struct perf_session *session __used) | 56 | struct perf_session *session |
| 57 | __maybe_unused) | ||
| 56 | { | 58 | { |
| 57 | return perf_event__repipe_synth(NULL, event, NULL); | 59 | return perf_event__repipe_synth(NULL, event, NULL); |
| 58 | } | 60 | } |
| 59 | 61 | ||
| 60 | static int perf_event__repipe_attr(union perf_event *event, | 62 | static int perf_event__repipe_attr(union perf_event *event, |
| 61 | struct perf_evlist **pevlist __used) | 63 | struct perf_evlist **pevlist __maybe_unused) |
| 62 | { | 64 | { |
| 63 | int ret; | 65 | int ret; |
| 64 | ret = perf_event__process_attr(event, pevlist); | 66 | ret = perf_event__process_attr(event, pevlist); |
| @@ -70,7 +72,7 @@ static int perf_event__repipe_attr(union perf_event *event, | |||
| 70 | 72 | ||
| 71 | static int perf_event__repipe(struct perf_tool *tool, | 73 | static int perf_event__repipe(struct perf_tool *tool, |
| 72 | union perf_event *event, | 74 | union perf_event *event, |
| 73 | struct perf_sample *sample __used, | 75 | struct perf_sample *sample __maybe_unused, |
| 74 | struct machine *machine) | 76 | struct machine *machine) |
| 75 | { | 77 | { |
| 76 | return perf_event__repipe_synth(tool, event, machine); | 78 | return perf_event__repipe_synth(tool, event, machine); |
| @@ -78,8 +80,8 @@ static int perf_event__repipe(struct perf_tool *tool, | |||
| 78 | 80 | ||
| 79 | static int perf_event__repipe_sample(struct perf_tool *tool, | 81 | static int perf_event__repipe_sample(struct perf_tool *tool, |
| 80 | union perf_event *event, | 82 | union perf_event *event, |
| 81 | struct perf_sample *sample __used, | 83 | struct perf_sample *sample __maybe_unused, |
| 82 | struct perf_evsel *evsel __used, | 84 | struct perf_evsel *evsel __maybe_unused, |
| 83 | struct machine *machine) | 85 | struct machine *machine) |
| 84 | { | 86 | { |
| 85 | return perf_event__repipe_synth(tool, event, machine); | 87 | return perf_event__repipe_synth(tool, event, machine); |
| @@ -163,7 +165,7 @@ static int dso__inject_build_id(struct dso *self, struct perf_tool *tool, | |||
| 163 | static int perf_event__inject_buildid(struct perf_tool *tool, | 165 | static int perf_event__inject_buildid(struct perf_tool *tool, |
| 164 | union perf_event *event, | 166 | union perf_event *event, |
| 165 | struct perf_sample *sample, | 167 | struct perf_sample *sample, |
| 166 | struct perf_evsel *evsel __used, | 168 | struct perf_evsel *evsel __maybe_unused, |
| 167 | struct machine *machine) | 169 | struct machine *machine) |
| 168 | { | 170 | { |
| 169 | struct addr_location al; | 171 | struct addr_location al; |
| @@ -191,10 +193,13 @@ static int perf_event__inject_buildid(struct perf_tool *tool, | |||
| 191 | * If this fails, too bad, let the other side | 193 | * If this fails, too bad, let the other side |
| 192 | * account this as unresolved. | 194 | * account this as unresolved. |
| 193 | */ | 195 | */ |
| 194 | } else | 196 | } else { |
| 197 | #ifndef NO_LIBELF_SUPPORT | ||
| 195 | pr_warning("no symbols found in %s, maybe " | 198 | pr_warning("no symbols found in %s, maybe " |
| 196 | "install a debug package?\n", | 199 | "install a debug package?\n", |
| 197 | al.map->dso->long_name); | 200 | al.map->dso->long_name); |
| 201 | #endif | ||
| 202 | } | ||
| 198 | } | 203 | } |
| 199 | } | 204 | } |
| 200 | 205 | ||
| @@ -221,7 +226,7 @@ struct perf_tool perf_inject = { | |||
| 221 | 226 | ||
| 222 | extern volatile int session_done; | 227 | extern volatile int session_done; |
| 223 | 228 | ||
| 224 | static void sig_handler(int sig __attribute__((__unused__))) | 229 | static void sig_handler(int sig __maybe_unused) |
| 225 | { | 230 | { |
| 226 | session_done = 1; | 231 | session_done = 1; |
| 227 | } | 232 | } |
| @@ -264,7 +269,7 @@ static const struct option options[] = { | |||
| 264 | OPT_END() | 269 | OPT_END() |
| 265 | }; | 270 | }; |
| 266 | 271 | ||
| 267 | int cmd_inject(int argc, const char **argv, const char *prefix __used) | 272 | int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) |
| 268 | { | 273 | { |
| 269 | argc = parse_options(argc, argv, options, report_usage, 0); | 274 | argc = parse_options(argc, argv, options, report_usage, 0); |
| 270 | 275 | ||
