[1/2] perf hists browser: Fix hierarchy mode header

Message ID 20230731094934.1616495-1-namhyung@kernel.org
State New
Headers
Series [1/2] perf hists browser: Fix hierarchy mode header |

Commit Message

Namhyung Kim July 31, 2023, 9:49 a.m. UTC
  The commit ef9ff6017e3c4 ("perf ui browser: Move the extra title lines
from the hists browser") introduced ui_browser__gotorc_title() to help
moving non-title lines easily.  But it missed to update the title for
the hierarchy mode so it won't print the header line on TUI at all.

  $ perf report --hierarchy

Fixes: ef9ff6017e3c4 ("perf ui browser: Move the extra title lines from the hists browser")
Cc: stable@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/browsers/hists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Arnaldo Carvalho de Melo Aug. 3, 2023, 1:35 p.m. UTC | #1
Em Mon, Jul 31, 2023 at 02:49:32AM -0700, Namhyung Kim escreveu:
> The commit ef9ff6017e3c4 ("perf ui browser: Move the extra title lines
> from the hists browser") introduced ui_browser__gotorc_title() to help
> moving non-title lines easily.  But it missed to update the title for
> the hierarchy mode so it won't print the header line on TUI at all.
> 
>   $ perf report --hierarchy

Thanks, tested and applied.

- Arnaldo

 
> Fixes: ef9ff6017e3c4 ("perf ui browser: Move the extra title lines from the hists browser")
> Cc: stable@vger.kernel.org
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/ui/browsers/hists.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index c7ad9e003080..d8b88f10a48d 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -1779,7 +1779,7 @@ static void hists_browser__hierarchy_headers(struct hist_browser *browser)
>  	hists_browser__scnprintf_hierarchy_headers(browser, headers,
>  						   sizeof(headers));
>  
> -	ui_browser__gotorc(&browser->b, 0, 0);
> +	ui_browser__gotorc_title(&browser->b, 0, 0);
>  	ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
>  	ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1);
>  }
> -- 
> 2.41.0.487.g6d72f3e995-goog
>
  

Patch

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index c7ad9e003080..d8b88f10a48d 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1779,7 +1779,7 @@  static void hists_browser__hierarchy_headers(struct hist_browser *browser)
 	hists_browser__scnprintf_hierarchy_headers(browser, headers,
 						   sizeof(headers));
 
-	ui_browser__gotorc(&browser->b, 0, 0);
+	ui_browser__gotorc_title(&browser->b, 0, 0);
 	ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
 	ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1);
 }