linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: dynamically change verbosity level in perf top
@ 2016-10-12 21:48 Alexis Berlemont
  2016-10-12 21:48 ` Alexis Berlemont
  2016-10-14 15:49 ` [PATCH] perf: dynamically change verbosity level in perf top Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 4+ messages in thread
From: Alexis Berlemont @ 2016-10-12 21:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, peterz, mingo, acme, alexander.shishkin

Hi,

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.

Alexis.

Alexis Berlemont (1):
  perf: dynamically change verbosity level in perf top

 tools/perf/ui/browsers/hists.c |  5 ++++-
 tools/perf/util/map.c          | 17 ++++++++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)

-- 
2.10.0

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

* [PATCH] perf: dynamically change verbosity level in perf top
  2016-10-12 21:48 [PATCH] perf: dynamically change verbosity level in perf top Alexis Berlemont
@ 2016-10-12 21:48 ` Alexis Berlemont
  2016-10-24 19:03   ` [tip:perf/core] perf hists browser: Dynamically change verbosity level tip-bot for Alexis Berlemont
  2016-10-14 15:49 ` [PATCH] perf: dynamically change verbosity level in perf top Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 4+ messages in thread
From: Alexis Berlemont @ 2016-10-12 21:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alexis Berlemont, peterz, mingo, acme, alexander.shishkin

Signed-off-by: Alexis Berlemont <alexis.berlemont@gmail.com>
---
 tools/perf/ui/browsers/hists.c |  5 ++++-
 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 fb8e42c..6016909 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2806,7 +2806,10 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 			do_zoom_dso(browser, actions);
 			continue;
 		case 'V':
-			browser->show_dso = !browser->show_dso;
+			verbose = (verbose + 1) % 4;
+			browser->show_dso = verbose > 0;
+			ui_helpline__fpush("Verbosity level set to %d\n",
+					   verbose);
 			continue;
 		case 't':
 			actions->thread = thread;
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index c662fef..4f9a71c 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
 			continue;
 
 		if (verbose >= 2) {
-			fputs("overlapping maps:\n", fp);
-			map__fprintf(map, fp);
-			map__fprintf(pos, fp);
+
+			if (use_browser) {
+				pr_warning("overlapping maps in %s "
+					   "(disable tui for more info)\n",
+					   map->dso->name);
+			} else {
+				fputs("overlapping maps:\n", fp);
+				map__fprintf(map, fp);
+				map__fprintf(pos, fp);
+			}
 		}
 
 		rb_erase_init(&pos->rb_node, root);
@@ -702,7 +709,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp
 
 			before->end = map->start;
 			__map_groups__insert(pos->groups, before);
-			if (verbose >= 2)
+			if (verbose >= 2 && !use_browser)
 				map__fprintf(before, fp);
 			map__put(before);
 		}
@@ -717,7 +724,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp
 
 			after->start = map->end;
 			__map_groups__insert(pos->groups, after);
-			if (verbose >= 2)
+			if (verbose >= 2 && !use_browser)
 				map__fprintf(after, fp);
 			map__put(after);
 		}
-- 
2.10.0

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

* Re: [PATCH] perf: dynamically change verbosity level in perf top
  2016-10-12 21:48 [PATCH] perf: dynamically change verbosity level in perf top Alexis Berlemont
  2016-10-12 21:48 ` Alexis Berlemont
@ 2016-10-14 15:49 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-10-14 15:49 UTC (permalink / raw)
  To: Alexis Berlemont; +Cc: linux-kernel, peterz, mingo, alexander.shishkin

Em Wed, Oct 12, 2016 at 11:48:22PM +0200, Alexis Berlemont escreveu:
> Hi,
> 
> 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.
 
Works like a charm, thanks for doing this, feel free to go over other
entries in that list :-)

I made changes only in the cset log message, adding the text you wrote
above and adding a:

Suggested-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Thanks!

- Arnaldo

> Alexis.
> 
> Alexis Berlemont (1):
>   perf: dynamically change verbosity level in perf top
> 
>  tools/perf/ui/browsers/hists.c |  5 ++++-
>  tools/perf/util/map.c          | 17 ++++++++++++-----
>  2 files changed, 16 insertions(+), 6 deletions(-)
> 
> -- 
> 2.10.0

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

* [tip:perf/core] perf hists browser: Dynamically change verbosity level
  2016-10-12 21:48 ` Alexis Berlemont
@ 2016-10-24 19:03   ` tip-bot for Alexis Berlemont
  0 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Alexis Berlemont @ 2016-10-24 19:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, acme, mingo, peterz, hpa, linux-kernel, alexander.shishkin,
	alexis.berlemont

Commit-ID:  21e8c81095cdbbde9d2aba8fffc51cb9b5e0eeaa
Gitweb:     http://git.kernel.org/tip/21e8c81095cdbbde9d2aba8fffc51cb9b5e0eeaa
Author:     Alexis Berlemont <alexis.berlemont@gmail.com>
AuthorDate: Wed, 12 Oct 2016 23:48:23 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 24 Oct 2016 11:07:42 -0300

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>
---
 tools/perf/ui/browsers/hists.c |  5 ++++-
 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 31d6d5a..ddc4c3e 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,
 			do_zoom_dso(browser, actions);
 			continue;
 		case 'V':
-			browser->show_dso = !browser->show_dso;
+			verbose = (verbose + 1) % 4;
+			browser->show_dso = verbose > 0;
+			ui_helpline__fpush("Verbosity level set to %d\n",
+					   verbose);
 			continue;
 		case 't':
 			actions->thread = thread;
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index c662fef..4f9a71c 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
 			continue;
 
 		if (verbose >= 2) {
-			fputs("overlapping maps:\n", fp);
-			map__fprintf(map, fp);
-			map__fprintf(pos, fp);
+
+			if (use_browser) {
+				pr_warning("overlapping maps in %s "
+					   "(disable tui for more info)\n",
+					   map->dso->name);
+			} else {
+				fputs("overlapping maps:\n", fp);
+				map__fprintf(map, fp);
+				map__fprintf(pos, fp);
+			}
 		}
 
 		rb_erase_init(&pos->rb_node, root);
@@ -702,7 +709,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp
 
 			before->end = map->start;
 			__map_groups__insert(pos->groups, before);
-			if (verbose >= 2)
+			if (verbose >= 2 && !use_browser)
 				map__fprintf(before, fp);
 			map__put(before);
 		}
@@ -717,7 +724,7 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp
 
 			after->start = map->end;
 			__map_groups__insert(pos->groups, after);
-			if (verbose >= 2)
+			if (verbose >= 2 && !use_browser)
 				map__fprintf(after, fp);
 			map__put(after);
 		}

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

end of thread, other threads:[~2016-10-24 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12 21:48 [PATCH] perf: dynamically change verbosity level in perf top Alexis Berlemont
2016-10-12 21:48 ` Alexis Berlemont
2016-10-24 19:03   ` [tip:perf/core] perf hists browser: Dynamically change verbosity level tip-bot for Alexis Berlemont
2016-10-14 15:49 ` [PATCH] perf: dynamically change verbosity level in perf top Arnaldo Carvalho de Melo

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