]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf utils: Check verbose flag properly
authorNamhyung Kim <namhyung@kernel.org>
Fri, 17 Feb 2017 08:17:38 +0000 (17:17 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 20 Feb 2017 14:35:54 +0000 (11:35 -0300)
It now can have negative value to suppress the message entirely.  So it
needs to check it being positive.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170217081742.17417-3-namhyung@kernel.org
[ Adjust fuzz on tools/perf/util/pmu.c, add > 0 checks in many other places ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
29 files changed:
tools/perf/builtin-diff.c
tools/perf/builtin-mem.c
tools/perf/builtin-record.c
tools/perf/builtin-report.c
tools/perf/builtin-sched.c
tools/perf/builtin-stat.c
tools/perf/builtin-top.c
tools/perf/builtin-trace.c
tools/perf/pmu-events/json.c
tools/perf/tests/attr.c
tools/perf/tests/builtin-test.c
tools/perf/tests/code-reading.c
tools/perf/tests/fdarray.c
tools/perf/tests/llvm.c
tools/perf/tests/parse-events.c
tools/perf/tests/perf-record.c
tools/perf/tests/python-use.c
tools/perf/tests/thread-map.c
tools/perf/tests/vmlinux-kallsyms.c
tools/perf/ui/browsers/map.c
tools/perf/ui/hist.c
tools/perf/util/annotate.c
tools/perf/util/dso.c
tools/perf/util/hist.c
tools/perf/util/pmu.c
tools/perf/util/probe-event.c
tools/perf/util/sort.c
tools/perf/util/stat.c
tools/perf/util/symbol-elf.c

index 70a2893475912e3eee09f5b8787136329dec2116..7ad0d78ea7439f0956919b8ec7b26c16f8009592 100644 (file)
@@ -744,7 +744,7 @@ static void data_process(void)
 
                first = false;
 
-               if (verbose || data__files_cnt > 2)
+               if (verbose > 0 || data__files_cnt > 2)
                        data__fprintf();
 
                /* Don't sort callchain for perf diff */
index cd7bc4d104e27e878e1ed694bf6be1d9b89d0a9d..6114e07ca6131ca94ed1a6107fb69ae3ccbab145 100644 (file)
@@ -42,8 +42,8 @@ static int parse_record_events(const struct option *opt,
 
                fprintf(stderr, "%-13s%-*s%s\n",
                        e->tag,
-                       verbose ? 25 : 0,
-                       verbose ? perf_mem_events__name(j) : "",
+                       verbose > 0 ? 25 : 0,
+                       verbose > 0 ? perf_mem_events__name(j) : "",
                        e->supported ? ": available" : "");
        }
        exit(0);
index b87bbef733944d5a5cda318ce1d97c57523247f2..451b11e35c26820892d9f86ab3f822590419932d 100644 (file)
@@ -432,7 +432,7 @@ static int record__open(struct record *rec)
 try_again:
                if (perf_evsel__open(pos, pos->cpus, pos->threads) < 0) {
                        if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) {
-                               if (verbose)
+                               if (verbose > 0)
                                        ui__warning("%s\n", msg);
                                goto try_again;
                        }
index dbd7fa0288616e3c29003d9de62e8a62bf068051..a94488114bbf781e3379a5ce89bc077c31f5d23f 100644 (file)
@@ -1009,7 +1009,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
                 * providing it only in verbose mode not to bloat too
                 * much struct symbol.
                 */
-               if (verbose) {
+               if (verbose > 0) {
                        /*
                         * XXX: Need to provide a less kludgy way to ask for
                         * more space per symbol, the u32 is for the index on
index 270eb2d8ca6b24bb6b7c74ff0b068417e655d8e7..b94cf0de715ab9a2d6205c12053916c31d276a13 100644 (file)
@@ -460,7 +460,7 @@ static struct task_desc *register_pid(struct perf_sched *sched,
        BUG_ON(!sched->tasks);
        sched->tasks[task->nr] = task;
 
-       if (verbose)
+       if (verbose > 0)
                printf("registered task #%ld, PID %ld (%s)\n", sched->nr_tasks, pid, comm);
 
        return task;
@@ -794,7 +794,7 @@ replay_wakeup_event(struct perf_sched *sched,
        const u32 pid    = perf_evsel__intval(evsel, sample, "pid");
        struct task_desc *waker, *wakee;
 
-       if (verbose) {
+       if (verbose > 0) {
                printf("sched_wakeup event %p\n", evsel);
 
                printf(" ... pid %d woke up %s/%d\n", sample->tid, comm, pid);
@@ -822,7 +822,7 @@ static int replay_switch_event(struct perf_sched *sched,
        int cpu = sample->cpu;
        s64 delta;
 
-       if (verbose)
+       if (verbose > 0)
                printf("sched_switch event %p\n", evsel);
 
        if (cpu >= MAX_CPUS || cpu < 0)
@@ -870,7 +870,7 @@ static int replay_fork_event(struct perf_sched *sched,
                goto out_put;
        }
 
-       if (verbose) {
+       if (verbose > 0) {
                printf("fork event\n");
                printf("... parent: %s/%d\n", thread__comm_str(parent), parent->tid);
                printf("...  child: %s/%d\n", thread__comm_str(child), child->tid);
@@ -1573,7 +1573,7 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
 
        timestamp__scnprintf_usec(timestamp, stimestamp, sizeof(stimestamp));
        color_fprintf(stdout, color, "  %12s secs ", stimestamp);
-       if (new_shortname || (verbose && sched_in->tid)) {
+       if (new_shortname || (verbose > 0 && sched_in->tid)) {
                const char *pid_color = color;
 
                if (thread__has_color(sched_in))
@@ -2050,7 +2050,7 @@ static void save_task_callchain(struct perf_sched *sched,
 
        if (thread__resolve_callchain(thread, cursor, evsel, sample,
                                      NULL, NULL, sched->max_stack + 2) != 0) {
-               if (verbose)
+               if (verbose > 0)
                        error("Failed to resolve callchain. Skipping\n");
 
                return;
index 9989b03c21f25014804ed70afa2261a327b72cfc..13b54999ad79ecd4f765d557bf57764486f1fac8 100644 (file)
@@ -573,7 +573,7 @@ static int __run_perf_stat(int argc, const char **argv)
                        if (errno == EINVAL || errno == ENOSYS ||
                            errno == ENOENT || errno == EOPNOTSUPP ||
                            errno == ENXIO) {
-                               if (verbose)
+                               if (verbose > 0)
                                        ui__warning("%s event is not supported by the kernel.\n",
                                                    perf_evsel__name(counter));
                                counter->supported = false;
@@ -582,7 +582,7 @@ static int __run_perf_stat(int argc, const char **argv)
                                    !(counter->leader->nr_members > 1))
                                        continue;
                        } else if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) {
-                                if (verbose)
+                                if (verbose > 0)
                                         ui__warning("%s\n", msg);
                                 goto try_again;
                         }
@@ -2539,7 +2539,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
 
        status = 0;
        for (run_idx = 0; forever || run_idx < run_count; run_idx++) {
-               if (run_count != 1 && verbose)
+               if (run_count != 1 && verbose > 0)
                        fprintf(output, "[ perf stat: executing run #%d ... ]\n",
                                run_idx + 1);
 
index 5a7fd7af3a6de39d4a0d5c5ed5a758c92aeb88f3..ab9077915763f19a71b1b36a8b50135e6a0ffbb3 100644 (file)
@@ -871,7 +871,7 @@ static int perf_top__start_counters(struct perf_top *top)
                if (perf_evsel__open(counter, top->evlist->cpus,
                                     top->evlist->threads) < 0) {
                        if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) {
-                               if (verbose)
+                               if (verbose > 0)
                                        ui__warning("%s\n", msg);
                                goto try_again;
                        }
index 40ef9b293d1b4ffa0213108ca3ec391621c1267d..256f1fac6f7e0069ebb047cf080fa55999dd0ae1 100644 (file)
@@ -1399,7 +1399,7 @@ static struct syscall *trace__syscall_info(struct trace *trace,
        return &trace->syscalls.table[id];
 
 out_cant_read:
-       if (verbose) {
+       if (verbose > 0) {
                fprintf(trace->output, "Problems reading syscall %d", id);
                if (id <= trace->syscalls.max && trace->syscalls.table[id].name != NULL)
                        fprintf(trace->output, "(%s)", trace->syscalls.table[id].name);
@@ -1801,10 +1801,10 @@ static void print_location(FILE *f, struct perf_sample *sample,
                           bool print_dso, bool print_sym)
 {
 
-       if ((verbose || print_dso) && al->map)
+       if ((verbose > 0 || print_dso) && al->map)
                fprintf(f, "%s@", al->map->dso->long_name);
 
-       if ((verbose || print_sym) && al->sym)
+       if ((verbose > 0 || print_sym) && al->sym)
                fprintf(f, "%s+0x%" PRIx64, al->sym->name,
                        al->addr - al->sym->start);
        else if (al->map)
index f67bbb0aa36e572c46b5847736cc3d3efa188f8f..0544398d6e2dd599e92a3771a72a52138a72d2f7 100644 (file)
@@ -49,7 +49,7 @@ static char *mapfile(const char *fn, size_t *size)
        int err;
        int fd = open(fn, O_RDONLY);
 
-       if (fd < 0 && verbose && fn) {
+       if (fd < 0 && verbose > 0 && fn) {
                pr_err("Error opening events file '%s': %s\n", fn,
                                strerror(errno));
        }
index 28d1605b033896aa4b87844eeffa6d9dc1646e6b..88dc51f4c27b2df8c5d8dc482a189b9831cb2832 100644 (file)
@@ -144,7 +144,7 @@ static int run_dir(const char *d, const char *perf)
        int vcnt = min(verbose, (int) sizeof(v) - 1);
        char cmd[3*PATH_MAX];
 
-       if (verbose)
+       if (verbose > 0)
                vcnt++;
 
        snprintf(cmd, 3*PATH_MAX, PYTHON " %s/attr.py -d %s/attr/ -p %s %.*s",
index 37e326bfd2dc3a273032eeac68de3c8d4383104f..83c4669cbc5b9e30576321026dd38d68aa117fde 100644 (file)
@@ -299,7 +299,7 @@ static int run_test(struct test *test, int subtest)
                if (!dont_fork) {
                        pr_debug("test child forked, pid %d\n", getpid());
 
-                       if (!verbose) {
+                       if (verbose <= 0) {
                                int nullfd = open("/dev/null", O_WRONLY);
 
                                if (nullfd >= 0) {
index ff5bc6363a79de05084aca11ec856f468ce9903d..d1f693041324a8a6670ff56081537c3ed3f528f0 100644 (file)
@@ -599,7 +599,7 @@ static int do_test_code_reading(bool try_kcore)
                                continue;
                        }
 
-                       if (verbose) {
+                       if (verbose > 0) {
                                char errbuf[512];
                                perf_evlist__strerror_open(evlist, errno, errbuf, sizeof(errbuf));
                                pr_debug("perf_evlist__open() failed!\n%s\n", errbuf);
index a2b5ff9bf83d615b67d97a00ec38e04e3f8f6291..bc5982f42dc3a173d81e5100172578ac4bdb280b 100644 (file)
@@ -19,7 +19,7 @@ static int fdarray__fprintf_prefix(struct fdarray *fda, const char *prefix, FILE
 {
        int printed = 0;
 
-       if (!verbose)
+       if (verbose <= 0)
                return 0;
 
        printed += fprintf(fp, "\n%s: ", prefix);
index d357dab72e68862e90d916092755a12f535ec1a4..482b5365e68d85b3ea4915631f398873e575d72b 100644 (file)
@@ -76,7 +76,7 @@ test_llvm__fetch_bpf_obj(void **p_obj_buf,
         * Skip this test if user's .perfconfig doesn't set [llvm] section
         * and clang is not found in $PATH, and this is not perf test -v
         */
-       if (!force && (verbose == 0 &&
+       if (!force && (verbose <= 0 &&
                       !llvm_param.user_set_param &&
                       llvm__search_clang())) {
                pr_debug("No clang and no verbosive, skip this test\n");
index aa9276bfe3e9b7b6ed1def3889142c645c1e8e30..1dc8380144220bd2c37f5c6338ad9a38e1c641bf 100644 (file)
@@ -1808,7 +1808,7 @@ static void debug_warn(const char *warn, va_list params)
 {
        char msg[1024];
 
-       if (!verbose)
+       if (verbose <= 0)
                return;
 
        vsnprintf(msg, sizeof(msg), warn, params);
index 541da7a68f91fc4631c0c20f313a9b58f720771b..87893f3ba5f1766cffa093ce44db50de45526279 100644 (file)
@@ -172,13 +172,13 @@ int test__PERF_RECORD(int subtest __maybe_unused)
 
                                err = perf_evlist__parse_sample(evlist, event, &sample);
                                if (err < 0) {
-                                       if (verbose)
+                                       if (verbose > 0)
                                                perf_event__fprintf(event, stderr);
                                        pr_debug("Couldn't parse sample\n");
                                        goto out_delete_evlist;
                                }
 
-                               if (verbose) {
+                               if (verbose > 0) {
                                        pr_info("%" PRIu64" %d ", sample.time, sample.cpu);
                                        perf_event__fprintf(event, stderr);
                                }
index 7a52834ee0d0e848802b104719ee7726e3b97aae..fa79509da535403888c41cfa33a3ca3ff89033fd 100644 (file)
@@ -15,7 +15,7 @@ int test__python_use(int subtest __maybe_unused)
        int ret;
 
        if (asprintf(&cmd, "echo \"import sys ; sys.path.append('%s'); import perf\" | %s %s",
-                    PYTHONPATH, PYTHON, verbose ? "" : "2> /dev/null") < 0)
+                    PYTHONPATH, PYTHON, verbose > 0 ? "" : "2> /dev/null") < 0)
                return -1;
 
        ret = system(cmd) ? -1 : 0;
index a4a4b4625ac3d8864531b781c747945b53f1f849..f2d2e542d0ee77a8abf7bfc6074f0934da85b5c4 100644 (file)
@@ -109,7 +109,7 @@ int test__thread_map_remove(int subtest __maybe_unused)
        TEST_ASSERT_VAL("failed to allocate thread_map",
                        threads);
 
-       if (verbose)
+       if (verbose > 0)
                thread_map__fprintf(threads, stderr);
 
        TEST_ASSERT_VAL("failed to remove thread",
@@ -117,7 +117,7 @@ int test__thread_map_remove(int subtest __maybe_unused)
 
        TEST_ASSERT_VAL("thread_map count != 1", threads->nr == 1);
 
-       if (verbose)
+       if (verbose > 0)
                thread_map__fprintf(threads, stderr);
 
        TEST_ASSERT_VAL("failed to remove thread",
@@ -125,7 +125,7 @@ int test__thread_map_remove(int subtest __maybe_unused)
 
        TEST_ASSERT_VAL("thread_map count != 0", threads->nr == 0);
 
-       if (verbose)
+       if (verbose > 0)
                thread_map__fprintf(threads, stderr);
 
        TEST_ASSERT_VAL("failed to not remove thread",
index a5082331f2464929ed4ff6d3cae9869c41b1772e..862b043e59243588671c75298b337d8cd4e29c3b 100644 (file)
@@ -168,7 +168,7 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused)
                err = -1;
        }
 
-       if (!verbose)
+       if (verbose <= 0)
                goto out;
 
        header_printed = false;
index 98a34664bb7eb16667ee7169129e7e5b5b8022db..9ce142de536d0dcbb4017d2d80a40a9a668775c4 100644 (file)
@@ -73,7 +73,7 @@ static int map_browser__run(struct map_browser *browser)
 
        if (ui_browser__show(&browser->b, browser->map->dso->long_name,
                             "Press ESC to exit, %s / to search",
-                            verbose ? "" : "restart with -v to use") < 0)
+                            verbose > 0 ? "" : "restart with -v to use") < 0)
                return -1;
 
        while (1) {
@@ -81,7 +81,7 @@ static int map_browser__run(struct map_browser *browser)
 
                switch (key) {
                case '/':
-                       if (verbose)
+                       if (verbose > 0)
                                map_browser__search(browser);
                default:
                        break;
@@ -117,7 +117,7 @@ int map__browse(struct map *map)
 
                if (maxaddr < pos->end)
                        maxaddr = pos->end;
-               if (verbose) {
+               if (verbose > 0) {
                        u32 *idx = symbol__browser_index(pos);
                        *idx = mb.b.nr_entries;
                }
index 18cfcdc90356f89f75b328870cc5fcc621b2005f..5d632dca672aef2851778fb50be672e39c99bf50 100644 (file)
@@ -648,7 +648,7 @@ unsigned int hists__sort_list_width(struct hists *hists)
                ret += fmt->width(fmt, &dummy_hpp, hists);
        }
 
-       if (verbose && hists__has(hists, sym)) /* Addr + origin */
+       if (verbose > 0 && hists__has(hists, sym)) /* Addr + origin */
                ret += 3 + BITS_PER_LONG / 4;
 
        return ret;
index 06cc04e5806a2692fffabbc2c038b82380dfcafd..273f21fa32b55999ab1271e6d3cc316c3a257a41 100644 (file)
@@ -1768,7 +1768,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
        printf("%-*.*s----\n",
               graph_dotted_len, graph_dotted_len, graph_dotted_line);
 
-       if (verbose)
+       if (verbose > 0)
                symbol__annotate_hits(sym, evsel);
 
        list_for_each_entry(pos, &notes->src->source, node) {
index 28d41e709128f51414817ad21a16ea636c007709..1a03e9e310a457e140fc3332504cd60d948e7942 100644 (file)
@@ -1058,7 +1058,7 @@ int dso__name_len(const struct dso *dso)
 {
        if (!dso)
                return strlen("[unknown]");
-       if (verbose)
+       if (verbose > 0)
                return dso->long_name_len;
 
        return dso->short_name_len;
index 32c6a939e4cc6879d872574e27b7dab28970cb2c..eaf72a938fb423ed4ba46982c69324d2341839bc 100644 (file)
@@ -69,7 +69,7 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
         */
        if (h->ms.sym) {
                symlen = h->ms.sym->namelen + 4;
-               if (verbose)
+               if (verbose > 0)
                        symlen += BITS_PER_LONG / 4 + 2 + 3;
                hists__new_col_len(hists, HISTC_SYMBOL, symlen);
        } else {
@@ -93,7 +93,7 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
        if (h->branch_info) {
                if (h->branch_info->from.sym) {
                        symlen = (int)h->branch_info->from.sym->namelen + 4;
-                       if (verbose)
+                       if (verbose > 0)
                                symlen += BITS_PER_LONG / 4 + 2 + 3;
                        hists__new_col_len(hists, HISTC_SYMBOL_FROM, symlen);
 
@@ -107,7 +107,7 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
 
                if (h->branch_info->to.sym) {
                        symlen = (int)h->branch_info->to.sym->namelen + 4;
-                       if (verbose)
+                       if (verbose > 0)
                                symlen += BITS_PER_LONG / 4 + 2 + 3;
                        hists__new_col_len(hists, HISTC_SYMBOL_TO, symlen);
 
index 63cb46cb9b0f436a708d9f02a05eeaf025285718..12f84dd2ac5dfddc9f7e124fa25b5da4bb2be021 100644 (file)
@@ -745,7 +745,7 @@ static int pmu_resolve_param_term(struct parse_events_term *term,
                }
        }
 
-       if (verbose)
+       if (verbose > 0)
                printf("Required parameter '%s' not specified\n", term->config);
 
        return -1;
@@ -803,7 +803,7 @@ static int pmu_config_term(struct list_head *formats,
 
        format = pmu_find_format(formats, term->config);
        if (!format) {
-               if (verbose)
+               if (verbose > 0)
                        printf("Invalid event/parameter '%s'\n", term->config);
                if (err) {
                        char *pmu_term = pmu_formats_string(formats);
@@ -847,7 +847,7 @@ static int pmu_config_term(struct list_head *formats,
                val = term->val.num;
        } else if (term->type_val == PARSE_EVENTS__TERM_TYPE_STR) {
                if (strcmp(term->val.str, "?")) {
-                       if (verbose) {
+                       if (verbose > 0) {
                                pr_info("Invalid sysfs entry %s=%s\n",
                                                term->config, term->val.str);
                        }
@@ -1232,7 +1232,7 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag,
                        printf("%*s", 8, "[");
                        wordwrap(aliases[j].desc, 8, columns, 0);
                        printf("]\n");
-                       if (verbose)
+                       if (verbose > 0)
                                printf("%*s%s/%s/\n", 8, "", aliases[j].pmu, aliases[j].str);
                } else
                        printf("  %-50s [Kernel PMU event]\n", aliases[j].name);
index 35f5b7b7715c39e054591644d88b369bbf35de5e..28fb62c32678483cd6d54a9c88e620022e1f9d08 100644 (file)
@@ -594,7 +594,7 @@ static int find_perf_probe_point_from_dwarf(struct probe_trace_point *tp,
        pr_debug("try to find information at %" PRIx64 " in %s\n", addr,
                 tp->module ? : "kernel");
 
-       dinfo = debuginfo_cache__open(tp->module, verbose == 0);
+       dinfo = debuginfo_cache__open(tp->module, verbose <= 0);
        if (dinfo)
                ret = debuginfo__find_probe_point(dinfo,
                                                 (unsigned long)addr, pp);
index df622f4e301e2a2284ee5e728b09ade055680796..0ff622288d243c4edad03a904b6da3a52cf4da50 100644 (file)
@@ -151,7 +151,7 @@ static int64_t _sort__dso_cmp(struct map *map_l, struct map *map_r)
        if (!dso_l || !dso_r)
                return cmp_null(dso_r, dso_l);
 
-       if (verbose) {
+       if (verbose > 0) {
                dso_name_l = dso_l->long_name;
                dso_name_r = dso_r->long_name;
        } else {
@@ -172,8 +172,8 @@ static int _hist_entry__dso_snprintf(struct map *map, char *bf,
                                     size_t size, unsigned int width)
 {
        if (map && map->dso) {
-               const char *dso_name = !verbose ? map->dso->short_name :
-                       map->dso->long_name;
+               const char *dso_name = verbose > 0 ? map->dso->long_name :
+                       map->dso->short_name;
                return repsep_snprintf(bf, size, "%-*.*s", width, width, dso_name);
        }
 
@@ -261,7 +261,7 @@ static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym,
 {
        size_t ret = 0;
 
-       if (verbose) {
+       if (verbose > 0) {
                char o = map ? dso__symtab_origin(map->dso) : '!';
                ret += repsep_snprintf(bf, size, "%-#*llx %c ",
                                       BITS_PER_LONG / 4 + 2, ip, o);
index 39345c2ddfc22edcfde844e5eb95b72930f4eeda..0d51334a9b4628090f35ffe4da921b4e0ecb15b0 100644 (file)
@@ -344,7 +344,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
        for (i = 0; i < 3; i++)
                update_stats(&ps->res_stats[i], count[i]);
 
-       if (verbose) {
+       if (verbose > 0) {
                fprintf(config->output, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n",
                        perf_evsel__name(counter), count[0], count[1], count[2]);
        }
index adbc6c02c3aaac757028e6bbe1ae63cd11ee437a..4e59ddeb4eda7cd8e75ec2c0c42e1fec4de0432a 100644 (file)
@@ -213,7 +213,7 @@ static bool want_demangle(bool is_kernel_sym)
 
 static char *demangle_sym(struct dso *dso, int kmodule, const char *elf_name)
 {
-       int demangle_flags = verbose ? (DMGL_PARAMS | DMGL_ANSI) : DMGL_NO_OPTS;
+       int demangle_flags = verbose > 0 ? (DMGL_PARAMS | DMGL_ANSI) : DMGL_NO_OPTS;
        char *demangled = NULL;
 
        /*