Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf hists browser: Dynamically change verbosity level

Here is a small patch which tries to fulfill a point in the perf todo
list:

* Make pressing 'V' multiple times to go on cycling thru various
verbosity levels in 'perf top', so that info that is present in
'perf top -v' can be obtained without having to restart the tool
(acme).

After a small grep in the code, the max verbosity level seems 3; so,
we cycle at 4; I did not dare define a MAX_VERBOSE_LEVEL constant.

Signed-off-by: Alexis Berlemont <alexis.berlemont@gmail.com>
Suggested-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20161012214823.14324-2-alexis.berlemont@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Alexis Berlemont and committed by
Arnaldo Carvalho de Melo
21e8c810 042cfb5f

+16 -6
+4 -1
tools/perf/ui/browsers/hists.c
··· 2807 2807 do_zoom_dso(browser, actions); 2808 2808 continue; 2809 2809 case 'V': 2810 - browser->show_dso = !browser->show_dso; 2810 + verbose = (verbose + 1) % 4; 2811 + browser->show_dso = verbose > 0; 2812 + ui_helpline__fpush("Verbosity level set to %d\n", 2813 + verbose); 2811 2814 continue; 2812 2815 case 't': 2813 2816 actions->thread = thread;
+12 -5
tools/perf/util/map.c
··· 682 682 continue; 683 683 684 684 if (verbose >= 2) { 685 - fputs("overlapping maps:\n", fp); 686 - map__fprintf(map, fp); 687 - map__fprintf(pos, fp); 685 + 686 + if (use_browser) { 687 + pr_warning("overlapping maps in %s " 688 + "(disable tui for more info)\n", 689 + map->dso->name); 690 + } else { 691 + fputs("overlapping maps:\n", fp); 692 + map__fprintf(map, fp); 693 + map__fprintf(pos, fp); 694 + } 688 695 } 689 696 690 697 rb_erase_init(&pos->rb_node, root); ··· 709 702 710 703 before->end = map->start; 711 704 __map_groups__insert(pos->groups, before); 712 - if (verbose >= 2) 705 + if (verbose >= 2 && !use_browser) 713 706 map__fprintf(before, fp); 714 707 map__put(before); 715 708 } ··· 724 717 725 718 after->start = map->end; 726 719 __map_groups__insert(pos->groups, after); 727 - if (verbose >= 2) 720 + if (verbose >= 2 && !use_browser) 728 721 map__fprintf(after, fp); 729 722 map__put(after); 730 723 }