All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] perf report: Update document of --sort option
@ 2016-02-03 14:11 Namhyung Kim
  2016-02-03 14:11 ` [PATCH 2/4] perf report: Update document of --percent-limit option Namhyung Kim
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Namhyung Kim @ 2016-02-03 14:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Andi Kleen, Stephane Eranian, Wang Nan

Description of the memory sort key (used by --mem-mode) was misplaced.
Move it under the --sort option so that it can be referenced properly.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/Documentation/perf-report.txt | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 8a301f6afb37..f6faec969e2e 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -117,6 +117,22 @@ OPTIONS
 	And default sort keys are changed to comm, dso_from, symbol_from, dso_to
 	and symbol_to, see '--branch-stack'.
 
+	If --mem-mode option is used, following sort keys are also available
+	(incompatible with --branch-stack):
+	symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.
+
+	- symbol_daddr: name of data symbol being executed on at the time of sample
+	- dso_daddr: name of library or module containing the data being executed
+	on at the time of sample
+	- locked: whether the bus was locked at the time of sample
+	- tlb: type of tlb access for the data at the time of sample
+	- mem: type of memory access for the data at the time of sample
+	- snoop: type of snoop (if any) for the data at the time of sample
+	- dcacheline: the cacheline the data address is on at the time of sample
+
+	And default sort keys are changed to local_weight, mem, sym, dso,
+	symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
+
 	If the data file has tracepoint event(s), following (dynamic) sort keys
 	are also available:
 	trace, trace_fields, [<event>.]<field>[/raw]
@@ -151,22 +167,6 @@ OPTIONS
 	By default, every sort keys not specified in -F will be appended
 	automatically.
 
-	If --mem-mode option is used, following sort keys are also available
-	(incompatible with --branch-stack):
-	symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.
-
-	- symbol_daddr: name of data symbol being executed on at the time of sample
-	- dso_daddr: name of library or module containing the data being executed
-	on at the time of sample
-	- locked: whether the bus was locked at the time of sample
-	- tlb: type of tlb access for the data at the time of sample
-	- mem: type of memory access for the data at the time of sample
-	- snoop: type of snoop (if any) for the data at the time of sample
-	- dcacheline: the cacheline the data address is on at the time of sample
-
-	And default sort keys are changed to local_weight, mem, sym, dso,
-	symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
-
 -p::
 --parent=<regex>::
         A regex filter to identify parent. The parent is a caller of this
-- 
2.7.0

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

* [PATCH 2/4] perf report: Update document of --percent-limit option
  2016-02-03 14:11 [PATCH 1/4] perf report: Update document of --sort option Namhyung Kim
@ 2016-02-03 14:11 ` Namhyung Kim
  2016-02-04 12:42   ` [tip:perf/core] perf report: Update documention " tip-bot for Namhyung Kim
  2016-02-03 14:11 ` [RFC/PATCH 3/4] perf tools: Change default calchain percent limit to 0.05% Namhyung Kim
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2016-02-03 14:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Andi Kleen, Stephane Eranian, Wang Nan

The --percent-limit option was changed to be applied to callchains as
well as hist entries recently, but it missed to update the doc.

Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/Documentation/perf-report.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index f6faec969e2e..369663b37361 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -351,7 +351,10 @@ OPTIONS
 
 --percent-limit::
 	Do not show entries which have an overhead under that percent.
-	(Default: 0).
+	(Default: 0).  Note that this option also sets percent limit (threshold)
+	of callchains at once.  However the default value of callchain threshold
+	is different than the default value of hist entries.  Please see
+	--call-graph option for details.
 
 --percentage::
 	Determine how to display the overhead percentage of filtered entries.
-- 
2.7.0

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

