diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 29f4751a357431ed5b8144e3375876c18aa3cc37..6da8d083e4e596d821673ed7408c814723029aca 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -1065,7 +1065,7 @@ static void __print_page_alloc_result(struct perf_session *session, int n_lines) data = rb_entry(next, struct page_stat, node); sym = machine__find_kernel_function(machine, data->callsite, &map); - if (sym && sym->name) + if (sym) caller = sym->name; else scnprintf(buf, sizeof(buf), "%"PRIx64, data->callsite); @@ -1107,7 +1107,7 @@ static void __print_page_caller_result(struct perf_session *session, int n_lines data = rb_entry(next, struct page_stat, node); sym = machine__find_kernel_function(machine, data->callsite, &map); - if (sym && sym->name) + if (sym) caller = sym->name; else scnprintf(buf, sizeof(buf), "%"PRIx64, data->callsite); diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index daceb320220052593be3e393ece54ddf190d3d01..270eb2d8ca6b24bb6b7c74ff0b068417e655d8e7 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -2067,7 +2067,7 @@ static void save_task_callchain(struct perf_sched *sched, break; sym = node->sym; - if (sym && sym->name) { + if (sym) { if (!strcmp(sym->name, "schedule") || !strcmp(sym->name, "__schedule") || !strcmp(sym->name, "preempt_schedule")) diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c index 6b2925542c0a641d92ca15db702a43fbe15946c4..4ef5184819a0975d592aecff5204d9d273494b4f 100644 --- a/tools/perf/util/evsel_fprintf.c +++ b/tools/perf/util/evsel_fprintf.c @@ -168,7 +168,6 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment, if (symbol_conf.bt_stop_list && node->sym && - node->sym->name && strlist__has_entry(symbol_conf.bt_stop_list, node->sym->name)) { break; diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 747a034d1ff33df5844b083aa51b12886e5c8692..a1043cf9b89c819235af2ff7df903d8cbf79c212 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1565,7 +1565,7 @@ int machine__process_event(struct machine *machine, union perf_event *event, static bool symbol__match_regex(struct symbol *sym, regex_t *regex) { - if (sym->name && !regexec(regex, sym->name, 0, NULL, 0)) + if (!regexec(regex, sym->name, 0, NULL, 0)) return 1; return 0; } diff --git a/tools/perf/util/symbol_fprintf.c b/tools/perf/util/symbol_fprintf.c index 7c6b33e8e2d24d250379700703088afb332a9fa9..63694e174e5c3c2ff9828fa14577f524cdb70f91 100644 --- a/tools/perf/util/symbol_fprintf.c +++ b/tools/perf/util/symbol_fprintf.c @@ -21,7 +21,7 @@ size_t __symbol__fprintf_symname_offs(const struct symbol *sym, unsigned long offset; size_t length; - if (sym && sym->name) { + if (sym) { length = fprintf(fp, "%s", sym->name); if (al && print_offsets) { if (al->addr < sym->end)