Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Use __maybe_used for unused variables

perf defines both __used and __unused variables to use for marking
unused variables. The variable __used is defined to
__attribute__((__unused__)), which contradicts the kernel definition to
__attribute__((__used__)) for new gcc versions. On Android, __used is
also defined in system headers and this leads to warnings like: warning:
'__used__' attribute ignored

__unused is not defined in the kernel and is not a standard definition.
If __unused is included everywhere instead of __used, this leads to
conflicts with glibc headers, since glibc has a variables with this name
in its headers.

The best approach is to use __maybe_unused, the definition used in the
kernel for __attribute__((unused)). In this way there is only one
definition in perf sources (instead of 2 definitions that point to the
same thing: __used and __unused) and it works on both Linux and Android.
This patch simply replaces all instances of __used and __unused with
__maybe_unused.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
[ committer note: fixed up conflict with a116e05 in builtin-sched.c ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Irina Tirdea and committed by
Arnaldo Carvalho de Melo
1d037ca1 7dbf4dcf

+498 -418
+5 -3
tools/lib/traceevent/event-parse.c
··· 1824 1824 } 1825 1825 1826 1826 static enum event_type 1827 - process_entry(struct event_format *event __unused, struct print_arg *arg, 1827 + process_entry(struct event_format *event __maybe_unused, struct print_arg *arg, 1828 1828 char **tok) 1829 1829 { 1830 1830 enum event_type type; ··· 2458 2458 2459 2459 2460 2460 static enum event_type 2461 - process_str(struct event_format *event __unused, struct print_arg *arg, char **tok) 2461 + process_str(struct event_format *event __maybe_unused, struct print_arg *arg, 2462 + char **tok) 2462 2463 { 2463 2464 enum event_type type; 2464 2465 char *token; ··· 3654 3653 } 3655 3654 3656 3655 static char * 3657 - get_bprint_format(void *data, int size __unused, struct event_format *event) 3656 + get_bprint_format(void *data, int size __maybe_unused, 3657 + struct event_format *event) 3658 3658 { 3659 3659 struct pevent *pevent = event->pevent; 3660 3660 unsigned long long addr;
+2 -2
tools/lib/traceevent/event-parse.h
··· 24 24 #include <stdarg.h> 25 25 #include <regex.h> 26 26 27 - #ifndef __unused 28 - #define __unused __attribute__ ((unused)) 27 + #ifndef __maybe_unused 28 + #define __maybe_unused __attribute__((unused)) 29 29 #endif 30 30 31 31 /* ----------------------- trace_seq ----------------------- */
+2 -1
tools/perf/bench/bench.h
··· 3 3 4 4 extern int bench_sched_messaging(int argc, const char **argv, const char *prefix); 5 5 extern int bench_sched_pipe(int argc, const char **argv, const char *prefix); 6 - extern int bench_mem_memcpy(int argc, const char **argv, const char *prefix __used); 6 + extern int bench_mem_memcpy(int argc, const char **argv, 7 + const char *prefix __maybe_unused); 7 8 extern int bench_mem_memset(int argc, const char **argv, const char *prefix); 8 9 9 10 #define BENCH_FORMAT_DEFAULT_STR "default"
+1 -1
tools/perf/bench/mem-memcpy.c
··· 177 177 } while (0) 178 178 179 179 int bench_mem_memcpy(int argc, const char **argv, 180 - const char *prefix __used) 180 + const char *prefix __maybe_unused) 181 181 { 182 182 int i; 183 183 size_t len;
+1 -1
tools/perf/bench/mem-memset.c
··· 171 171 } while (0) 172 172 173 173 int bench_mem_memset(int argc, const char **argv, 174 - const char *prefix __used) 174 + const char *prefix __maybe_unused) 175 175 { 176 176 int i; 177 177 size_t len;
+1 -1
tools/perf/bench/sched-messaging.c
··· 267 267 }; 268 268 269 269 int bench_sched_messaging(int argc, const char **argv, 270 - const char *prefix __used) 270 + const char *prefix __maybe_unused) 271 271 { 272 272 unsigned int i, total_children; 273 273 struct timeval start, stop, diff;
+3 -3
tools/perf/bench/sched-pipe.c
··· 43 43 }; 44 44 45 45 int bench_sched_pipe(int argc, const char **argv, 46 - const char *prefix __used) 46 + const char *prefix __maybe_unused) 47 47 { 48 48 int pipe_1[2], pipe_2[2]; 49 49 int m = 0, i; ··· 55 55 * discarding returned value of read(), write() 56 56 * causes error in building environment for perf 57 57 */ 58 - int __used ret, wait_stat; 59 - pid_t pid, retpid __used; 58 + int __maybe_unused ret, wait_stat; 59 + pid_t pid, retpid __maybe_unused; 60 60 61 61 argc = parse_options(argc, argv, options, 62 62 bench_sched_pipe_usage, 0);
+1 -1
tools/perf/builtin-annotate.c
··· 239 239 NULL 240 240 }; 241 241 242 - int cmd_annotate(int argc, const char **argv, const char *prefix __used) 242 + int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused) 243 243 { 244 244 struct perf_annotate annotate = { 245 245 .tool = {
+1 -1
tools/perf/builtin-bench.c
··· 173 173 all_suite(&subsystems[i]); 174 174 } 175 175 176 - int cmd_bench(int argc, const char **argv, const char *prefix __used) 176 + int cmd_bench(int argc, const char **argv, const char *prefix __maybe_unused) 177 177 { 178 178 int i, j, status = 0; 179 179
+4 -3
tools/perf/builtin-buildid-cache.c
··· 51 51 return err; 52 52 } 53 53 54 - static int build_id_cache__remove_file(const char *filename __used, 55 - const char *debugdir __used) 54 + static int build_id_cache__remove_file(const char *filename __maybe_unused, 55 + const char *debugdir __maybe_unused) 56 56 { 57 57 u8 build_id[BUILD_ID_SIZE]; 58 58 char sbuild_id[BUILD_ID_SIZE * 2 + 1]; ··· 120 120 return 0; 121 121 } 122 122 123 - int cmd_buildid_cache(int argc, const char **argv, const char *prefix __used) 123 + int cmd_buildid_cache(int argc, const char **argv, 124 + const char *prefix __maybe_unused) 124 125 { 125 126 argc = parse_options(argc, argv, buildid_cache_options, 126 127 buildid_cache_usage, 0);
+2 -1
tools/perf/builtin-buildid-list.c
··· 103 103 return perf_session__list_build_ids(); 104 104 } 105 105 106 - int cmd_buildid_list(int argc, const char **argv, const char *prefix __used) 106 + int cmd_buildid_list(int argc, const char **argv, 107 + const char *prefix __maybe_unused) 107 108 { 108 109 argc = parse_options(argc, argv, options, buildid_list_usage, 0); 109 110 setup_pager();
+2 -2
tools/perf/builtin-diff.c
··· 33 33 return -ENOMEM; 34 34 } 35 35 36 - static int diff__process_sample_event(struct perf_tool *tool __used, 36 + static int diff__process_sample_event(struct perf_tool *tool __maybe_unused, 37 37 union perf_event *event, 38 38 struct perf_sample *sample, 39 39 struct perf_evsel *evsel, ··· 242 242 OPT_END() 243 243 }; 244 244 245 - int cmd_diff(int argc, const char **argv, const char *prefix __used) 245 + int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused) 246 246 { 247 247 sort_order = diff__default_sort_order; 248 248 argc = parse_options(argc, argv, options, diff_usage, 0);
+1 -1
tools/perf/builtin-evlist.c
··· 113 113 NULL 114 114 }; 115 115 116 - int cmd_evlist(int argc, const char **argv, const char *prefix __used) 116 + int cmd_evlist(int argc, const char **argv, const char *prefix __maybe_unused) 117 117 { 118 118 struct perf_attr_details details = { .verbose = false, }; 119 119 const char *input_name = NULL;
+1 -1
tools/perf/builtin-help.c
··· 426 426 return 0; 427 427 } 428 428 429 - int cmd_help(int argc, const char **argv, const char *prefix __used) 429 + int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused) 430 430 { 431 431 const char *alias; 432 432 int rc = 0;
+13 -11
tools/perf/builtin-inject.c
··· 17 17 static char const *input_name = "-"; 18 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 21 union perf_event *event, 22 - struct machine *machine __used) 22 + struct machine *machine __maybe_unused) 23 23 { 24 24 uint32_t size; 25 25 void *buf = event; ··· 40 40 41 41 static int perf_event__repipe_op2_synth(struct perf_tool *tool, 42 42 union perf_event *event, 43 - struct perf_session *session __used) 43 + struct perf_session *session 44 + __maybe_unused) 44 45 { 45 46 return perf_event__repipe_synth(tool, event, NULL); 46 47 } ··· 53 52 } 54 53 55 54 static int perf_event__repipe_tracing_data_synth(union perf_event *event, 56 - struct perf_session *session __used) 55 + struct perf_session *session 56 + __maybe_unused) 57 57 { 58 58 return perf_event__repipe_synth(NULL, event, NULL); 59 59 } 60 60 61 61 static int perf_event__repipe_attr(union perf_event *event, 62 - struct perf_evlist **pevlist __used) 62 + struct perf_evlist **pevlist __maybe_unused) 63 63 { 64 64 int ret; 65 65 ret = perf_event__process_attr(event, pevlist); ··· 72 70 73 71 static int perf_event__repipe(struct perf_tool *tool, 74 72 union perf_event *event, 75 - struct perf_sample *sample __used, 73 + struct perf_sample *sample __maybe_unused, 76 74 struct machine *machine) 77 75 { 78 76 return perf_event__repipe_synth(tool, event, machine); ··· 80 78 81 79 static int perf_event__repipe_sample(struct perf_tool *tool, 82 80 union perf_event *event, 83 - struct perf_sample *sample __used, 84 - struct perf_evsel *evsel __used, 81 + struct perf_sample *sample __maybe_unused, 82 + struct perf_evsel *evsel __maybe_unused, 85 83 struct machine *machine) 86 84 { 87 85 return perf_event__repipe_synth(tool, event, machine); ··· 165 163 static int perf_event__inject_buildid(struct perf_tool *tool, 166 164 union perf_event *event, 167 165 struct perf_sample *sample, 168 - struct perf_evsel *evsel __used, 166 + struct perf_evsel *evsel __maybe_unused, 169 167 struct machine *machine) 170 168 { 171 169 struct addr_location al; ··· 226 224 227 225 extern volatile int session_done; 228 226 229 - static void sig_handler(int sig __attribute__((__unused__))) 227 + static void sig_handler(int sig __maybe_unused) 230 228 { 231 229 session_done = 1; 232 230 } ··· 269 267 OPT_END() 270 268 }; 271 269 272 - int cmd_inject(int argc, const char **argv, const char *prefix __used) 270 + int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) 273 271 { 274 272 argc = parse_options(argc, argv, options, report_usage, 0); 275 273
+12 -10
tools/perf/builtin-kmem.c
··· 320 320 return 0; 321 321 } 322 322 323 - static int process_sample_event(struct perf_tool *tool __used, 323 + static int process_sample_event(struct perf_tool *tool __maybe_unused, 324 324 union perf_event *event, 325 325 struct perf_sample *sample, 326 326 struct perf_evsel *evsel, ··· 672 672 return 0; 673 673 } 674 674 675 - static int parse_sort_opt(const struct option *opt __used, 676 - const char *arg, int unset __used) 675 + static int parse_sort_opt(const struct option *opt __maybe_unused, 676 + const char *arg, int unset __maybe_unused) 677 677 { 678 678 if (!arg) 679 679 return -1; ··· 686 686 return 0; 687 687 } 688 688 689 - static int parse_caller_opt(const struct option *opt __used, 690 - const char *arg __used, int unset __used) 689 + static int parse_caller_opt(const struct option *opt __maybe_unused, 690 + const char *arg __maybe_unused, 691 + int unset __maybe_unused) 691 692 { 692 693 caller_flag = (alloc_flag + 1); 693 694 return 0; 694 695 } 695 696 696 - static int parse_alloc_opt(const struct option *opt __used, 697 - const char *arg __used, int unset __used) 697 + static int parse_alloc_opt(const struct option *opt __maybe_unused, 698 + const char *arg __maybe_unused, 699 + int unset __maybe_unused) 698 700 { 699 701 alloc_flag = (caller_flag + 1); 700 702 return 0; 701 703 } 702 704 703 - static int parse_line_opt(const struct option *opt __used, 704 - const char *arg, int unset __used) 705 + static int parse_line_opt(const struct option *opt __maybe_unused, 706 + const char *arg, int unset __maybe_unused) 705 707 { 706 708 int lines; 707 709 ··· 773 771 return cmd_record(i, rec_argv, NULL); 774 772 } 775 773 776 - int cmd_kmem(int argc, const char **argv, const char *prefix __used) 774 + int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused) 777 775 { 778 776 argc = parse_options(argc, argv, kmem_options, kmem_usage, 0); 779 777
+1 -1
tools/perf/builtin-kvm.c
··· 102 102 return cmd_buildid_list(i, rec_argv, NULL); 103 103 } 104 104 105 - int cmd_kvm(int argc, const char **argv, const char *prefix __used) 105 + int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused) 106 106 { 107 107 perf_host = 0; 108 108 perf_guest = 1;
+1 -1
tools/perf/builtin-list.c
··· 14 14 #include "util/parse-events.h" 15 15 #include "util/cache.h" 16 16 17 - int cmd_list(int argc, const char **argv, const char *prefix __used) 17 + int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) 18 18 { 19 19 setup_pager(); 20 20
+2 -2
tools/perf/builtin-lock.c
··· 870 870 return rc; 871 871 } 872 872 873 - static int process_sample_event(struct perf_tool *tool __used, 873 + static int process_sample_event(struct perf_tool *tool __maybe_unused, 874 874 union perf_event *event, 875 875 struct perf_sample *sample, 876 876 struct perf_evsel *evsel, ··· 1020 1020 return cmd_record(i, rec_argv, NULL); 1021 1021 } 1022 1022 1023 - int cmd_lock(int argc, const char **argv, const char *prefix __used) 1023 + int cmd_lock(int argc, const char **argv, const char *prefix __maybe_unused) 1024 1024 { 1025 1025 unsigned int i; 1026 1026 int rc = 0;
+12 -12
tools/perf/builtin-probe.c
··· 143 143 return ret; 144 144 } 145 145 146 - static int opt_add_probe_event(const struct option *opt __used, 147 - const char *str, int unset __used) 146 + static int opt_add_probe_event(const struct option *opt __maybe_unused, 147 + const char *str, int unset __maybe_unused) 148 148 { 149 149 if (str) { 150 150 params.mod_events = true; ··· 153 153 return 0; 154 154 } 155 155 156 - static int opt_del_probe_event(const struct option *opt __used, 157 - const char *str, int unset __used) 156 + static int opt_del_probe_event(const struct option *opt __maybe_unused, 157 + const char *str, int unset __maybe_unused) 158 158 { 159 159 if (str) { 160 160 params.mod_events = true; ··· 166 166 } 167 167 168 168 static int opt_set_target(const struct option *opt, const char *str, 169 - int unset __used) 169 + int unset __maybe_unused) 170 170 { 171 171 int ret = -ENOENT; 172 172 ··· 188 188 } 189 189 190 190 #ifdef DWARF_SUPPORT 191 - static int opt_show_lines(const struct option *opt __used, 192 - const char *str, int unset __used) 191 + static int opt_show_lines(const struct option *opt __maybe_unused, 192 + const char *str, int unset __maybe_unused) 193 193 { 194 194 int ret = 0; 195 195 ··· 209 209 return ret; 210 210 } 211 211 212 - static int opt_show_vars(const struct option *opt __used, 213 - const char *str, int unset __used) 212 + static int opt_show_vars(const struct option *opt __maybe_unused, 213 + const char *str, int unset __maybe_unused) 214 214 { 215 215 struct perf_probe_event *pev = &params.events[params.nevents]; 216 216 int ret; ··· 229 229 } 230 230 #endif 231 231 232 - static int opt_set_filter(const struct option *opt __used, 233 - const char *str, int unset __used) 232 + static int opt_set_filter(const struct option *opt __maybe_unused, 233 + const char *str, int unset __maybe_unused) 234 234 { 235 235 const char *err; 236 236 ··· 327 327 OPT_END() 328 328 }; 329 329 330 - int cmd_probe(int argc, const char **argv, const char *prefix __used) 330 + int cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused) 331 331 { 332 332 int ret; 333 333
+5 -5
tools/perf/builtin-record.c
··· 92 92 93 93 static int process_synthesized_event(struct perf_tool *tool, 94 94 union perf_event *event, 95 - struct perf_sample *sample __used, 96 - struct machine *machine __used) 95 + struct perf_sample *sample __maybe_unused, 96 + struct machine *machine __maybe_unused) 97 97 { 98 98 struct perf_record *rec = container_of(tool, struct perf_record, tool); 99 99 if (write_output(rec, event, event->header.size) < 0) ··· 159 159 signr = sig; 160 160 } 161 161 162 - static void perf_record__sig_exit(int exit_status __used, void *arg) 162 + static void perf_record__sig_exit(int exit_status __maybe_unused, void *arg) 163 163 { 164 164 struct perf_record *rec = arg; 165 165 int status; ··· 827 827 #endif /* !NO_LIBUNWIND_SUPPORT */ 828 828 829 829 static int 830 - parse_callchain_opt(const struct option *opt __used, const char *arg, 830 + parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg, 831 831 int unset) 832 832 { 833 833 struct perf_record *rec = (struct perf_record *)opt->value; ··· 1003 1003 OPT_END() 1004 1004 }; 1005 1005 1006 - int cmd_record(int argc, const char **argv, const char *prefix __used) 1006 + int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused) 1007 1007 { 1008 1008 int err = -ENOMEM; 1009 1009 struct perf_evsel *pos;
+6 -5
tools/perf/builtin-report.c
··· 223 223 224 224 static int process_read_event(struct perf_tool *tool, 225 225 union perf_event *event, 226 - struct perf_sample *sample __used, 226 + struct perf_sample *sample __maybe_unused, 227 227 struct perf_evsel *evsel, 228 - struct machine *machine __used) 228 + struct machine *machine __maybe_unused) 229 229 { 230 230 struct perf_report *rep = container_of(tool, struct perf_report, tool); 231 231 ··· 287 287 288 288 extern volatile int session_done; 289 289 290 - static void sig_handler(int sig __used) 290 + static void sig_handler(int sig __maybe_unused) 291 291 { 292 292 session_done = 1; 293 293 } ··· 533 533 } 534 534 535 535 static int 536 - parse_branch_mode(const struct option *opt __used, const char *str __used, int unset) 536 + parse_branch_mode(const struct option *opt __maybe_unused, 537 + const char *str __maybe_unused, int unset) 537 538 { 538 539 sort__branch_mode = !unset; 539 540 return 0; 540 541 } 541 542 542 - int cmd_report(int argc, const char **argv, const char *prefix __used) 543 + int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) 543 544 { 544 545 struct perf_session *session; 545 546 struct stat st;
+48 -54
tools/perf/builtin-sched.c
··· 299 299 300 300 static void 301 301 add_sched_event_sleep(struct task_desc *task, u64 timestamp, 302 - u64 task_state __used) 302 + u64 task_state __maybe_unused) 303 303 { 304 304 struct sched_atom *event = get_new_event(task, timestamp); 305 305 ··· 369 369 } 370 370 } 371 371 372 - static void 373 - process_sched_event(struct task_desc *this_task __used, struct sched_atom *atom) 372 + static void process_sched_event(struct task_desc *this_task __maybe_unused, 373 + struct sched_atom *atom) 374 374 { 375 375 int ret = 0; 376 376 ··· 752 752 753 753 static int 754 754 replay_wakeup_event(struct trace_wakeup_event *wakeup_event, 755 - struct machine *machine __used, 755 + struct machine *machine __maybe_unused, 756 756 struct event_format *event, struct perf_sample *sample) 757 757 { 758 758 struct task_desc *waker, *wakee; ··· 777 777 778 778 static int 779 779 replay_switch_event(struct trace_switch_event *switch_event, 780 - struct machine *machine __used, 780 + struct machine *machine __maybe_unused, 781 781 struct event_format *event, 782 782 struct perf_sample *sample) 783 783 { 784 - struct task_desc *prev, __used *next; 784 + struct task_desc *prev, __maybe_unused *next; 785 785 u64 timestamp0, timestamp = sample->time; 786 786 int cpu = sample->cpu; 787 787 s64 delta; ··· 932 932 return 0; 933 933 } 934 934 935 - static int 936 - latency_fork_event(struct trace_fork_event *fork_event __used, 937 - struct event_format *event __used) 935 + static int latency_fork_event(struct trace_fork_event *fork_event __maybe_unused, 936 + struct event_format *event __maybe_unused) 938 937 { 939 938 /* should insert the newcomer */ 940 939 return 0; 941 940 } 942 941 943 - __used 944 942 static char sched_out_state(struct trace_switch_event *switch_event) 945 943 { 946 944 const char *str = TASK_STATE_TO_CHAR_STR; ··· 969 971 } 970 972 971 973 static void 972 - add_runtime_event(struct work_atoms *atoms, u64 delta, u64 timestamp __used) 974 + add_runtime_event(struct work_atoms *atoms, u64 delta, 975 + u64 timestamp __maybe_unused) 973 976 { 974 977 struct work_atom *atom; 975 978 ··· 1016 1017 static int 1017 1018 latency_switch_event(struct trace_switch_event *switch_event, 1018 1019 struct machine *machine, 1019 - struct event_format *event __used, 1020 + struct event_format *event __maybe_unused, 1020 1021 struct perf_sample *sample) 1021 1022 { 1022 1023 struct work_atoms *out_events, *in_events; ··· 1104 1105 1105 1106 static int 1106 1107 latency_wakeup_event(struct trace_wakeup_event *wakeup_event, 1107 - struct machine *machine, struct event_format *event __used, 1108 + struct machine *machine, 1109 + struct event_format *event __maybe_unused, 1108 1110 struct perf_sample *sample) 1109 1111 { 1110 1112 struct work_atoms *atoms; ··· 1369 1369 1370 1370 static struct trace_sched_handler *trace_handler; 1371 1371 1372 - static int 1373 - process_sched_wakeup_event(struct perf_tool *tool __used, 1374 - struct event_format *event, 1375 - struct perf_sample *sample, 1376 - struct machine *machine, 1377 - struct thread *thread __used) 1372 + static int process_sched_wakeup_event(struct perf_tool *tool __maybe_unused, 1373 + struct event_format *event, 1374 + struct perf_sample *sample, 1375 + struct machine *machine, 1376 + struct thread *thread __maybe_unused) 1378 1377 { 1379 1378 void *data = sample->raw_data; 1380 1379 struct trace_wakeup_event wakeup_event; ··· 1409 1410 static int 1410 1411 map_switch_event(struct trace_switch_event *switch_event, 1411 1412 struct machine *machine, 1412 - struct event_format *event __used, 1413 + struct event_format *event __maybe_unused, 1413 1414 struct perf_sample *sample) 1414 1415 { 1415 - struct thread *sched_out __used, *sched_in; 1416 + struct thread *sched_out __maybe_unused, *sched_in; 1416 1417 int new_shortname; 1417 1418 u64 timestamp0, timestamp = sample->time; 1418 1419 s64 delta; ··· 1486 1487 return 0; 1487 1488 } 1488 1489 1489 - static int 1490 - process_sched_switch_event(struct perf_tool *tool __used, 1491 - struct event_format *event, 1492 - struct perf_sample *sample, 1493 - struct machine *machine, 1494 - struct thread *thread __used) 1490 + static int process_sched_switch_event(struct perf_tool *tool __maybe_unused, 1491 + struct event_format *event, 1492 + struct perf_sample *sample, 1493 + struct machine *machine, 1494 + struct thread *thread __maybe_unused) 1495 1495 { 1496 1496 int this_cpu = sample->cpu, err = 0; 1497 1497 void *data = sample->raw_data; ··· 1521 1523 return err; 1522 1524 } 1523 1525 1524 - static int 1525 - process_sched_runtime_event(struct perf_tool *tool __used, 1526 - struct event_format *event, 1527 - struct perf_sample *sample, 1528 - struct machine *machine, 1529 - struct thread *thread __used) 1526 + static int process_sched_runtime_event(struct perf_tool *tool __maybe_unused, 1527 + struct event_format *event, 1528 + struct perf_sample *sample, 1529 + struct machine *machine, 1530 + struct thread *thread __maybe_unused) 1530 1531 { 1531 1532 void *data = sample->raw_data; 1532 1533 struct trace_runtime_event runtime_event; ··· 1542 1545 return err; 1543 1546 } 1544 1547 1545 - static int 1546 - process_sched_fork_event(struct perf_tool *tool __used, 1547 - struct event_format *event, 1548 - struct perf_sample *sample, 1549 - struct machine *machine __used, 1550 - struct thread *thread __used) 1548 + static int process_sched_fork_event(struct perf_tool *tool __maybe_unused, 1549 + struct event_format *event, 1550 + struct perf_sample *sample, 1551 + struct machine *machine __maybe_unused, 1552 + struct thread *thread __maybe_unused) 1551 1553 { 1552 1554 void *data = sample->raw_data; 1553 1555 struct trace_fork_event fork_event; ··· 1565 1569 return err; 1566 1570 } 1567 1571 1568 - static int 1569 - process_sched_exit_event(struct perf_tool *tool __used, 1570 - struct event_format *event, 1571 - struct perf_sample *sample __used, 1572 - struct machine *machine __used, 1573 - struct thread *thread __used) 1572 + static int process_sched_exit_event(struct perf_tool *tool __maybe_unused, 1573 + struct event_format *event, 1574 + struct perf_sample *sample __maybe_unused, 1575 + struct machine *machine __maybe_unused, 1576 + struct thread *thread __maybe_unused) 1574 1577 { 1575 1578 if (verbose) 1576 1579 printf("sched_exit event %p\n", event); ··· 1577 1582 return 0; 1578 1583 } 1579 1584 1580 - static int 1581 - process_sched_migrate_task_event(struct perf_tool *tool __used, 1582 - struct event_format *event, 1583 - struct perf_sample *sample, 1584 - struct machine *machine, 1585 - struct thread *thread __used) 1585 + static int process_sched_migrate_task_event(struct perf_tool *tool __maybe_unused, 1586 + struct event_format *event, 1587 + struct perf_sample *sample, 1588 + struct machine *machine, 1589 + struct thread *thread __maybe_unused) 1586 1590 { 1587 1591 void *data = sample->raw_data; 1588 1592 struct trace_migrate_task_event migrate_task_event; ··· 1606 1612 struct machine *machine, 1607 1613 struct thread *thread); 1608 1614 1609 - static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __used, 1610 - union perf_event *event __used, 1615 + static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __maybe_unused, 1616 + union perf_event *event __maybe_unused, 1611 1617 struct perf_sample *sample, 1612 1618 struct perf_evsel *evsel, 1613 1619 struct machine *machine) ··· 1912 1918 return cmd_record(i, rec_argv, NULL); 1913 1919 } 1914 1920 1915 - int cmd_sched(int argc, const char **argv, const char *prefix __used) 1921 + int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused) 1916 1922 { 1917 1923 argc = parse_options(argc, argv, sched_options, sched_usage, 1918 1924 PARSE_OPT_STOP_AT_NON_OPTION);
+15 -14
tools/perf/builtin-script.c
··· 430 430 printf("\n"); 431 431 } 432 432 433 - static int default_start_script(const char *script __unused, 434 - int argc __unused, 435 - const char **argv __unused) 433 + static int default_start_script(const char *script __maybe_unused, 434 + int argc __maybe_unused, 435 + const char **argv __maybe_unused) 436 436 { 437 437 return 0; 438 438 } ··· 442 442 return 0; 443 443 } 444 444 445 - static int default_generate_script(struct pevent *pevent __unused, 446 - const char *outfile __unused) 445 + static int default_generate_script(struct pevent *pevent __maybe_unused, 446 + const char *outfile __maybe_unused) 447 447 { 448 448 return 0; 449 449 } ··· 474 474 475 475 static const char *input_name; 476 476 477 - static int process_sample_event(struct perf_tool *tool __used, 477 + static int process_sample_event(struct perf_tool *tool __maybe_unused, 478 478 union perf_event *event, 479 479 struct perf_sample *sample, 480 480 struct perf_evsel *evsel, ··· 534 534 535 535 extern volatile int session_done; 536 536 537 - static void sig_handler(int sig __unused) 537 + static void sig_handler(int sig __maybe_unused) 538 538 { 539 539 session_done = 1; 540 540 } ··· 644 644 fprintf(stderr, "\n"); 645 645 } 646 646 647 - static int parse_scriptname(const struct option *opt __used, 648 - const char *str, int unset __used) 647 + static int parse_scriptname(const struct option *opt __maybe_unused, 648 + const char *str, int unset __maybe_unused) 649 649 { 650 650 char spec[PATH_MAX]; 651 651 const char *script, *ext; ··· 690 690 return 0; 691 691 } 692 692 693 - static int parse_output_fields(const struct option *opt __used, 694 - const char *arg, int unset __used) 693 + static int parse_output_fields(const struct option *opt __maybe_unused, 694 + const char *arg, int unset __maybe_unused) 695 695 { 696 696 char *tok; 697 697 int i, imax = sizeof(all_output_options) / sizeof(struct output_option); ··· 982 982 return script_root; 983 983 } 984 984 985 - static int list_available_scripts(const struct option *opt __used, 986 - const char *s __used, int unset __used) 985 + static int list_available_scripts(const struct option *opt __maybe_unused, 986 + const char *s __maybe_unused, 987 + int unset __maybe_unused) 987 988 { 988 989 struct dirent *script_next, *lang_next, script_dirent, lang_dirent; 989 990 char scripts_path[MAXPATHLEN]; ··· 1173 1172 return 0; 1174 1173 } 1175 1174 1176 - int cmd_script(int argc, const char **argv, const char *prefix __used) 1175 + int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) 1177 1176 { 1178 1177 char *rec_script_path = NULL; 1179 1178 char *rep_script_path = NULL;
+28 -12
tools/perf/builtin-stat.c
··· 417 417 return 0; 418 418 } 419 419 420 - static int run_perf_stat(int argc __used, const char **argv) 420 + static int run_perf_stat(int argc __maybe_unused, const char **argv) 421 421 { 422 422 unsigned long long t0, t1; 423 423 struct perf_evsel *counter, *first; ··· 634 634 return color; 635 635 } 636 636 637 - static void print_stalled_cycles_frontend(int cpu, struct perf_evsel *evsel __used, double avg) 637 + static void print_stalled_cycles_frontend(int cpu, 638 + struct perf_evsel *evsel 639 + __maybe_unused, double avg) 638 640 { 639 641 double total, ratio = 0.0; 640 642 const char *color; ··· 653 651 fprintf(output, " frontend cycles idle "); 654 652 } 655 653 656 - static void print_stalled_cycles_backend(int cpu, struct perf_evsel *evsel __used, double avg) 654 + static void print_stalled_cycles_backend(int cpu, 655 + struct perf_evsel *evsel 656 + __maybe_unused, double avg) 657 657 { 658 658 double total, ratio = 0.0; 659 659 const char *color; ··· 672 668 fprintf(output, " backend cycles idle "); 673 669 } 674 670 675 - static void print_branch_misses(int cpu, struct perf_evsel *evsel __used, double avg) 671 + static void print_branch_misses(int cpu, 672 + struct perf_evsel *evsel __maybe_unused, 673 + double avg) 676 674 { 677 675 double total, ratio = 0.0; 678 676 const char *color; ··· 691 685 fprintf(output, " of all branches "); 692 686 } 693 687 694 - static void print_l1_dcache_misses(int cpu, struct perf_evsel *evsel __used, double avg) 688 + static void print_l1_dcache_misses(int cpu, 689 + struct perf_evsel *evsel __maybe_unused, 690 + double avg) 695 691 { 696 692 double total, ratio = 0.0; 697 693 const char *color; ··· 710 702 fprintf(output, " of all L1-dcache hits "); 711 703 } 712 704 713 - static void print_l1_icache_misses(int cpu, struct perf_evsel *evsel __used, double avg) 705 + static void print_l1_icache_misses(int cpu, 706 + struct perf_evsel *evsel __maybe_unused, 707 + double avg) 714 708 { 715 709 double total, ratio = 0.0; 716 710 const char *color; ··· 729 719 fprintf(output, " of all L1-icache hits "); 730 720 } 731 721 732 - static void print_dtlb_cache_misses(int cpu, struct perf_evsel *evsel __used, double avg) 722 + static void print_dtlb_cache_misses(int cpu, 723 + struct perf_evsel *evsel __maybe_unused, 724 + double avg) 733 725 { 734 726 double total, ratio = 0.0; 735 727 const char *color; ··· 748 736 fprintf(output, " of all dTLB cache hits "); 749 737 } 750 738 751 - static void print_itlb_cache_misses(int cpu, struct perf_evsel *evsel __used, double avg) 739 + static void print_itlb_cache_misses(int cpu, 740 + struct perf_evsel *evsel __maybe_unused, 741 + double avg) 752 742 { 753 743 double total, ratio = 0.0; 754 744 const char *color; ··· 767 753 fprintf(output, " of all iTLB cache hits "); 768 754 } 769 755 770 - static void print_ll_cache_misses(int cpu, struct perf_evsel *evsel __used, double avg) 756 + static void print_ll_cache_misses(int cpu, 757 + struct perf_evsel *evsel __maybe_unused, 758 + double avg) 771 759 { 772 760 double total, ratio = 0.0; 773 761 const char *color; ··· 1075 1059 NULL 1076 1060 }; 1077 1061 1078 - static int stat__set_big_num(const struct option *opt __used, 1079 - const char *s __used, int unset) 1062 + static int stat__set_big_num(const struct option *opt __maybe_unused, 1063 + const char *s __maybe_unused, int unset) 1080 1064 { 1081 1065 big_num_opt = unset ? 0 : 1; 1082 1066 return 0; ··· 1170 1154 return perf_evlist__add_default_attrs(evsel_list, very_very_detailed_attrs); 1171 1155 } 1172 1156 1173 - int cmd_stat(int argc, const char **argv, const char *prefix __used) 1157 + int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused) 1174 1158 { 1175 1159 struct perf_evsel *pos; 1176 1160 int status = -ENOMEM;
+6 -3
tools/perf/builtin-test.c
··· 18 18 19 19 #include <sys/mman.h> 20 20 21 - static int vmlinux_matches_kallsyms_filter(struct map *map __used, struct symbol *sym) 21 + static int vmlinux_matches_kallsyms_filter(struct map *map __maybe_unused, 22 + struct symbol *sym) 22 23 { 23 24 bool *visited = symbol__priv(sym); 24 25 *visited = true; ··· 997 996 /* 998 997 * If the RDPMC instruction faults then signal this back to the test parent task: 999 998 */ 1000 - static void segfault_handler(int sig __used, siginfo_t *info __used, void *uc __used) 999 + static void segfault_handler(int sig __maybe_unused, 1000 + siginfo_t *info __maybe_unused, 1001 + void *uc __maybe_unused) 1001 1002 { 1002 1003 exit(-1); 1003 1004 } ··· 1318 1315 return 0; 1319 1316 } 1320 1317 1321 - int cmd_test(int argc, const char **argv, const char *prefix __used) 1318 + int cmd_test(int argc, const char **argv, const char *prefix __maybe_unused) 1322 1319 { 1323 1320 const char * const test_usage[] = { 1324 1321 "perf test [<options>] [{list <test-name-fragment>|[<test-name-fragments>|<test-numbers>]}]",
+16 -14
tools/perf/builtin-timechart.c
··· 275 275 static u64 cpus_pstate_start_times[MAX_CPUS]; 276 276 static u64 cpus_pstate_state[MAX_CPUS]; 277 277 278 - static int process_comm_event(struct perf_tool *tool __used, 278 + static int process_comm_event(struct perf_tool *tool __maybe_unused, 279 279 union perf_event *event, 280 - struct perf_sample *sample __used, 281 - struct machine *machine __used) 280 + struct perf_sample *sample __maybe_unused, 281 + struct machine *machine __maybe_unused) 282 282 { 283 283 pid_set_comm(event->comm.tid, event->comm.comm); 284 284 return 0; 285 285 } 286 286 287 - static int process_fork_event(struct perf_tool *tool __used, 287 + static int process_fork_event(struct perf_tool *tool __maybe_unused, 288 288 union perf_event *event, 289 - struct perf_sample *sample __used, 290 - struct machine *machine __used) 289 + struct perf_sample *sample __maybe_unused, 290 + struct machine *machine __maybe_unused) 291 291 { 292 292 pid_fork(event->fork.pid, event->fork.ppid, event->fork.time); 293 293 return 0; 294 294 } 295 295 296 - static int process_exit_event(struct perf_tool *tool __used, 296 + static int process_exit_event(struct perf_tool *tool __maybe_unused, 297 297 union perf_event *event, 298 - struct perf_sample *sample __used, 299 - struct machine *machine __used) 298 + struct perf_sample *sample __maybe_unused, 299 + struct machine *machine __maybe_unused) 300 300 { 301 301 pid_exit(event->fork.pid, event->fork.time); 302 302 return 0; ··· 491 491 } 492 492 493 493 494 - static int process_sample_event(struct perf_tool *tool __used, 495 - union perf_event *event __used, 494 + static int process_sample_event(struct perf_tool *tool __maybe_unused, 495 + union perf_event *event __maybe_unused, 496 496 struct perf_sample *sample, 497 497 struct perf_evsel *evsel, 498 - struct machine *machine __used) 498 + struct machine *machine __maybe_unused) 499 499 { 500 500 struct trace_entry *te; 501 501 ··· 1081 1081 } 1082 1082 1083 1083 static int 1084 - parse_process(const struct option *opt __used, const char *arg, int __used unset) 1084 + parse_process(const struct option *opt __maybe_unused, const char *arg, 1085 + int __maybe_unused unset) 1085 1086 { 1086 1087 if (arg) 1087 1088 add_process_filter(arg); ··· 1107 1106 }; 1108 1107 1109 1108 1110 - int cmd_timechart(int argc, const char **argv, const char *prefix __used) 1109 + int cmd_timechart(int argc, const char **argv, 1110 + const char *prefix __maybe_unused) 1111 1111 { 1112 1112 argc = parse_options(argc, argv, options, timechart_usage, 1113 1113 PARSE_OPT_STOP_AT_NON_OPTION);
+4 -3
tools/perf/builtin-top.c
··· 95 95 top->print_entries -= 9; 96 96 } 97 97 98 - static void perf_top__sig_winch(int sig __used, siginfo_t *info __used, void *arg) 98 + static void perf_top__sig_winch(int sig __maybe_unused, 99 + siginfo_t *info __maybe_unused, void *arg) 99 100 { 100 101 struct perf_top *top = arg; 101 102 ··· 664 663 NULL 665 664 }; 666 665 667 - static int symbol_filter(struct map *map __used, struct symbol *sym) 666 + static int symbol_filter(struct map *map __maybe_unused, struct symbol *sym) 668 667 { 669 668 const char *name = sym->name; 670 669 int i; ··· 1164 1163 NULL 1165 1164 }; 1166 1165 1167 - int cmd_top(int argc, const char **argv, const char *prefix __used) 1166 + int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) 1168 1167 { 1169 1168 struct perf_evsel *pos; 1170 1169 int status;
+4 -3
tools/perf/ui/browser.c
··· 269 269 return err ? 0 : -1; 270 270 } 271 271 272 - void ui_browser__hide(struct ui_browser *browser __used) 272 + void ui_browser__hide(struct ui_browser *browser __maybe_unused) 273 273 { 274 274 pthread_mutex_lock(&ui__lock); 275 275 ui_helpline__pop(); ··· 518 518 519 519 520 520 static int ui_browser__color_config(const char *var, const char *value, 521 - void *data __used) 521 + void *data __maybe_unused) 522 522 { 523 523 char *fg = NULL, *bg; 524 524 int i; ··· 602 602 SLsmg_set_char_set(0); 603 603 } 604 604 605 - void ui_browser__write_graph(struct ui_browser *browser __used, int graph) 605 + void ui_browser__write_graph(struct ui_browser *browser __maybe_unused, 606 + int graph) 606 607 { 607 608 SLsmg_set_char_set(1); 608 609 SLsmg_write_char(graph);
+4 -2
tools/perf/ui/browsers/annotate.c
··· 54 54 return (struct browser_disasm_line *)(dl + 1); 55 55 } 56 56 57 - static bool disasm_line__filter(struct ui_browser *browser __used, void *entry) 57 + static bool disasm_line__filter(struct ui_browser *browser __maybe_unused, 58 + void *entry) 58 59 { 59 60 if (annotate_browser__opts.hide_src_code) { 60 61 struct disasm_line *dl = list_entry(entry, struct disasm_line, node); ··· 929 928 return strcmp(name, cfg->name); 930 929 } 931 930 932 - static int annotate__config(const char *var, const char *value, void *data __used) 931 + static int annotate__config(const char *var, const char *value, 932 + void *data __maybe_unused) 933 933 { 934 934 struct annotate__config *cfg; 935 935 const char *name;
+3 -2
tools/perf/ui/gtk/browser.c
··· 237 237 238 238 int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, 239 239 const char *help, 240 - void (*timer) (void *arg)__used, 241 - void *arg __used, int delay_secs __used) 240 + void (*timer) (void *arg)__maybe_unused, 241 + void *arg __maybe_unused, 242 + int delay_secs __maybe_unused) 242 243 { 243 244 struct perf_evsel *pos; 244 245 GtkWidget *vbox;
+1 -1
tools/perf/ui/gtk/setup.c
··· 12 12 return gtk_init_check(NULL, NULL) ? 0 : -1; 13 13 } 14 14 15 - void perf_gtk__exit(bool wait_for_ok __used) 15 + void perf_gtk__exit(bool wait_for_ok __maybe_unused) 16 16 { 17 17 if (!perf_gtk__is_active_context(pgctx)) 18 18 return;
+2 -2
tools/perf/ui/gtk/util.c
··· 117 117 * For now, just add stubs for NO_NEWT=1 build. 118 118 */ 119 119 #ifdef NO_NEWT_SUPPORT 120 - void ui_progress__update(u64 curr __used, u64 total __used, 121 - const char *title __used) 120 + void ui_progress__update(u64 curr __maybe_unused, u64 total __maybe_unused, 121 + const char *title __maybe_unused) 122 122 { 123 123 } 124 124 #endif
+1 -1
tools/perf/ui/helpline.c
··· 12 12 { 13 13 } 14 14 15 - static void nop_helpline__push(const char *msg __used) 15 + static void nop_helpline__push(const char *msg __maybe_unused) 16 16 { 17 17 } 18 18
+4 -4
tools/perf/ui/helpline.h
··· 24 24 extern char ui_helpline__current[512]; 25 25 26 26 #ifdef NO_NEWT_SUPPORT 27 - static inline int ui_helpline__show_help(const char *format __used, 28 - va_list ap __used) 27 + static inline int ui_helpline__show_help(const char *format __maybe_unused, 28 + va_list ap __maybe_unused) 29 29 { 30 30 return 0; 31 31 } ··· 35 35 #endif /* NO_NEWT_SUPPORT */ 36 36 37 37 #ifdef NO_GTK2_SUPPORT 38 - static inline int perf_gtk__show_helpline(const char *format __used, 39 - va_list ap __used) 38 + static inline int perf_gtk__show_helpline(const char *format __maybe_unused, 39 + va_list ap __maybe_unused) 40 40 { 41 41 return 0; 42 42 }
+11 -10
tools/perf/ui/hist.c
··· 13 13 return scnprintf(hpp->buf, hpp->size, fmt); 14 14 } 15 15 16 - static int hpp__width_overhead(struct perf_hpp *hpp __used) 16 + static int hpp__width_overhead(struct perf_hpp *hpp __maybe_unused) 17 17 { 18 18 return 8; 19 19 } ··· 62 62 return scnprintf(hpp->buf, hpp->size, fmt, "sys"); 63 63 } 64 64 65 - static int hpp__width_overhead_sys(struct perf_hpp *hpp __used) 65 + static int hpp__width_overhead_sys(struct perf_hpp *hpp __maybe_unused) 66 66 { 67 67 return 6; 68 68 } ··· 88 88 return scnprintf(hpp->buf, hpp->size, fmt, "user"); 89 89 } 90 90 91 - static int hpp__width_overhead_us(struct perf_hpp *hpp __used) 91 + static int hpp__width_overhead_us(struct perf_hpp *hpp __maybe_unused) 92 92 { 93 93 return 6; 94 94 } ··· 112 112 return scnprintf(hpp->buf, hpp->size, "guest sys"); 113 113 } 114 114 115 - static int hpp__width_overhead_guest_sys(struct perf_hpp *hpp __used) 115 + static int hpp__width_overhead_guest_sys(struct perf_hpp *hpp __maybe_unused) 116 116 { 117 117 return 9; 118 118 } ··· 138 138 return scnprintf(hpp->buf, hpp->size, "guest usr"); 139 139 } 140 140 141 - static int hpp__width_overhead_guest_us(struct perf_hpp *hpp __used) 141 + static int hpp__width_overhead_guest_us(struct perf_hpp *hpp __maybe_unused) 142 142 { 143 143 return 9; 144 144 } ··· 166 166 return scnprintf(hpp->buf, hpp->size, fmt, "Samples"); 167 167 } 168 168 169 - static int hpp__width_samples(struct perf_hpp *hpp __used) 169 + static int hpp__width_samples(struct perf_hpp *hpp __maybe_unused) 170 170 { 171 171 return 11; 172 172 } ··· 185 185 return scnprintf(hpp->buf, hpp->size, fmt, "Period"); 186 186 } 187 187 188 - static int hpp__width_period(struct perf_hpp *hpp __used) 188 + static int hpp__width_period(struct perf_hpp *hpp __maybe_unused) 189 189 { 190 190 return 12; 191 191 } ··· 204 204 return scnprintf(hpp->buf, hpp->size, fmt, "Delta"); 205 205 } 206 206 207 - static int hpp__width_delta(struct perf_hpp *hpp __used) 207 + static int hpp__width_delta(struct perf_hpp *hpp __maybe_unused) 208 208 { 209 209 return 7; 210 210 } ··· 238 238 return scnprintf(hpp->buf, hpp->size, "Displ."); 239 239 } 240 240 241 - static int hpp__width_displ(struct perf_hpp *hpp __used) 241 + static int hpp__width_displ(struct perf_hpp *hpp __maybe_unused) 242 242 { 243 243 return 6; 244 244 } 245 245 246 - static int hpp__entry_displ(struct perf_hpp *hpp, struct hist_entry *he __used) 246 + static int hpp__entry_displ(struct perf_hpp *hpp, 247 + struct hist_entry *he __maybe_unused) 247 248 { 248 249 const char *fmt = symbol_conf.field_sep ? "%s" : "%6.6s"; 249 250 char buf[32] = " ";
+2 -2
tools/perf/ui/tui/setup.c
··· 28 28 } 29 29 } 30 30 31 - static void ui__sigwinch(int sig __used) 31 + static void ui__sigwinch(int sig __maybe_unused) 32 32 { 33 33 ui__need_resize = 1; 34 34 } ··· 88 88 return SLkp_getkey(); 89 89 } 90 90 91 - static void newt_suspend(void *d __used) 91 + static void newt_suspend(void *d __maybe_unused) 92 92 { 93 93 newtSuspend(); 94 94 raise(SIGTSTP);
+2 -1
tools/perf/util/alias.c
··· 3 3 static const char *alias_key; 4 4 static char *alias_val; 5 5 6 - static int alias_lookup_cb(const char *k, const char *v, void *cb __used) 6 + static int alias_lookup_cb(const char *k, const char *v, 7 + void *cb __maybe_unused) 7 8 { 8 9 if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) { 9 10 if (!v)
+3 -3
tools/perf/util/annotate.c
··· 313 313 .scnprintf = dec__scnprintf, 314 314 }; 315 315 316 - static int nop__scnprintf(struct ins *ins __used, char *bf, size_t size, 317 - struct ins_operands *ops __used) 316 + static int nop__scnprintf(struct ins *ins __maybe_unused, char *bf, size_t size, 317 + struct ins_operands *ops __maybe_unused) 318 318 { 319 319 return scnprintf(bf, size, "%-6.6s", "nop"); 320 320 } ··· 416 416 return bsearch(name, instructions, nmemb, sizeof(struct ins), ins__cmp); 417 417 } 418 418 419 - int symbol__annotate_init(struct map *map __used, struct symbol *sym) 419 + int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym) 420 420 { 421 421 struct annotation *notes = symbol__annotation(sym); 422 422 pthread_mutex_init(&notes->lock, NULL);
+7 -6
tools/perf/util/annotate.h
··· 126 126 void symbol__annotate_zero_histograms(struct symbol *sym); 127 127 128 128 int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize); 129 - int symbol__annotate_init(struct map *map __used, struct symbol *sym); 129 + int symbol__annotate_init(struct map *map __maybe_unused, struct symbol *sym); 130 130 int symbol__annotate_printf(struct symbol *sym, struct map *map, int evidx, 131 131 bool full_paths, int min_pcnt, int max_lines, 132 132 int context); ··· 139 139 int max_lines); 140 140 141 141 #ifdef NO_NEWT_SUPPORT 142 - static inline int symbol__tui_annotate(struct symbol *sym __used, 143 - struct map *map __used, 144 - int evidx __used, 145 - void(*timer)(void *arg) __used, 146 - void *arg __used, int delay_secs __used) 142 + static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, 143 + struct map *map __maybe_unused, 144 + int evidx __maybe_unused, 145 + void(*timer)(void *arg) __maybe_unused, 146 + void *arg __maybe_unused, 147 + int delay_secs __maybe_unused) 147 148 { 148 149 return 0; 149 150 }
+6 -5
tools/perf/util/build-id.c
··· 16 16 #include "session.h" 17 17 #include "tool.h" 18 18 19 - static int build_id__mark_dso_hit(struct perf_tool *tool __used, 19 + static int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused, 20 20 union perf_event *event, 21 - struct perf_sample *sample __used, 22 - struct perf_evsel *evsel __used, 21 + struct perf_sample *sample __maybe_unused, 22 + struct perf_evsel *evsel __maybe_unused, 23 23 struct machine *machine) 24 24 { 25 25 struct addr_location al; ··· 41 41 return 0; 42 42 } 43 43 44 - static int perf_event__exit_del_thread(struct perf_tool *tool __used, 44 + static int perf_event__exit_del_thread(struct perf_tool *tool __maybe_unused, 45 45 union perf_event *event, 46 - struct perf_sample *sample __used, 46 + struct perf_sample *sample 47 + __maybe_unused, 47 48 struct machine *machine) 48 49 { 49 50 struct thread *thread = machine__findnew_thread(machine, event->fork.tid);
+3 -3
tools/perf/util/cache.h
··· 39 39 if (fallback_to_pager) 40 40 setup_pager(); 41 41 } 42 - static inline void exit_browser(bool wait_for_ok __used) {} 42 + static inline void exit_browser(bool wait_for_ok __maybe_unused) {} 43 43 #else 44 44 void setup_browser(bool fallback_to_pager); 45 45 void exit_browser(bool wait_for_ok); ··· 49 49 { 50 50 return -1; 51 51 } 52 - static inline void ui__exit(bool wait_for_ok __used) {} 52 + static inline void ui__exit(bool wait_for_ok __maybe_unused) {} 53 53 #else 54 54 int ui__init(void); 55 55 void ui__exit(bool wait_for_ok); ··· 60 60 { 61 61 return -1; 62 62 } 63 - static inline void perf_gtk__exit(bool wait_for_ok __used) {} 63 + static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {} 64 64 #else 65 65 int perf_gtk__init(void); 66 66 void perf_gtk__exit(bool wait_for_ok);
+3 -3
tools/perf/util/callchain.c
··· 93 93 */ 94 94 static void 95 95 sort_chain_flat(struct rb_root *rb_root, struct callchain_root *root, 96 - u64 min_hit, struct callchain_param *param __used) 96 + u64 min_hit, struct callchain_param *param __maybe_unused) 97 97 { 98 98 __sort_chain_flat(rb_root, &root->node, min_hit); 99 99 } ··· 115 115 116 116 static void 117 117 sort_chain_graph_abs(struct rb_root *rb_root, struct callchain_root *chain_root, 118 - u64 min_hit, struct callchain_param *param __used) 118 + u64 min_hit, struct callchain_param *param __maybe_unused) 119 119 { 120 120 __sort_chain_graph_abs(&chain_root->node, min_hit); 121 121 rb_root->rb_node = chain_root->node.rb_root.rb_node; ··· 140 140 141 141 static void 142 142 sort_chain_graph_rel(struct rb_root *rb_root, struct callchain_root *chain_root, 143 - u64 min_hit __used, struct callchain_param *param) 143 + u64 min_hit __maybe_unused, struct callchain_param *param) 144 144 { 145 145 __sort_chain_graph_rel(&chain_root->node, param->min_percent / 100.0); 146 146 rb_root->rb_node = chain_root->node.rb_root.rb_node;
+2 -2
tools/perf/util/cgroup.c
··· 138 138 } 139 139 } 140 140 141 - int parse_cgroups(const struct option *opt __used, const char *str, 142 - int unset __used) 141 + int parse_cgroups(const struct option *opt __maybe_unused, const char *str, 142 + int unset __maybe_unused) 143 143 { 144 144 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; 145 145 const char *p, *e, *eos = str + strlen(str);
+4 -2
tools/perf/util/config.c
··· 342 342 return value; 343 343 } 344 344 345 - static int perf_default_core_config(const char *var __used, const char *value __used) 345 + static int perf_default_core_config(const char *var __maybe_unused, 346 + const char *value __maybe_unused) 346 347 { 347 348 /* Add other config variables here. */ 348 349 return 0; 349 350 } 350 351 351 - int perf_default_config(const char *var, const char *value, void *dummy __used) 352 + int perf_default_config(const char *var, const char *value, 353 + void *dummy __maybe_unused) 352 354 { 353 355 if (!prefixcmp(var, "core.")) 354 356 return perf_default_core_config(var, value);
+5 -4
tools/perf/util/debug.h
··· 16 16 struct perf_error_ops; 17 17 18 18 #if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT) 19 - static inline void ui_progress__update(u64 curr __used, u64 total __used, 20 - const char *title __used) {} 19 + static inline void ui_progress__update(u64 curr __maybe_unused, 20 + u64 total __maybe_unused, 21 + const char *title __maybe_unused) {} 21 22 22 23 #define ui__error(format, arg...) ui__warning(format, ##arg) 23 24 24 25 static inline int 25 - perf_error__register(struct perf_error_ops *eops __used) 26 + perf_error__register(struct perf_error_ops *eops __maybe_unused) 26 27 { 27 28 return 0; 28 29 } 29 30 30 31 static inline int 31 - perf_error__unregister(struct perf_error_ops *eops __used) 32 + perf_error__unregister(struct perf_error_ops *eops __maybe_unused) 32 33 { 33 34 return 0; 34 35 }
+10 -9
tools/perf/util/event.c
··· 514 514 return fprintf(fp, ": %s:%d\n", event->comm.comm, event->comm.tid); 515 515 } 516 516 517 - int perf_event__process_comm(struct perf_tool *tool __used, 517 + int perf_event__process_comm(struct perf_tool *tool __maybe_unused, 518 518 union perf_event *event, 519 - struct perf_sample *sample __used, 519 + struct perf_sample *sample __maybe_unused, 520 520 struct machine *machine) 521 521 { 522 522 struct thread *thread = machine__findnew_thread(machine, event->comm.tid); ··· 532 532 return 0; 533 533 } 534 534 535 - int perf_event__process_lost(struct perf_tool *tool __used, 535 + int perf_event__process_lost(struct perf_tool *tool __maybe_unused, 536 536 union perf_event *event, 537 - struct perf_sample *sample __used, 538 - struct machine *machine __used) 537 + struct perf_sample *sample __maybe_unused, 538 + struct machine *machine __maybe_unused) 539 539 { 540 540 dump_printf(": id:%" PRIu64 ": lost:%" PRIu64 "\n", 541 541 event->lost.id, event->lost.lost); ··· 555 555 maps[MAP__FUNCTION]->end = ~0ULL; 556 556 } 557 557 558 - static int perf_event__process_kernel_mmap(struct perf_tool *tool __used, 558 + static int perf_event__process_kernel_mmap(struct perf_tool *tool 559 + __maybe_unused, 559 560 union perf_event *event, 560 561 struct machine *machine) 561 562 { ··· 658 657 659 658 int perf_event__process_mmap(struct perf_tool *tool, 660 659 union perf_event *event, 661 - struct perf_sample *sample __used, 660 + struct perf_sample *sample __maybe_unused, 662 661 struct machine *machine) 663 662 { 664 663 struct thread *thread; ··· 702 701 event->fork.ppid, event->fork.ptid); 703 702 } 704 703 705 - int perf_event__process_task(struct perf_tool *tool __used, 704 + int perf_event__process_task(struct perf_tool *tool __maybe_unused, 706 705 union perf_event *event, 707 - struct perf_sample *sample __used, 706 + struct perf_sample *sample __maybe_unused, 708 707 struct machine *machine) 709 708 { 710 709 struct thread *thread = machine__findnew_thread(machine, event->fork.tid);
+50 -43
tools/perf/util/header.c
··· 475 475 return ret; 476 476 } 477 477 478 - static int write_tracing_data(int fd, struct perf_header *h __used, 478 + static int write_tracing_data(int fd, struct perf_header *h __maybe_unused, 479 479 struct perf_evlist *evlist) 480 480 { 481 481 return read_tracing_data(fd, &evlist->entries); ··· 483 483 484 484 485 485 static int write_build_id(int fd, struct perf_header *h, 486 - struct perf_evlist *evlist __used) 486 + struct perf_evlist *evlist __maybe_unused) 487 487 { 488 488 struct perf_session *session; 489 489 int err; ··· 504 504 return 0; 505 505 } 506 506 507 - static int write_hostname(int fd, struct perf_header *h __used, 508 - struct perf_evlist *evlist __used) 507 + static int write_hostname(int fd, struct perf_header *h __maybe_unused, 508 + struct perf_evlist *evlist __maybe_unused) 509 509 { 510 510 struct utsname uts; 511 511 int ret; ··· 517 517 return do_write_string(fd, uts.nodename); 518 518 } 519 519 520 - static int write_osrelease(int fd, struct perf_header *h __used, 521 - struct perf_evlist *evlist __used) 520 + static int write_osrelease(int fd, struct perf_header *h __maybe_unused, 521 + struct perf_evlist *evlist __maybe_unused) 522 522 { 523 523 struct utsname uts; 524 524 int ret; ··· 530 530 return do_write_string(fd, uts.release); 531 531 } 532 532 533 - static int write_arch(int fd, struct perf_header *h __used, 534 - struct perf_evlist *evlist __used) 533 + static int write_arch(int fd, struct perf_header *h __maybe_unused, 534 + struct perf_evlist *evlist __maybe_unused) 535 535 { 536 536 struct utsname uts; 537 537 int ret; ··· 543 543 return do_write_string(fd, uts.machine); 544 544 } 545 545 546 - static int write_version(int fd, struct perf_header *h __used, 547 - struct perf_evlist *evlist __used) 546 + static int write_version(int fd, struct perf_header *h __maybe_unused, 547 + struct perf_evlist *evlist __maybe_unused) 548 548 { 549 549 return do_write_string(fd, perf_version_string); 550 550 } 551 551 552 - static int write_cpudesc(int fd, struct perf_header *h __used, 553 - struct perf_evlist *evlist __used) 552 + static int write_cpudesc(int fd, struct perf_header *h __maybe_unused, 553 + struct perf_evlist *evlist __maybe_unused) 554 554 { 555 555 #ifndef CPUINFO_PROC 556 556 #define CPUINFO_PROC NULL ··· 608 608 return ret; 609 609 } 610 610 611 - static int write_nrcpus(int fd, struct perf_header *h __used, 612 - struct perf_evlist *evlist __used) 611 + static int write_nrcpus(int fd, struct perf_header *h __maybe_unused, 612 + struct perf_evlist *evlist __maybe_unused) 613 613 { 614 614 long nr; 615 615 u32 nrc, nra; ··· 634 634 return do_write(fd, &nra, sizeof(nra)); 635 635 } 636 636 637 - static int write_event_desc(int fd, struct perf_header *h __used, 637 + static int write_event_desc(int fd, struct perf_header *h __maybe_unused, 638 638 struct perf_evlist *evlist) 639 639 { 640 640 struct perf_evsel *evsel; ··· 691 691 return 0; 692 692 } 693 693 694 - static int write_cmdline(int fd, struct perf_header *h __used, 695 - struct perf_evlist *evlist __used) 694 + static int write_cmdline(int fd, struct perf_header *h __maybe_unused, 695 + struct perf_evlist *evlist __maybe_unused) 696 696 { 697 697 char buf[MAXPATHLEN]; 698 698 char proc[32]; ··· 860 860 return tp; 861 861 } 862 862 863 - static int write_cpu_topology(int fd, struct perf_header *h __used, 864 - struct perf_evlist *evlist __used) 863 + static int write_cpu_topology(int fd, struct perf_header *h __maybe_unused, 864 + struct perf_evlist *evlist __maybe_unused) 865 865 { 866 866 struct cpu_topo *tp; 867 867 u32 i; ··· 896 896 897 897 898 898 899 - static int write_total_mem(int fd, struct perf_header *h __used, 900 - struct perf_evlist *evlist __used) 899 + static int write_total_mem(int fd, struct perf_header *h __maybe_unused, 900 + struct perf_evlist *evlist __maybe_unused) 901 901 { 902 902 char *buf = NULL; 903 903 FILE *fp; ··· 982 982 return ret; 983 983 } 984 984 985 - static int write_numa_topology(int fd, struct perf_header *h __used, 986 - struct perf_evlist *evlist __used) 985 + static int write_numa_topology(int fd, struct perf_header *h __maybe_unused, 986 + struct perf_evlist *evlist __maybe_unused) 987 987 { 988 988 char *buf = NULL; 989 989 size_t len = 0; ··· 1043 1043 * }; 1044 1044 */ 1045 1045 1046 - static int write_pmu_mappings(int fd, struct perf_header *h __used, 1047 - struct perf_evlist *evlist __used) 1046 + static int write_pmu_mappings(int fd, struct perf_header *h __maybe_unused, 1047 + struct perf_evlist *evlist __maybe_unused) 1048 1048 { 1049 1049 struct perf_pmu *pmu = NULL; 1050 1050 off_t offset = lseek(fd, 0, SEEK_CUR); ··· 1074 1074 * default get_cpuid(): nothing gets recorded 1075 1075 * actual implementation must be in arch/$(ARCH)/util/header.c 1076 1076 */ 1077 - int __attribute__((weak)) get_cpuid(char *buffer __used, size_t sz __used) 1077 + int __attribute__ ((weak)) get_cpuid(char *buffer __maybe_unused, 1078 + size_t sz __maybe_unused) 1078 1079 { 1079 1080 return -1; 1080 1081 } 1081 1082 1082 - static int write_cpuid(int fd, struct perf_header *h __used, 1083 - struct perf_evlist *evlist __used) 1083 + static int write_cpuid(int fd, struct perf_header *h __maybe_unused, 1084 + struct perf_evlist *evlist __maybe_unused) 1084 1085 { 1085 1086 char buffer[64]; 1086 1087 int ret; ··· 1095 1094 return do_write_string(fd, buffer); 1096 1095 } 1097 1096 1098 - static int write_branch_stack(int fd __used, struct perf_header *h __used, 1099 - struct perf_evlist *evlist __used) 1097 + static int write_branch_stack(int fd __maybe_unused, 1098 + struct perf_header *h __maybe_unused, 1099 + struct perf_evlist *evlist __maybe_unused) 1100 1100 { 1101 1101 return 0; 1102 1102 } ··· 1374 1372 free_event_desc(events); 1375 1373 } 1376 1374 1377 - static void print_total_mem(struct perf_header *h __used, int fd, FILE *fp) 1375 + static void print_total_mem(struct perf_header *h __maybe_unused, int fd, 1376 + FILE *fp) 1378 1377 { 1379 1378 uint64_t mem; 1380 1379 ssize_t ret; ··· 1393 1390 fprintf(fp, "# total memory : unknown\n"); 1394 1391 } 1395 1392 1396 - static void print_numa_topology(struct perf_header *h __used, int fd, FILE *fp) 1393 + static void print_numa_topology(struct perf_header *h __maybe_unused, int fd, 1394 + FILE *fp) 1397 1395 { 1398 1396 ssize_t ret; 1399 1397 u32 nr, c, i; ··· 1454 1450 free(str); 1455 1451 } 1456 1452 1457 - static void print_branch_stack(struct perf_header *ph __used, int fd __used, 1453 + static void print_branch_stack(struct perf_header *ph __maybe_unused, 1454 + int fd __maybe_unused, 1458 1455 FILE *fp) 1459 1456 { 1460 1457 fprintf(fp, "# contains samples with branch stack\n"); ··· 1654 1649 return err; 1655 1650 } 1656 1651 1657 - static int process_tracing_data(struct perf_file_section *section __unused, 1658 - struct perf_header *ph __unused, 1659 - int feat __unused, int fd, void *data) 1652 + static int process_tracing_data(struct perf_file_section *section 1653 + __maybe_unused, 1654 + struct perf_header *ph __maybe_unused, 1655 + int feat __maybe_unused, int fd, void *data) 1660 1656 { 1661 1657 trace_report(fd, data, false); 1662 1658 return 0; ··· 1665 1659 1666 1660 static int process_build_id(struct perf_file_section *section, 1667 1661 struct perf_header *ph, 1668 - int feat __unused, int fd, void *data __used) 1662 + int feat __maybe_unused, int fd, 1663 + void *data __maybe_unused) 1669 1664 { 1670 1665 if (perf_header__read_build_ids(ph, fd, section->offset, section->size)) 1671 1666 pr_debug("Failed to read buildids, continuing...\n"); ··· 1705 1698 } 1706 1699 1707 1700 static int 1708 - process_event_desc(struct perf_file_section *section __unused, 1709 - struct perf_header *header, int feat __unused, int fd, 1710 - void *data __used) 1701 + process_event_desc(struct perf_file_section *section __maybe_unused, 1702 + struct perf_header *header, int feat __maybe_unused, int fd, 1703 + void *data __maybe_unused) 1711 1704 { 1712 1705 struct perf_session *session = container_of(header, struct perf_session, header); 1713 1706 struct perf_evsel *evsel, *events = read_event_desc(header, fd); ··· 2603 2596 return err; 2604 2597 } 2605 2598 2606 - int perf_event__process_event_type(struct perf_tool *tool __unused, 2599 + int perf_event__process_event_type(struct perf_tool *tool __maybe_unused, 2607 2600 union perf_event *event) 2608 2601 { 2609 2602 if (perf_header__push_event(event->event_type.event_type.event_id, ··· 2620 2613 union perf_event ev; 2621 2614 struct tracing_data *tdata; 2622 2615 ssize_t size = 0, aligned_size = 0, padding; 2623 - int err __used = 0; 2616 + int err __maybe_unused = 0; 2624 2617 2625 2618 /* 2626 2619 * We are going to store the size of the data followed ··· 2719 2712 return err; 2720 2713 } 2721 2714 2722 - int perf_event__process_build_id(struct perf_tool *tool __used, 2715 + int perf_event__process_build_id(struct perf_tool *tool __maybe_unused, 2723 2716 union perf_event *event, 2724 2717 struct perf_session *session) 2725 2718 {
+2 -1
tools/perf/util/help.c
··· 332 332 exit(1); 333 333 } 334 334 335 - int cmd_version(int argc __used, const char **argv __used, const char *prefix __used) 335 + int cmd_version(int argc __maybe_unused, const char **argv __maybe_unused, 336 + const char *prefix __maybe_unused) 336 337 { 337 338 printf("perf version %s\n", perf_version_string); 338 339 return 0;
+1 -1
tools/perf/util/hist.c
··· 394 394 * collapse the histogram 395 395 */ 396 396 397 - static bool hists__collapse_insert_entry(struct hists *hists __used, 397 + static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused, 398 398 struct rb_root *root, 399 399 struct hist_entry *he) 400 400 {
+17 -15
tools/perf/util/hist.h
··· 156 156 157 157 #ifdef NO_NEWT_SUPPORT 158 158 static inline 159 - int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __used, 160 - const char *help __used, 161 - void(*timer)(void *arg) __used, 162 - void *arg __used, 163 - int refresh __used) 159 + int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, 160 + const char *help __maybe_unused, 161 + void(*timer)(void *arg) __maybe_unused, 162 + void *arg __maybe_unused, 163 + int refresh __maybe_unused) 164 164 { 165 165 return 0; 166 166 } 167 167 168 - static inline int hist_entry__tui_annotate(struct hist_entry *self __used, 169 - int evidx __used, 170 - void(*timer)(void *arg) __used, 171 - void *arg __used, 172 - int delay_secs __used) 168 + static inline int hist_entry__tui_annotate(struct hist_entry *self 169 + __maybe_unused, 170 + int evidx __maybe_unused, 171 + void(*timer)(void *arg) 172 + __maybe_unused, 173 + void *arg __maybe_unused, 174 + int delay_secs __maybe_unused) 173 175 { 174 176 return 0; 175 177 } ··· 189 187 190 188 #ifdef NO_GTK2_SUPPORT 191 189 static inline 192 - int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __used, 193 - const char *help __used, 194 - void(*timer)(void *arg) __used, 195 - void *arg __used, 196 - int refresh __used) 190 + int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused, 191 + const char *help __maybe_unused, 192 + void(*timer)(void *arg) __maybe_unused, 193 + void *arg __maybe_unused, 194 + int refresh __maybe_unused) 197 195 { 198 196 return 0; 199 197 }
+3 -1
tools/perf/util/include/linux/compiler.h
··· 9 9 #define __attribute_const__ 10 10 #endif 11 11 12 - #define __used __attribute__((__unused__)) 12 + #ifndef __maybe_unused 13 + #define __maybe_unused __attribute__((unused)) 14 + #endif 13 15 #define __packed __attribute__((__packed__)) 14 16 15 17 #ifndef __force
+2 -2
tools/perf/util/intlist.c
··· 11 11 12 12 #include "intlist.h" 13 13 14 - static struct rb_node *intlist__node_new(struct rblist *rblist __used, 14 + static struct rb_node *intlist__node_new(struct rblist *rblist __maybe_unused, 15 15 const void *entry) 16 16 { 17 17 int i = (int)((long)entry); ··· 31 31 free(ilist); 32 32 } 33 33 34 - static void intlist__node_delete(struct rblist *rblist __used, 34 + static void intlist__node_delete(struct rblist *rblist __maybe_unused, 35 35 struct rb_node *rb_node) 36 36 { 37 37 struct int_node *node = container_of(rb_node, struct int_node, rb_node);
+1 -1
tools/perf/util/map.h
··· 96 96 return ip + map->start - map->pgoff; 97 97 } 98 98 99 - static inline u64 identity__map_ip(struct map *map __used, u64 ip) 99 + static inline u64 identity__map_ip(struct map *map __maybe_unused, u64 ip) 100 100 { 101 101 return ip; 102 102 }
+3 -3
tools/perf/util/parse-events-test.c
··· 569 569 return 0; 570 570 } 571 571 572 - static int test__group3(struct perf_evlist *evlist __used) 572 + static int test__group3(struct perf_evlist *evlist __maybe_unused) 573 573 { 574 574 struct perf_evsel *evsel, *leader; 575 575 ··· 648 648 return 0; 649 649 } 650 650 651 - static int test__group4(struct perf_evlist *evlist __used) 651 + static int test__group4(struct perf_evlist *evlist __maybe_unused) 652 652 { 653 653 struct perf_evsel *evsel, *leader; 654 654 ··· 684 684 return 0; 685 685 } 686 686 687 - static int test__group5(struct perf_evlist *evlist __used) 687 + static int test__group5(struct perf_evlist *evlist __maybe_unused) 688 688 { 689 689 struct perf_evsel *evsel, *leader; 690 690
+4 -3
tools/perf/util/parse-events.c
··· 807 807 return ret; 808 808 } 809 809 810 - int parse_events(struct perf_evlist *evlist, const char *str, int unset __used) 810 + int parse_events(struct perf_evlist *evlist, const char *str, 811 + int unset __maybe_unused) 811 812 { 812 813 struct parse_events_data__events data = { 813 814 .list = LIST_HEAD_INIT(data.list), ··· 834 833 } 835 834 836 835 int parse_events_option(const struct option *opt, const char *str, 837 - int unset __used) 836 + int unset __maybe_unused) 838 837 { 839 838 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; 840 839 return parse_events(evlist, str, unset); 841 840 } 842 841 843 842 int parse_filter(const struct option *opt, const char *str, 844 - int unset __used) 843 + int unset __maybe_unused) 845 844 { 846 845 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value; 847 846 struct perf_evsel *last = NULL;
+1 -1
tools/perf/util/parse-events.l
··· 207 207 208 208 %% 209 209 210 - int parse_events_wrap(void *scanner __used) 210 + int parse_events_wrap(void *scanner __maybe_unused) 211 211 { 212 212 return 1; 213 213 }
+2 -2
tools/perf/util/parse-events.y
··· 391 391 392 392 %% 393 393 394 - void parse_events_error(void *data __used, void *scanner __used, 395 - char const *msg __used) 394 + void parse_events_error(void *data __maybe_unused, void *scanner __maybe_unused, 395 + char const *msg __maybe_unused) 396 396 { 397 397 }
+2 -1
tools/perf/util/parse-options.c
··· 557 557 } 558 558 559 559 560 - int parse_opt_verbosity_cb(const struct option *opt, const char *arg __used, 560 + int parse_opt_verbosity_cb(const struct option *opt, 561 + const char *arg __maybe_unused, 561 562 int unset) 562 563 { 563 564 int *target = opt->value;
+1 -1
tools/perf/util/perf_regs.h
··· 6 6 #else 7 7 #define PERF_REGS_MASK 0 8 8 9 - static inline const char *perf_reg_name(int id __used) 9 + static inline const char *perf_reg_name(int id __maybe_unused) 10 10 { 11 11 return NULL; 12 12 }
+3 -3
tools/perf/util/pmu.y
··· 86 86 87 87 %% 88 88 89 - void perf_pmu_error(struct list_head *list __used, 90 - char *name __used, 91 - char const *msg __used) 89 + void perf_pmu_error(struct list_head *list __maybe_unused, 90 + char *name __maybe_unused, 91 + char const *msg __maybe_unused) 92 92 { 93 93 }
+11 -10
tools/perf/util/probe-event.c
··· 41 41 #include "symbol.h" 42 42 #include "thread.h" 43 43 #include "debugfs.h" 44 - #include "trace-event.h" /* For __unused */ 44 + #include "trace-event.h" /* For __maybe_unused */ 45 45 #include "probe-event.h" 46 46 #include "probe-finder.h" 47 47 #include "session.h" ··· 647 647 } 648 648 649 649 static int try_to_find_probe_trace_events(struct perf_probe_event *pev, 650 - struct probe_trace_event **tevs __unused, 651 - int max_tevs __unused, const char *target) 650 + struct probe_trace_event **tevs __maybe_unused, 651 + int max_tevs __maybe_unused, const char *target) 652 652 { 653 653 if (perf_probe_event_need_dwarf(pev)) { 654 654 pr_warning("Debuginfo-analysis is not supported.\n"); ··· 661 661 return 0; 662 662 } 663 663 664 - int show_line_range(struct line_range *lr __unused, const char *module __unused) 664 + int show_line_range(struct line_range *lr __maybe_unused, 665 + const char *module __maybe_unused) 665 666 { 666 667 pr_warning("Debuginfo-analysis is not supported.\n"); 667 668 return -ENOSYS; 668 669 } 669 670 670 - int show_available_vars(struct perf_probe_event *pevs __unused, 671 - int npevs __unused, int max_vls __unused, 672 - const char *module __unused, 673 - struct strfilter *filter __unused, 674 - bool externs __unused) 671 + int show_available_vars(struct perf_probe_event *pevs __maybe_unused, 672 + int npevs __maybe_unused, int max_vls __maybe_unused, 673 + const char *module __maybe_unused, 674 + struct strfilter *filter __maybe_unused, 675 + bool externs __maybe_unused) 675 676 { 676 677 pr_warning("Debuginfo-analysis is not supported.\n"); 677 678 return -ENOSYS; ··· 2184 2183 * If a symbol corresponds to a function with global binding and 2185 2184 * matches filter return 0. For all others return 1. 2186 2185 */ 2187 - static int filter_available_functions(struct map *map __unused, 2186 + static int filter_available_functions(struct map *map __maybe_unused, 2188 2187 struct symbol *sym) 2189 2188 { 2190 2189 if (sym->binding == STB_GLOBAL &&
+2 -2
tools/perf/util/probe-finder.c
··· 207 207 #else 208 208 /* With older elfutils, this just support kernel module... */ 209 209 static int debuginfo__init_online_kernel_dwarf(struct debuginfo *self, 210 - Dwarf_Addr addr __used) 210 + Dwarf_Addr addr __maybe_unused) 211 211 { 212 212 const char *path = kernel_get_module_path("kernel"); 213 213 ··· 1419 1419 } 1420 1420 1421 1421 static int line_range_walk_cb(const char *fname, int lineno, 1422 - Dwarf_Addr addr __used, 1422 + Dwarf_Addr addr __maybe_unused, 1423 1423 void *data) 1424 1424 { 1425 1425 struct line_finder *lf = data;
+5 -3
tools/perf/util/python.c
··· 672 672 }; 673 673 674 674 static int pyrf_evlist__init(struct pyrf_evlist *pevlist, 675 - PyObject *args, PyObject *kwargs __used) 675 + PyObject *args, PyObject *kwargs __maybe_unused) 676 676 { 677 677 PyObject *pcpus = NULL, *pthreads = NULL; 678 678 struct cpu_map *cpus; ··· 733 733 } 734 734 735 735 static PyObject *pyrf_evlist__get_pollfd(struct pyrf_evlist *pevlist, 736 - PyObject *args __used, PyObject *kwargs __used) 736 + PyObject *args __maybe_unused, 737 + PyObject *kwargs __maybe_unused) 737 738 { 738 739 struct perf_evlist *evlist = &pevlist->evlist; 739 740 PyObject *list = PyList_New(0); ··· 766 765 767 766 768 767 static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist, 769 - PyObject *args, PyObject *kwargs __used) 768 + PyObject *args, 769 + PyObject *kwargs __maybe_unused) 770 770 { 771 771 struct perf_evlist *evlist = &pevlist->evlist; 772 772 PyObject *pevsel;
+4 -4
tools/perf/util/scripting-engines/trace-event-perl.c
··· 257 257 return event; 258 258 } 259 259 260 - static void perl_process_tracepoint(union perf_event *perf_event __unused, 260 + static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused, 261 261 struct perf_sample *sample, 262 262 struct perf_evsel *evsel, 263 - struct machine *machine __unused, 263 + struct machine *machine __maybe_unused, 264 264 struct addr_location *al) 265 265 { 266 266 struct format_field *field; ··· 349 349 static void perl_process_event_generic(union perf_event *event, 350 350 struct perf_sample *sample, 351 351 struct perf_evsel *evsel, 352 - struct machine *machine __unused, 353 - struct addr_location *al __unused) 352 + struct machine *machine __maybe_unused, 353 + struct addr_location *al __maybe_unused) 354 354 { 355 355 dSP; 356 356
+6 -4
tools/perf/util/scripting-engines/trace-event-python.c
··· 221 221 return event; 222 222 } 223 223 224 - static void python_process_tracepoint(union perf_event *perf_event __unused, 224 + static void python_process_tracepoint(union perf_event *perf_event 225 + __maybe_unused, 225 226 struct perf_sample *sample, 226 227 struct perf_evsel *evsel, 227 - struct machine *machine __unused, 228 + struct machine *machine __maybe_unused, 228 229 struct addr_location *al) 229 230 { 230 231 PyObject *handler, *retval, *context, *t, *obj, *dict = NULL; ··· 340 339 Py_DECREF(t); 341 340 } 342 341 343 - static void python_process_general_event(union perf_event *perf_event __unused, 342 + static void python_process_general_event(union perf_event *perf_event 343 + __maybe_unused, 344 344 struct perf_sample *sample, 345 345 struct perf_evsel *evsel, 346 - struct machine *machine __unused, 346 + struct machine *machine __maybe_unused, 347 347 struct addr_location *al) 348 348 { 349 349 PyObject *handler, *retval, *t, *dict;
+27 -23
tools/perf/util/session.c
··· 401 401 402 402 } 403 403 404 - static int process_event_synth_tracing_data_stub(union perf_event *event __used, 405 - struct perf_session *session __used) 404 + static int process_event_synth_tracing_data_stub(union perf_event *event 405 + __maybe_unused, 406 + struct perf_session *session 407 + __maybe_unused) 406 408 { 407 409 dump_printf(": unhandled!\n"); 408 410 return 0; 409 411 } 410 412 411 - static int process_event_synth_attr_stub(union perf_event *event __used, 412 - struct perf_evlist **pevlist __used) 413 + static int process_event_synth_attr_stub(union perf_event *event __maybe_unused, 414 + struct perf_evlist **pevlist 415 + __maybe_unused) 413 416 { 414 417 dump_printf(": unhandled!\n"); 415 418 return 0; 416 419 } 417 420 418 - static int process_event_sample_stub(struct perf_tool *tool __used, 419 - union perf_event *event __used, 420 - struct perf_sample *sample __used, 421 - struct perf_evsel *evsel __used, 422 - struct machine *machine __used) 421 + static int process_event_sample_stub(struct perf_tool *tool __maybe_unused, 422 + union perf_event *event __maybe_unused, 423 + struct perf_sample *sample __maybe_unused, 424 + struct perf_evsel *evsel __maybe_unused, 425 + struct machine *machine __maybe_unused) 423 426 { 424 427 dump_printf(": unhandled!\n"); 425 428 return 0; 426 429 } 427 430 428 - static int process_event_stub(struct perf_tool *tool __used, 429 - union perf_event *event __used, 430 - struct perf_sample *sample __used, 431 - struct machine *machine __used) 431 + static int process_event_stub(struct perf_tool *tool __maybe_unused, 432 + union perf_event *event __maybe_unused, 433 + struct perf_sample *sample __maybe_unused, 434 + struct machine *machine __maybe_unused) 432 435 { 433 436 dump_printf(": unhandled!\n"); 434 437 return 0; 435 438 } 436 439 437 - static int process_finished_round_stub(struct perf_tool *tool __used, 438 - union perf_event *event __used, 439 - struct perf_session *perf_session __used) 440 + static int process_finished_round_stub(struct perf_tool *tool __maybe_unused, 441 + union perf_event *event __maybe_unused, 442 + struct perf_session *perf_session 443 + __maybe_unused) 440 444 { 441 445 dump_printf(": unhandled!\n"); 442 446 return 0; 443 447 } 444 448 445 - static int process_event_type_stub(struct perf_tool *tool __used, 446 - union perf_event *event __used) 449 + static int process_event_type_stub(struct perf_tool *tool __maybe_unused, 450 + union perf_event *event __maybe_unused) 447 451 { 448 452 dump_printf(": unhandled!\n"); 449 453 return 0; ··· 524 520 } 525 521 526 522 static void perf_event__all64_swap(union perf_event *event, 527 - bool sample_id_all __used) 523 + bool sample_id_all __maybe_unused) 528 524 { 529 525 struct perf_event_header *hdr = &event->header; 530 526 mem_bswap_64(hdr + 1, event->header.size - sizeof(*hdr)); ··· 635 631 } 636 632 637 633 static void perf_event__hdr_attr_swap(union perf_event *event, 638 - bool sample_id_all __used) 634 + bool sample_id_all __maybe_unused) 639 635 { 640 636 size_t size; 641 637 ··· 647 643 } 648 644 649 645 static void perf_event__event_type_swap(union perf_event *event, 650 - bool sample_id_all __used) 646 + bool sample_id_all __maybe_unused) 651 647 { 652 648 event->event_type.event_type.event_id = 653 649 bswap_64(event->event_type.event_type.event_id); 654 650 } 655 651 656 652 static void perf_event__tracing_data_swap(union perf_event *event, 657 - bool sample_id_all __used) 653 + bool sample_id_all __maybe_unused) 658 654 { 659 655 event->tracing_data.size = bswap_32(event->tracing_data.size); 660 656 } ··· 795 791 * etc... 796 792 */ 797 793 static int process_finished_round(struct perf_tool *tool, 798 - union perf_event *event __used, 794 + union perf_event *event __maybe_unused, 799 795 struct perf_session *session) 800 796 { 801 797 int ret = flush_sample_queue(session, tool);
+9 -5
tools/perf/util/sort.c
··· 170 170 171 171 static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym, 172 172 u64 ip, char level, char *bf, size_t size, 173 - unsigned int width __used) 173 + unsigned int width __maybe_unused) 174 174 { 175 175 size_t ret = 0; 176 176 ··· 205 205 }; 206 206 207 207 static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf, 208 - size_t size, unsigned int width __used) 208 + size_t size, 209 + unsigned int width __maybe_unused) 209 210 { 210 211 return _hist_entry__sym_snprintf(self->ms.map, self->ms.sym, self->ip, 211 212 self->level, bf, size, width); ··· 249 248 } 250 249 251 250 static int hist_entry__srcline_snprintf(struct hist_entry *self, char *bf, 252 - size_t size, unsigned int width __used) 251 + size_t size, 252 + unsigned int width __maybe_unused) 253 253 { 254 254 FILE *fp; 255 255 char cmd[PATH_MAX + 2], *path = self->srcline, *nl; ··· 399 397 } 400 398 401 399 static int hist_entry__sym_from_snprintf(struct hist_entry *self, char *bf, 402 - size_t size, unsigned int width __used) 400 + size_t size, 401 + unsigned int width __maybe_unused) 403 402 { 404 403 struct addr_map_symbol *from = &self->branch_info->from; 405 404 return _hist_entry__sym_snprintf(from->map, from->sym, from->addr, ··· 409 406 } 410 407 411 408 static int hist_entry__sym_to_snprintf(struct hist_entry *self, char *bf, 412 - size_t size, unsigned int width __used) 409 + size_t size, 410 + unsigned int width __maybe_unused) 413 411 { 414 412 struct addr_map_symbol *to = &self->branch_info->to; 415 413 return _hist_entry__sym_snprintf(to->map, to->sym, to->addr,
+16 -12
tools/perf/util/symbol-minimal.c
··· 69 69 return -1; 70 70 } 71 71 72 - int filename__read_debuglink(const char *filename __used, 73 - char *debuglink __used, size_t size __used) 72 + int filename__read_debuglink(const char *filename __maybe_unused, 73 + char *debuglink __maybe_unused, 74 + size_t size __maybe_unused) 74 75 { 75 76 return -1; 76 77 } ··· 242 241 return ret; 243 242 } 244 243 245 - int symsrc__init(struct symsrc *ss, struct dso *dso __used, const char *name, 244 + int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused, 245 + const char *name, 246 246 enum dso_binary_type type) 247 247 { 248 248 int fd = open(name, O_RDONLY); ··· 262 260 return -1; 263 261 } 264 262 265 - bool symsrc__possibly_runtime(struct symsrc *ss __used) 263 + bool symsrc__possibly_runtime(struct symsrc *ss __maybe_unused) 266 264 { 267 265 /* Assume all sym sources could be a runtime image. */ 268 266 return true; 269 267 } 270 268 271 - bool symsrc__has_symtab(struct symsrc *ss __used) 269 + bool symsrc__has_symtab(struct symsrc *ss __maybe_unused) 272 270 { 273 271 return false; 274 272 } ··· 279 277 close(ss->fd); 280 278 } 281 279 282 - int dso__synthesize_plt_symbols(struct dso *dso __used, 283 - struct symsrc *ss __used, 284 - struct map *map __used, 285 - symbol_filter_t filter __used) 280 + int dso__synthesize_plt_symbols(struct dso *dso __maybe_unused, 281 + struct symsrc *ss __maybe_unused, 282 + struct map *map __maybe_unused, 283 + symbol_filter_t filter __maybe_unused) 286 284 { 287 285 return 0; 288 286 } 289 287 290 - int dso__load_sym(struct dso *dso, struct map *map __used, struct symsrc *ss, 291 - struct symsrc *runtime_ss __used, 292 - symbol_filter_t filter __used, int kmodule __used) 288 + int dso__load_sym(struct dso *dso, struct map *map __maybe_unused, 289 + struct symsrc *ss, 290 + struct symsrc *runtime_ss __maybe_unused, 291 + symbol_filter_t filter __maybe_unused, 292 + int kmodule __maybe_unused) 293 293 { 294 294 unsigned char *build_id[BUILD_ID_SIZE]; 295 295
+1 -1
tools/perf/util/symbol.c
··· 1755 1755 }; 1756 1756 1757 1757 static int symbol__in_kernel(void *arg, const char *name, 1758 - char type __used, u64 start) 1758 + char type __maybe_unused, u64 start) 1759 1759 { 1760 1760 struct process_args *args = arg; 1761 1761
+4 -3
tools/perf/util/symbol.h
··· 21 21 #ifdef HAVE_CPLUS_DEMANGLE 22 22 extern char *cplus_demangle(const char *, int); 23 23 24 - static inline char *bfd_demangle(void __used *v, const char *c, int i) 24 + static inline char *bfd_demangle(void __maybe_unused *v, const char *c, int i) 25 25 { 26 26 return cplus_demangle(c, i); 27 27 } 28 28 #else 29 29 #ifdef NO_DEMANGLE 30 - static inline char *bfd_demangle(void __used *v, const char __used *c, 31 - int __used i) 30 + static inline char *bfd_demangle(void __maybe_unused *v, 31 + const char __maybe_unused *c, 32 + int __maybe_unused i) 32 33 { 33 34 return NULL; 34 35 }
+2 -2
tools/perf/util/trace-event-parse.c
··· 221 221 } 222 222 223 223 void parse_proc_kallsyms(struct pevent *pevent, 224 - char *file, unsigned int size __unused) 224 + char *file, unsigned int size __maybe_unused) 225 225 { 226 226 unsigned long long addr; 227 227 char *func; ··· 253 253 } 254 254 255 255 void parse_ftrace_printk(struct pevent *pevent, 256 - char *file, unsigned int size __unused) 256 + char *file, unsigned int size __maybe_unused) 257 257 { 258 258 unsigned long long addr; 259 259 char *printk;
+18 -15
tools/perf/util/trace-event-scripting.c
··· 35 35 return 0; 36 36 } 37 37 38 - static void process_event_unsupported(union perf_event *event __unused, 39 - struct perf_sample *sample __unused, 40 - struct perf_evsel *evsel __unused, 41 - struct machine *machine __unused, 42 - struct addr_location *al __unused) 38 + static void process_event_unsupported(union perf_event *event __maybe_unused, 39 + struct perf_sample *sample __maybe_unused, 40 + struct perf_evsel *evsel __maybe_unused, 41 + struct machine *machine __maybe_unused, 42 + struct addr_location *al __maybe_unused) 43 43 { 44 44 } 45 45 ··· 52 52 "\n etc.\n"); 53 53 } 54 54 55 - static int python_start_script_unsupported(const char *script __unused, 56 - int argc __unused, 57 - const char **argv __unused) 55 + static int python_start_script_unsupported(const char *script __maybe_unused, 56 + int argc __maybe_unused, 57 + const char **argv __maybe_unused) 58 58 { 59 59 print_python_unsupported_msg(); 60 60 61 61 return -1; 62 62 } 63 63 64 - static int python_generate_script_unsupported(struct pevent *pevent __unused, 65 - const char *outfile __unused) 64 + static int python_generate_script_unsupported(struct pevent *pevent 65 + __maybe_unused, 66 + const char *outfile 67 + __maybe_unused) 66 68 { 67 69 print_python_unsupported_msg(); 68 70 ··· 116 114 "\n etc.\n"); 117 115 } 118 116 119 - static int perl_start_script_unsupported(const char *script __unused, 120 - int argc __unused, 121 - const char **argv __unused) 117 + static int perl_start_script_unsupported(const char *script __maybe_unused, 118 + int argc __maybe_unused, 119 + const char **argv __maybe_unused) 122 120 { 123 121 print_perl_unsupported_msg(); 124 122 125 123 return -1; 126 124 } 127 125 128 - static int perl_generate_script_unsupported(struct pevent *pevent __unused, 129 - const char *outfile __unused) 126 + static int perl_generate_script_unsupported(struct pevent *pevent 127 + __maybe_unused, 128 + const char *outfile __maybe_unused) 130 129 { 131 130 print_perl_unsupported_msg(); 132 131
+20 -16
tools/perf/util/unwind.c
··· 307 307 need_unwind_info, arg); 308 308 } 309 309 310 - static int access_fpreg(unw_addr_space_t __used as, unw_regnum_t __used num, 311 - unw_fpreg_t __used *val, int __used __write, 312 - void __used *arg) 310 + static int access_fpreg(unw_addr_space_t __maybe_unused as, 311 + unw_regnum_t __maybe_unused num, 312 + unw_fpreg_t __maybe_unused *val, 313 + int __maybe_unused __write, 314 + void __maybe_unused *arg) 313 315 { 314 316 pr_err("unwind: access_fpreg unsupported\n"); 315 317 return -UNW_EINVAL; 316 318 } 317 319 318 - static int get_dyn_info_list_addr(unw_addr_space_t __used as, 319 - unw_word_t __used *dil_addr, 320 - void __used *arg) 320 + static int get_dyn_info_list_addr(unw_addr_space_t __maybe_unused as, 321 + unw_word_t __maybe_unused *dil_addr, 322 + void __maybe_unused *arg) 321 323 { 322 324 return -UNW_ENOINFO; 323 325 } 324 326 325 - static int resume(unw_addr_space_t __used as, unw_cursor_t __used *cu, 326 - void __used *arg) 327 + static int resume(unw_addr_space_t __maybe_unused as, 328 + unw_cursor_t __maybe_unused *cu, 329 + void __maybe_unused *arg) 327 330 { 328 331 pr_err("unwind: resume unsupported\n"); 329 332 return -UNW_EINVAL; 330 333 } 331 334 332 335 static int 333 - get_proc_name(unw_addr_space_t __used as, unw_word_t __used addr, 334 - char __used *bufp, size_t __used buf_len, 335 - unw_word_t __used *offp, void __used *arg) 336 + get_proc_name(unw_addr_space_t __maybe_unused as, 337 + unw_word_t __maybe_unused addr, 338 + char __maybe_unused *bufp, size_t __maybe_unused buf_len, 339 + unw_word_t __maybe_unused *offp, void __maybe_unused *arg) 336 340 { 337 341 pr_err("unwind: get_proc_name unsupported\n"); 338 342 return -UNW_EINVAL; ··· 381 377 return 0; 382 378 } 383 379 384 - static int access_mem(unw_addr_space_t __used as, 380 + static int access_mem(unw_addr_space_t __maybe_unused as, 385 381 unw_word_t addr, unw_word_t *valp, 386 382 int __write, void *arg) 387 383 { ··· 426 422 return 0; 427 423 } 428 424 429 - static int access_reg(unw_addr_space_t __used as, 425 + static int access_reg(unw_addr_space_t __maybe_unused as, 430 426 unw_regnum_t regnum, unw_word_t *valp, 431 427 int __write, void *arg) 432 428 { ··· 458 454 return 0; 459 455 } 460 456 461 - static void put_unwind_info(unw_addr_space_t __used as, 462 - unw_proc_info_t *pi __used, 463 - void *arg __used) 457 + static void put_unwind_info(unw_addr_space_t __maybe_unused as, 458 + unw_proc_info_t *pi __maybe_unused, 459 + void *arg __maybe_unused) 464 460 { 465 461 pr_debug("unwind: put_unwind_info called\n"); 466 462 }
+6 -5
tools/perf/util/unwind.h
··· 22 22 int unwind__arch_reg_id(int regnum); 23 23 #else 24 24 static inline int 25 - unwind__get_entries(unwind_entry_cb_t cb __used, void *arg __used, 26 - struct machine *machine __used, 27 - struct thread *thread __used, 28 - u64 sample_uregs __used, 29 - struct perf_sample *data __used) 25 + unwind__get_entries(unwind_entry_cb_t cb __maybe_unused, 26 + void *arg __maybe_unused, 27 + struct machine *machine __maybe_unused, 28 + struct thread *thread __maybe_unused, 29 + u64 sample_uregs __maybe_unused, 30 + struct perf_sample *data __maybe_unused) 30 31 { 31 32 return 0; 32 33 }
+2 -1
tools/perf/util/wrapper.c
··· 7 7 * There's no pack memory to release - but stay close to the Git 8 8 * version so wrap this away: 9 9 */ 10 - static inline void release_pack_memory(size_t size __used, int flag __used) 10 + static inline void release_pack_memory(size_t size __maybe_unused, 11 + int flag __maybe_unused) 11 12 { 12 13 } 13 14