* [RFC/PATCH 3/4] perf tools: Change default calchain percent limit to 0.05%
  2016-02-03 14:11 [PATCH 1/4] perf report: Update document of --sort option Namhyung Kim
  2016-02-03 14:11 ` [PATCH 2/4] perf report: Update document of --percent-limit option Namhyung Kim
@ 2016-02-03 14:11 ` Namhyung Kim
  2016-02-03 14:11 ` [PATCH 4/4] perf hists browser: Add 'L' key to change percent limit Namhyung Kim
  2016-02-04 12:42 ` [tip:perf/core] perf report: Update documentation of --sort option tip-bot for Namhyung Kim
  3 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2016-02-03 14:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Andi Kleen, Stephane Eranian, Wang Nan

The current default limit of 0.5% is (mostly) for 'fractal' mode which
calculates the percentage relatively.  As we changed the default
callchain mode to 'graph', the existing limit is too high IMHO.
Normally there're many entries under 0.5% overhead, it'd be supprising
that they don't show callchains.

Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
changed from 0.005 -> 0.05

 tools/perf/Documentation/perf-report.txt | 2 +-
 tools/perf/builtin-report.c              | 2 +-
 tools/perf/builtin-top.c                 | 2 +-
 tools/perf/util/util.c                   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 369663b37361..7c7b6b6129f7 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -209,7 +209,7 @@ OPTIONS
 	- none: disable call chain display.
 
 	threshold is a percentage value which specifies a minimum percent to be
-	included in the output call graph.  Default is 0.5 (%).
+	included in the output call graph.  Default is 0.05 (%).
 
 	print_limit is only applied when stdio interface is used.  It's to limit
 	number of call graph entries in a single hist entry.  Note that it needs
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 72ed0b46d5a1..d7ad5333d50f 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -643,7 +643,7 @@ parse_percent_limit(const struct option *opt, const char *str,
 	return 0;
 }
 
-#define CALLCHAIN_DEFAULT_OPT  "graph,0.5,caller,function,percent"
+#define CALLCHAIN_DEFAULT_OPT  "graph,0.05,caller,function,percent"
 
 const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
 				     CALLCHAIN_REPORT_HELP
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index bf01cbb0ef23..f31cb78c92fb 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1086,7 +1086,7 @@ parse_percent_limit(const struct option *opt, const char *arg,
 }
 
 const char top_callchain_help[] = CALLCHAIN_RECORD_HELP CALLCHAIN_REPORT_HELP
