linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: [PATCH 6/6] perf report: Do not collect sample histogram unnecessarily
Date: Tue,  9 Apr 2024 16:50:00 -0700	[thread overview]
Message-ID: <20240409235000.1893969-7-namhyung@kernel.org> (raw)
In-Reply-To: <20240409235000.1893969-1-namhyung@kernel.org>

The data type profiling alone doesn't need the sample histogram for
functions.  It only needs the histogram for the types.

Let's remove the condition in the report_callback to check the data type
profiling and make sure the annotation has the annotated_source before
calling symbol__disassemble().

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-report.c | 2 +-
 tools/perf/util/annotate.c  | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index aaa6427a1224..dafba6e030ef 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -172,7 +172,7 @@ static int hist_iter__report_callback(struct hist_entry_iter *iter,
 	struct mem_info *mi;
 	struct branch_info *bi;
 
-	if (!ui__has_annotation() && !rep->symbol_ipc && !rep->data_type)
+	if (!ui__has_annotation() && !rep->symbol_ipc)
 		return 0;
 
 	if (sort__mode == SORT_MODE__BRANCH) {
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 11da27801d88..7e034d2f2adb 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -908,6 +908,13 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
 
 	args.arch = arch;
 	args.ms = *ms;
+
+	if (notes->src == NULL) {
+		notes->src = annotated_source__new();
+		if (notes->src == NULL)
+			return -1;
+	}
+
 	if (annotate_opts.full_addr)
 		notes->src->start = map__objdump_2mem(ms->map, ms->sym->start);
 	else
-- 
2.44.0.478.gd926399ef9-goog


  parent reply	other threads:[~2024-04-09 23:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 23:49 [PATCHSET 0/6] perf annotate: Add TUI support for data type profiling (v1) Namhyung Kim
2024-04-09 23:49 ` [PATCH 1/6] perf annotate: Show progress of sample processing Namhyung Kim
2024-04-09 23:49 ` [PATCH 2/6] perf annotate-data: Add hist_entry__annotate_data_tty() Namhyung Kim
2024-04-09 23:49 ` [PATCH 3/6] perf annotate-data: Add hist_entry__annotate_data_tui() Namhyung Kim
2024-04-10 20:21   ` Arnaldo Carvalho de Melo
2024-04-10 21:04     ` Arnaldo Carvalho de Melo
2024-04-10 21:05       ` Arnaldo Carvalho de Melo
2024-04-10 21:12         ` Arnaldo Carvalho de Melo
2024-04-10 21:17           ` Arnaldo Carvalho de Melo
2024-04-10 21:20             ` Arnaldo Carvalho de Melo
2024-04-10 21:32               ` Arnaldo Carvalho de Melo
2024-04-10 23:49                 ` Namhyung Kim
2024-04-09 23:49 ` [PATCH 4/6] perf annotate-data: Support event group display in TUI Namhyung Kim
2024-04-10 19:52   ` Arnaldo Carvalho de Melo
2024-04-10 20:24   ` Arnaldo Carvalho de Melo
2024-04-10 20:38     ` Arnaldo Carvalho de Melo
2024-04-09 23:49 ` [PATCH 5/6] perf report: Add a menu item to annotate data type " Namhyung Kim
2024-04-10 20:46   ` Arnaldo Carvalho de Melo
2024-04-10 20:50     ` Arnaldo Carvalho de Melo
2024-04-11  0:30       ` Namhyung Kim
2024-04-09 23:50 ` Namhyung Kim [this message]
2024-04-10 16:29 ` [PATCHSET 0/6] perf annotate: Add TUI support for data type profiling (v1) Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240409235000.1893969-7-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).