perf tools: Use __maybe_used for unused variables
[deliverable/linux.git] / tools / perf / builtin-top.c
index 392d2192b75e56c6dda5fe426f2d6129e855edde..5550754c05f2f108e729f4254a44de4c3276ec6f 100644 (file)
@@ -95,7 +95,8 @@ static void perf_top__update_print_entries(struct perf_top *top)
                top->print_entries -= 9;
 }
 
-static void perf_top__sig_winch(int sig __used, siginfo_t *info __used, void *arg)
+static void perf_top__sig_winch(int sig __maybe_unused,
+                               siginfo_t *info __maybe_unused, void *arg)
 {
        struct perf_top *top = arg;
 
@@ -509,7 +510,7 @@ static void perf_top__handle_keypress(struct perf_top *top, int c)
                                prompt_integer(&counter, "Enter details event counter");
 
                                if (counter >= top->evlist->nr_entries) {
-                                       top->sym_evsel = list_entry(top->evlist->entries.next, struct perf_evsel, node);
+                                       top->sym_evsel = perf_evlist__first(top->evlist);
                                        fprintf(stderr, "Sorry, no such event, using %s.\n", perf_evsel__name(top->sym_evsel));
                                        sleep(1);
                                        break;
@@ -518,7 +519,7 @@ static void perf_top__handle_keypress(struct perf_top *top, int c)
                                        if (top->sym_evsel->idx == counter)
                                                break;
                        } else
-                               top->sym_evsel = list_entry(top->evlist->entries.next, struct perf_evsel, node);
+                               top->sym_evsel = perf_evlist__first(top->evlist);
                        break;
                case 'f':
                        prompt_integer(&top->count_filter, "Enter display event count filter");
@@ -663,7 +664,7 @@ static const char *skip_symbols[] = {
        NULL
 };
 
-static int symbol_filter(struct map *map __used, struct symbol *sym)
+static int symbol_filter(struct map *map __maybe_unused, struct symbol *sym)
 {
        const char *name = sym->name;
        int i;
@@ -890,7 +891,7 @@ static void perf_top__start_counters(struct perf_top *top)
        struct perf_evlist *evlist = top->evlist;
 
        if (top->group)
-               perf_evlist__group(evlist);
+               perf_evlist__set_leader(evlist);
 
        list_for_each_entry(counter, &evlist->entries, node) {
                struct perf_event_attr *attr = &counter->attr;
@@ -1163,7 +1164,7 @@ static const char * const top_usage[] = {
        NULL
 };
 
-int cmd_top(int argc, const char **argv, const char *prefix __used)
+int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 {
        struct perf_evsel *pos;
        int status;
@@ -1326,7 +1327,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
                        pos->attr.sample_period = top.default_interval;
        }
 
-       top.sym_evsel = list_entry(top.evlist->entries.next, struct perf_evsel, node);
+       top.sym_evsel = perf_evlist__first(top.evlist);
 
        symbol_conf.priv_size = sizeof(struct annotation);
 
This page took 0.035796 seconds and 5 git commands to generate.