-	"\n\t\t\t\tDefault: fp,graph,0.5,caller,function";
+	"\n\t\t\t\tDefault: fp,graph,0.05,caller,function";
 
 int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 {
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index b9e2843cfbe7..26b8f6c66d00 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -20,7 +20,7 @@
 
 struct callchain_param	callchain_param = {
 	.mode	= CHAIN_GRAPH_ABS,
-	.min_percent = 0.5,
+	.min_percent = 0.05,
 	.order  = ORDER_CALLEE,
 	.key	= CCKEY_FUNCTION,
 	.value	= CCVAL_PERCENT,
-- 
2.7.0

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

* [PATCH 4/4] perf hists browser: Add 'L' key to change percent limit
  2016-02-03 14:11 [PATCH 1/4] perf report: Update document of --sort option Namhyung Kim
  2016-02-03 14:11 ` [PATCH 2/4] perf report: Update document of --percent-limit option Namhyung Kim
  2016-02-03 14:11 ` [RFC/PATCH 3/4] perf tools: Change default calchain percent limit to 0.05% Namhyung Kim
@ 2016-02-03 14:11 ` Namhyung Kim
  2016-02-03 15:13   ` Arnaldo Carvalho de Melo
  2016-02-04 12:43   ` [tip:perf/core] perf hists browser: Add 'L' hotkey " tip-bot for Namhyung Kim
  2016-02-04 12:42 ` [tip:perf/core] perf report: Update documentation of --sort option tip-bot for Namhyung Kim
  3 siblings, 2 replies; 8+ messages in thread
From: Namhyung Kim @ 2016-02-03 14:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Andi Kleen, Stephane Eranian, Wang Nan

Add 'L' key action to change the percent limit applied to both of hist
entries and callchains.

Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/browsers/hists.c | 55 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 61d578bf4ffd..c6ae69716002 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2029,6 +2029,42 @@ static void hist_browser__update_nr_entries(struct hist_browser *hb)
 	hb->nr_non_filtered_entries = nr_entries;
 }
 
+static void hist_browser__update_percent_limit(struct hist_browser *hb,
+					       double percent)
+{
+	struct hist_entry *he;
+	struct rb_node *nd = rb_first(&hb->hists->entries);
+	u64 total = hists__total_period(hb->hists);
+	u64 min_callchain_hits = total * (percent / 100);
+
+	hb->min_pcnt = callchain_param.min_percent = percent;
+
+	if (!symbol_conf.use_callchain)
+		return;
+
+	while ((nd = hists__filter_entries(nd, hb->min_pcnt)) != NULL) {
+		he = rb_entry(nd, struct hist_entry, rb_node);
+
+		if (callchain_param.mode == CHAIN_GRAPH_REL) {
+			total = he->stat.period;
+
+			if (symbol_conf.cumulate_callchain)
+				total = he->stat_acc->period;
+
+			min_callchain_hits = total * (percent / 100);
+		}
+
+		callchain_param.sort(&he->sorted_chain, he->callchain,
+				     min_callchain_hits, &callchain_param);
+
+		/* force to re-evaluate folding state of callchains */
+		he->init_have_children = false;
+		hist_entry__set_folding(he, false);
+
+		nd = rb_next(nd);
+	}
+}
+
 static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 				    const char *helpline,
 				    bool left_exits,
@@ -2064,6 +2100,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 	"E             Expand all callchains\n"				\
 	"F             Toggle percentage of filtered entries\n"		\
 	"H             Display column headers\n"			\
+	"L             Change percent limit\n"				\
 	"m             Display context menu\n"				\
 	"S             Zoom into current Processor Socket\n"		\
 
@@ -2219,6 +2256,24 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 				top->zero = !top->zero;
 			}
 			continue;
+		case 'L':
+			if (ui_browser__input_window("Percent Limit",
+					"Please enter the value you want to hide entries under that percent.",
+					buf, "ENTER: OK, ESC: Cancel",
+					delay_secs * 2) == K_ENTER) {
+				char *end;
+				double new_percent = strtod(buf, &end);
+
+				if (new_percent < 0 || new_percent > 100) {
+					ui_browser__warning(&browser->b, delay_secs * 2,
+						"Invalid percent: %.2f", new_percent);
+					continue;
+				}
+
+				hist_browser__update_percent_limit(browser, new_percent);
+				hist_browser__reset(browser);
+			}
+			continue;
 		case K_F1:
 		case 'h':
 		case '?':
-- 
2.7.0

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

