From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754067AbbK0HoL (ORCPT ); Fri, 27 Nov 2015 02:44:11 -0500 Received: from terminus.zytor.com ([198.137.202.10]:42365 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751304AbbK0HoF (ORCPT ); Fri, 27 Nov 2015 02:44:05 -0500 Date: Thu, 26 Nov 2015 23:43:07 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: linux-kernel@vger.kernel.org, dsahern@gmail.com, kan.liang@intel.com, hpa@zytor.com, wangnan0@huawei.com, acme@redhat.com, namhyung@kernel.org, jolsa@kernel.org, fweisbec@gmail.com, a.p.zijlstra@chello.nl, andi@firstfloor.org, tglx@linutronix.de, mingo@kernel.org Reply-To: hpa@zytor.com, wangnan0@huawei.com, acme@redhat.com, namhyung@kernel.org, kan.liang@intel.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, mingo@kernel.org, tglx@linutronix.de, a.p.zijlstra@chello.nl, andi@firstfloor.org, fweisbec@gmail.com, jolsa@kernel.org In-Reply-To: <1448521700-32062-3-git-send-email-namhyung@kernel.org> References: <1448521700-32062-3-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf callchain: Honor hide_unresolved Git-Commit-ID: b49a8fe52626814968b9a9d27d7ad1cadc5532ed X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b49a8fe52626814968b9a9d27d7ad1cadc5532ed Gitweb: http://git.kernel.org/tip/b49a8fe52626814968b9a9d27d7ad1cadc5532ed Author: Namhyung Kim AuthorDate: Thu, 26 Nov 2015 16:08:20 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 26 Nov 2015 13:19:39 -0300 perf callchain: Honor hide_unresolved If user requested to hide unresolved entries, skip unresolved callchains as well as hist entries. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Kan Liang Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1448521700-32062-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 7 +++---- tools/perf/util/machine.c | 5 +++++ tools/perf/util/symbol.h | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 1442834..8a9c690 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -45,7 +45,6 @@ struct report { struct perf_tool tool; struct perf_session *session; bool use_tui, use_gtk, use_stdio; - bool hide_unresolved; bool dont_use_callchains; bool show_full_info; bool show_threads; @@ -146,7 +145,7 @@ static int process_sample_event(struct perf_tool *tool, struct hist_entry_iter iter = { .evsel = evsel, .sample = sample, - .hide_unresolved = rep->hide_unresolved, + .hide_unresolved = symbol_conf.hide_unresolved, .add_entry_cb = hist_iter__report_callback, }; int ret = 0; @@ -157,7 +156,7 @@ static int process_sample_event(struct perf_tool *tool, return -1; } - if (rep->hide_unresolved && al.sym == NULL) + if (symbol_conf.hide_unresolved && al.sym == NULL) goto out_put; if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap)) @@ -740,7 +739,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) OPT_STRING_NOEMPTY('t', "field-separator", &symbol_conf.field_sep, "separator", "separator for columns, no spaces will be added between " "columns '.' is reserved."), - OPT_BOOLEAN('U', "hide-unresolved", &report.hide_unresolved, + OPT_BOOLEAN('U', "hide-unresolved", &symbol_conf.hide_unresolved, "Only display entries resolved to a symbol"), OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", "Look for files with symbols relative to this directory"), diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 7f5071a..f0019b7 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1618,6 +1618,8 @@ static int add_callchain_ip(struct thread *thread, } } + if (symbol_conf.hide_unresolved && al.sym == NULL) + return 0; return callchain_cursor_append(&callchain_cursor, al.addr, al.map, al.sym); } @@ -1872,6 +1874,9 @@ check_calls: static int unwind_entry(struct unwind_entry *entry, void *arg) { struct callchain_cursor *cursor = arg; + + if (symbol_conf.hide_unresolved && entry->sym == NULL) + return 0; return callchain_cursor_append(cursor, entry->ip, entry->map, entry->sym); } diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index dcd786e..857f707 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -108,7 +108,8 @@ struct symbol_conf { show_hist_headers, branch_callstack, has_filter, - show_ref_callgraph; + show_ref_callgraph, + hide_unresolved; const char *vmlinux_name, *kallsyms_name, *source_prefix,