diff options
author | Alexis Berlemont <alexis.berlemont@gmail.com> | 2016-10-12 17:48:23 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-10-24 10:07:42 -0400 |
commit | 21e8c81095cdbbde9d2aba8fffc51cb9b5e0eeaa (patch) | |
tree | 7794155f0af8bdf9b083bba61c6cc5437cedba3f /tools | |
parent | 042cfb5fa6225ed4b04fd1051b3de16f260a9c67 (diff) |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 5 | ||||
-rw-r--r-- | tools/perf/util/map.c | 17 |
2 files changed, 16 insertions, 6 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 31d6d5a7c2dc..ddc4c3e59cc1 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -2807,7 +2807,10 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
2807 | do_zoom_dso(browser, actions); | 2807 | do_zoom_dso(browser, actions); |
2808 | continue; | 2808 | continue; |
2809 | case 'V': | 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 | continue; | 2814 | continue; |
2812 | case 't': | 2815 | case 't': |
2813 | actions->thread = thread; | 2816 | actions->thread = thread; |
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index c662fef95d14..4f9a71c63026 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -682,9 +682,16 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp | |||
682 | continue; | 682 | continue; |
683 | 683 | ||
684 | if (verbose >= 2) { | 684 | if (verbose >= 2) { |
685 | fputs("overlapping maps:\n", fp); | 685 | |
686 | map__fprintf(map, fp); | 686 | if (use_browser) { |
687 | map__fprintf(pos, fp); | 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 | rb_erase_init(&pos->rb_node, root); | 697 | rb_erase_init(&pos->rb_node, root); |
@@ -702,7 +709,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp | |||
702 | 709 | ||
703 | before->end = map->start; | 710 | before->end = map->start; |
704 | __map_groups__insert(pos->groups, before); | 711 | __map_groups__insert(pos->groups, before); |
705 | if (verbose >= 2) | 712 | if (verbose >= 2 && !use_browser) |
706 | map__fprintf(before, fp); | 713 | map__fprintf(before, fp); |
707 | map__put(before); | 714 | map__put(before); |
708 | } | 715 | } |
@@ -717,7 +724,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp | |||
717 | 724 | ||
718 | after->start = map->end; | 725 | after->start = map->end; |
719 | __map_groups__insert(pos->groups, after); | 726 | __map_groups__insert(pos->groups, after); |
720 | if (verbose >= 2) | 727 | if (verbose >= 2 && !use_browser) |
721 | map__fprintf(after, fp); | 728 | map__fprintf(after, fp); |
722 | map__put(after); | 729 | map__put(after); |
723 | } | 730 | } |