* Re: [PATCH 4/4] perf hists browser: Add 'L' key to change percent limit
  2016-02-03 14:11 ` [PATCH 4/4] perf hists browser: Add 'L' key to change percent limit Namhyung Kim
@ 2016-02-03 15:13   ` Arnaldo Carvalho de Melo
  2016-02-04 12:43   ` [tip:perf/core] perf hists browser: Add 'L' hotkey " tip-bot for Namhyung Kim
  1 sibling, 0 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-03 15:13 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Andi Kleen, Stephane Eranian, Wang Nan

Em Wed, Feb 03, 2016 at 11:11:23PM +0900, Namhyung Kim escreveu:
> Add 'L' key action to change the percent limit applied to both of hist
> entries and callchains.

Thanks a lot, works like a charm!

Applied,

- Arnaldo
 
> Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/ui/browsers/hists.c | 55 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
> 
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index 61d578bf4ffd..c6ae69716002 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -2029,6 +2029,42 @@ static void hist_browser__update_nr_entries(struct hist_browser *hb)
>  	hb->nr_non_filtered_entries = nr_entries;
>  }
>  
> +static void hist_browser__update_percent_limit(struct hist_browser *hb,
> +					       double percent)
> +{
> +	struct hist_entry *he;
> +	struct rb_node *nd = rb_first(&hb->hists->entries);
> +	u64 total = hists__total_period(hb->hists);
> +	u64 min_callchain_hits = total * (percent / 100);
> +
> +	hb->min_pcnt = callchain_param.min_percent = percent;
> +
> +	if (!symbol_conf.use_callchain)
> +		return;
> +
> +	while ((nd = hists__filter_entries(nd, hb->min_pcnt)) != NULL) {
> +		he = rb_entry(nd, struct hist_entry, rb_node);
> +
> +		if (callchain_param.mode == CHAIN_GRAPH_REL) {
> +			total = he->stat.period;
> +
> +			if (symbol_conf.cumulate_callchain)
> +				total = he->stat_acc->period;
> +
> +			min_callchain_hits = total * (percent / 100);
> +		}
> +
> +		callchain_param.sort(&he->sorted_chain, he->callchain,
> +				     min_callchain_hits, &callchain_param);
> +
> +		/* force to re-evaluate folding state of callchains */
> +		he->init_have_children = false;
> +		hist_entry__set_folding(he, false);
> +
> +		nd = rb_next(nd);
> +	}
> +}
> +
>  static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
>  				    const char *helpline,
>  				    bool left_exits,
> @@ -2064,6 +2100,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
>  	"E             Expand all callchains\n"				\
>  	"F             Toggle percentage of filtered entries\n"		\
>  	"H             Display column headers\n"			\
> +	"L             Change percent limit\n"				\
>  	"m             Display context menu\n"				\
>  	"S             Zoom into current Processor Socket\n"		\
>  
> @@ -2219,6 +2256,24 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
>  				top->zero = !top->zero;
>  			}
>  			continue;
> +		case 'L':
> +			if (ui_browser__input_window("Percent Limit",
> +					"Please enter the value you want to hide entries under that percent.",
> +					buf, "ENTER: OK, ESC: Cancel",
> +					delay_secs * 2) == K_ENTER) {
> +				char *end;
> +				double new_percent = strtod(buf, &end);
> +
> +				if (new_percent < 0 || new_percent > 100) {
> +					ui_browser__warning(&browser->b, delay_secs * 2,
> +						"Invalid percent: %.2f", new_percent);
> +					continue;
> +				}
> +
> +				hist_browser__update_percent_limit(browser, new_percent);
> +				hist_browser__reset(browser);
> +			}
> +			continue;
>  		case K_F1:
>  		case 'h':
>  		case '?':
> -- 
> 2.7.0

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

* [tip:perf/core] perf report: Update documentation of --sort option
  2016-02-03 14:11 [PATCH 1/4] perf report: Update document of --sort option Namhyung Kim
                   ` (2 preceding siblings ...)
  2016-02-03 14:11 ` [PATCH 4/4] perf hists browser: Add 'L' key to change percent limit Namhyung Kim
@ 2016-02-04 12:42 ` tip-bot for Namhyung Kim
  3 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Namhyung Kim @ 2016-02-04 12:42 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dsahern, hpa, namhyung, andi, acme, linux-kernel, wangnan0,
	eranian, jolsa, tglx, peterz, mingo

Commit-ID:  c6f5f6b662719ded53700deefec7dbc4227c9778
Gitweb:     http://git.kernel.org/tip/c6f5f6b662719ded53700deefec7dbc4227c9778
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Wed, 3 Feb 2016 23:11:20 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 3 Feb 2016 12:24:21 -0300

perf report: Update documentation of --sort option

The description of the memory sort key (used by --mem-mode) was
misplaced.  Move it under the --sort option so that it can be referenced
properly.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1454508683-5735-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-report.txt | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 8a301f6..1cb8fac 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -117,6 +117,22 @@ OPTIONS
 	And default sort keys are changed to comm, dso_from, symbol_from, dso_to
 	and symbol_to, see '--branch-stack'.
 
