linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf report: Switch data file correctly in TUI
@ 2025-02-11  6:07 Namhyung Kim
  2025-02-11  6:07 ` [PATCH 2/2] perf report: Support switching data w/ and w/o callchains Namhyung Kim
  2025-02-20 18:26 ` [PATCH 1/2] perf report: Switch data file correctly in TUI Namhyung Kim
  0 siblings, 2 replies; 3+ messages in thread
From: Namhyung Kim @ 2025-02-11  6:07 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Dmitry Vyukov, James Clark

The 's' key is to switch to a new data file and load the data in the
same window.  The switch_data_file() will show a popup menu to select
which data file user wants and update the 'input_name' global variable.

But in the cmd_report(), it didn't update the data.path using the new
'input_name' and keep usng the old file.  This is fairly an old bug and
I assume people don't use this feature much. :)

Closes: https://lore.kernel.org/linux-perf-users/89e678bc-f0af-4929-a8a6-a2666f1294a4@linaro.org
Fixes: f5fc14124c5cefdd ("perf tools: Add data object to handle perf data file")
Reported-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f5fbd670d619a32a..c99b14a852dbdfbb 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1553,12 +1553,12 @@ int cmd_report(int argc, const char **argv)
 			input_name = "perf.data";
 	}
 
+repeat:
 	data.path  = input_name;
 	data.force = symbol_conf.force;
 
 	symbol_conf.skip_empty = report.skip_empty;
 
-repeat:
 	perf_tool__init(&report.tool, ordered_events);
 	report.tool.sample		 = process_sample_event;
 	report.tool.mmap		 = perf_event__process_mmap;
-- 
2.48.1.502.g6dc24dfdaf-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] perf report: Support switching data w/ and w/o callchains
  2025-02-11  6:07 [PATCH 1/2] perf report: Switch data file correctly in TUI Namhyung Kim
@ 2025-02-11  6:07 ` Namhyung Kim
  2025-02-20 18:26 ` [PATCH 1/2] perf report: Switch data file correctly in TUI Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2025-02-11  6:07 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Dmitry Vyukov, James Clark

The symbol_conf.use_callchain should be reset when switching to new data
file, otherwise report__setup_sample_type() will show an error message
that it enabled callchains but no callchain data.  The function also
will turn on the callchains if the data has PERF_SAMPLE_CALLCHAIN so I
think it's ok to reset symbol_conf.use_callchain here.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-report.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index c99b14a852dbdfbb..e7a7e9df1b42b3a7 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1826,6 +1826,11 @@ int cmd_report(int argc, const char **argv)
 	if (ret == K_SWITCH_INPUT_DATA || ret == K_RELOAD) {
 		perf_session__delete(session);
 		last_key = K_SWITCH_INPUT_DATA;
+		/*
+		 * To support switching between data with and without callchains.
+		 * report__setup_sample_type() will update it properly.
+		 */
+		symbol_conf.use_callchain = false;
 		goto repeat;
 	} else
 		ret = 0;
-- 
2.48.1.502.g6dc24dfdaf-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] perf report: Switch data file correctly in TUI
  2025-02-11  6:07 [PATCH 1/2] perf report: Switch data file correctly in TUI Namhyung Kim
  2025-02-11  6:07 ` [PATCH 2/2] perf report: Support switching data w/ and w/o callchains Namhyung Kim
@ 2025-02-20 18:26 ` Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2025-02-20 18:26 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang, Namhyung Kim
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Dmitry Vyukov, James Clark

On Mon, 10 Feb 2025 22:07:44 -0800, Namhyung Kim wrote:
> The 's' key is to switch to a new data file and load the data in the
> same window.  The switch_data_file() will show a popup menu to select
> which data file user wants and update the 'input_name' global variable.
> 
> But in the cmd_report(), it didn't update the data.path using the new
> 'input_name' and keep usng the old file.  This is fairly an old bug and
> I assume people don't use this feature much. :)
> 
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-20 18:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11  6:07 [PATCH 1/2] perf report: Switch data file correctly in TUI Namhyung Kim
2025-02-11  6:07 ` [PATCH 2/2] perf report: Support switching data w/ and w/o callchains Namhyung Kim
2025-02-20 18:26 ` [PATCH 1/2] perf report: Switch data file correctly in TUI Namhyung Kim

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).