+	If the --mem-mode option is used, the following sort keys are also available
+	(incompatible with --branch-stack):
+	symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.
+
+	- symbol_daddr: name of data symbol being executed on at the time of sample
+	- dso_daddr: name of library or module containing the data being executed
+	on at the time of the sample
+	- locked: whether the bus was locked at the time of the sample
+	- tlb: type of tlb access for the data at the time of the sample
+	- mem: type of memory access for the data at the time of the sample
+	- snoop: type of snoop (if any) for the data at the time of the sample
+	- dcacheline: the cacheline the data address is on at the time of the sample
+
+	And the default sort keys are changed to local_weight, mem, sym, dso,
+	symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
+
 	If the data file has tracepoint event(s), following (dynamic) sort keys
 	are also available:
 	trace, trace_fields, [<event>.]<field>[/raw]
@@ -151,22 +167,6 @@ OPTIONS
 	By default, every sort keys not specified in -F will be appended
 	automatically.
 
-	If --mem-mode option is used, following sort keys are also available
-	(incompatible with --branch-stack):
-	symbol_daddr, dso_daddr, locked, tlb, mem, snoop, dcacheline.
-
-	- symbol_daddr: name of data symbol being executed on at the time of sample
-	- dso_daddr: name of library or module containing the data being executed
-	on at the time of sample
-	- locked: whether the bus was locked at the time of sample
-	- tlb: type of tlb access for the data at the time of sample
-	- mem: type of memory access for the data at the time of sample
-	- snoop: type of snoop (if any) for the data at the time of sample
-	- dcacheline: the cacheline the data address is on at the time of sample
-
-	And default sort keys are changed to local_weight, mem, sym, dso,
-	symbol_daddr, dso_daddr, snoop, tlb, locked, see '--mem-mode'.
-
 -p::
 --parent=<regex>::
         A regex filter to identify parent. The parent is a caller of this

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

* [tip:perf/core] perf report: Update documention of --percent-limit option
  2016-02-03 14:11 ` [PATCH 2/4] perf report: Update document of --percent-limit option Namhyung Kim
@ 2016-02-04 12:42   ` tip-bot for Namhyung Kim
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Namhyung Kim @ 2016-02-04 12:42 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, mingo, namhyung, hpa, andi, acme, peterz, tglx,
	linux-kernel, wangnan0, jolsa, eranian, dsahern

Commit-ID:  1ba2fc6de4ac1a87e3ece65651795760ea5cf658
Gitweb:     http://git.kernel.org/tip/1ba2fc6de4ac1a87e3ece65651795760ea5cf658
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Wed, 3 Feb 2016 23:11:21 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 3 Feb 2016 12:24:21 -0300

perf report: Update documention of --percent-limit option

The --percent-limit option was changed to be applied to callchains as
well as to hist entries recently, but it missed to update the doc.

Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1454508683-5735-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-report.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 1cb8fac..89cab84 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -351,7 +351,10 @@ OPTIONS
 
 --percent-limit::
 	Do not show entries which have an overhead under that percent.
-	(Default: 0).
+	(Default: 0).  Note that this option also sets the percent limit (threshold)
+	of callchains.  However the default value of callchain threshold is
+	different than the default value of hist entries.  Please see the
+	--call-graph option for details.
 
 --percentage::
 	Determine how to display the overhead percentage of filtered entries.

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

* [tip:perf/core] perf hists browser: Add 'L' hotkey to change percent limit
  2016-02-03 14:11 ` [PATCH 4/4] perf hists browser: Add 'L' key to change percent limit Namhyung Kim
  2016-02-03 15:13   ` Arnaldo Carvalho de Melo
@ 2016-02-04 12:43   ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot for Namhyung Kim @ 2016-02-04 12:43 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, dsahern, jolsa, namhyung, andi, linux-kernel, acme,
	wangnan0, tglx, acme, peterz, mingo, eranian

Commit-ID:  b62e8dfcda8cb133c062c0e1207afea2476eb7fd
Gitweb:     http://git.kernel.org/tip/b62e8dfcda8cb133c062c0e1207afea2476eb7fd
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Wed, 3 Feb 2016 23:11:23 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 3 Feb 2016 12:24:22 -0300

perf hists browser: Add 'L' hotkey to change percent limit

Add 'L' key action to change the percent limit applied to both of hist
entries and callchains.

Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1454508683-5735-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 55 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 3a1e096..a5a5390 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2029,6 +2029,42 @@ static void hist_browser__update_nr_entries(struct hist_browser *hb)
 	hb->nr_non_filtered_entries = nr_entries;
 }
 
+static void hist_browser__update_percent_limit(struct hist_browser *hb,
+					       double percent)
+{
+	struct hist_entry *he;
+	struct rb_node *nd = rb_first(&hb->hists->entries);
+	u64 total = hists__total_period(hb->hists);
+	u64 min_callchain_hits = total * (percent / 100);
+
+	hb->min_pcnt = callchain_param.min_percent = percent;
+
+	if (!symbol_conf.use_callchain)
+		return;
+
+	while ((nd = hists__filter_entries(nd, hb->min_pcnt)) != NULL) {
+		he = rb_entry(nd, struct hist_entry, rb_node);
+
+		if (callchain_param.mode == CHAIN_GRAPH_REL) {
+			total = he->stat.period;
+
+			if (symbol_conf.cumulate_callchain)
+				total = he->stat_acc->period;
+
+			min_callchain_hits = total * (percent / 100);
+		}
+
+		callchain_param.sort(&he->sorted_chain, he->callchain,
+				     min_callchain_hits, &callchain_param);
+
+		/* force to re-evaluate folding state of callchains */
+		he->init_have_children = false;
+		hist_entry__set_folding(he, false);
+
+		nd = rb_next(nd);
+	}
+}
+
 static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 				    const char *helpline,
 				    bool left_exits,
@@ -2064,6 +2100,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 	"E             Expand all callchains\n"				\
 	"F             Toggle percentage of filtered entries\n"		\
 	"H             Display column headers\n"			\
+	"L             Change percent limit\n"				\
 	"m             Display context menu\n"				\
 	"S             Zoom into current Processor Socket\n"		\
 
@@ -2219,6 +2256,24 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 				top->zero = !top->zero;
 			}
 			continue;
+		case 'L':
+			if (ui_browser__input_window("Percent Limit",
+					"Please enter the value you want to hide entries under that percent.",
+					buf, "ENTER: OK, ESC: Cancel",
+					delay_secs * 2) == K_ENTER) {
+				char *end;
+				double new_percent = strtod(buf, &end);
+
+				if (new_percent < 0 || new_percent > 100) {
+					ui_browser__warning(&browser->b, delay_secs * 2,
+						"Invalid percent: %.2f", new_percent);
+					continue;
+				}
+
+				hist_browser__update_percent_limit(browser, new_percent);
+				hist_browser__reset(browser);
+			}
+			continue;
 		case K_F1:
 		case 'h':
 		case '?':

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

end of thread, other threads:[~2016-02-04 12:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 14:11 [PATCH 1/4] perf report: Update document of --sort option Namhyung Kim
2016-02-03 14:11 ` [PATCH 2/4] perf report: Update document of --percent-limit option Namhyung Kim
2016-02-04 12:42   ` [tip:perf/core] perf report: Update documention " tip-bot for Namhyung Kim
2016-02-03 14:11 ` [RFC/PATCH 3/4] perf tools: Change default calchain percent limit to 0.05% Namhyung Kim
2016-02-03 14:11 ` [PATCH 4/4] perf hists browser: Add 'L' key to change percent limit Namhyung Kim
2016-02-03 15:13   ` Arnaldo Carvalho de Melo
2016-02-04 12:43   ` [tip:perf/core] perf hists browser: Add 'L' hotkey " tip-bot for Namhyung Kim
2016-02-04 12:42 ` [tip:perf/core] perf report: Update documentation of --sort option tip-bot for Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.