Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1325629 > unrolled thread

[GIT PULL 00/29] perf/core improvements and fixes

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2016-02-03 17:40 +0100
Last post2016-02-04 09:00 +0100
Articles 10 on this page of 30 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [GIT PULL 00/29] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 25/29] perf hists: Introduce hists__for_each_format macro Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 01/29] perf hists: Factor output_resort from hists__output_resort Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 03/29] perf hists: Add _idx fields into struct perf_hpp_fmt Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 26/29] perf hists: Introduce hists__for_each_sort_list macro Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 23/29] perf hists: Add struct perf_hpp_list argument to helper functions Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 27/29] perf report: Update documentation of --sort option Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 20/29] perf hists: Introduce perf_hpp_list__for_each_format_safe macro Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 22/29] perf hists: Introduce perf_hpp_list__for_each_sort_list_safe macro Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 14/29] perf hists: Separate output fields parsing into setup_output_list function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 02/29] perf hists: Introduce perf_evsel__output_resort function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:40 +0100
    [PATCH 07/29] perf hists: Make hpp setup function generic Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 15/29] perf hists: Introduce struct perf_hpp_list Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 17/29] perf hists: Add perf_hpp_list register helpers Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 19/29] perf hists: Introduce perf_hpp_list__for_each_format macro Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 13/29] perf hists: Separate sort fields parsing into setup_sort_list function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 16/29] perf hists: Introduce perf_hpp_list__init function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 24/29] perf tools: Add hpp_list into struct hists object Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 12/29] perf hists: Properly release format fields Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 10/29] perf hists: Allocate output sort field Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 08/29] perf report: Move UI initialization ahead of sort setup Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 06/29] perf hists: Add 'hpp__equal' callback function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 21/29] perf hists: Introduce perf_hpp_list__for_each_sort_list macro Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 04/29] perf hists: Use struct perf_hpp_fmt::idx in perf_hpp__reset_width Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 11/29] perf hists: Remove perf_hpp__column_(disable|enable) Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 17:50 +0100
    [PATCH 18/29] perf hists: Pass perf_hpp_list all the way through setup_output_list Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 18:00 +0100
    [PATCH 28/29] perf report: Update documention of --percent-limit option Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 18:00 +0100
    [PATCH 09/29] perf top: Move UI initialization ahead of sort setup Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 18:00 +0100
    [PATCH 29/29] perf hists browser: Add 'L' hotkey to change percent limit Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-03 18:00 +0100
    Re: [GIT PULL 00/29] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-02-04 09:00 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1325668 — [PATCH 08/29] perf report: Move UI initialization ahead of sort setup

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 17:50 +0100
Subject[PATCH 08/29] perf report: Move UI initialization ahead of sort setup
Message-ID<qY8MY-4sb-61@gated-at.bofh.it>
In reply to#1325629
From: Jiri Olsa <jolsa@kernel.org>

The ui initialization changes hpp format callbacks, based on the used
browser. Thus we need this init being processed before setup_sorting.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-9-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-report.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 54ce0479ca28..1eab50ac1ef6 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -912,15 +912,6 @@ repeat:
 		symbol_conf.cumulate_callchain = false;
 	}
 
-	if (setup_sorting(session->evlist) < 0) {
-		if (sort_order)
-			parse_options_usage(report_usage, options, "s", 1);
-		if (field_order)
-			parse_options_usage(sort_order ? NULL : report_usage,
-					    options, "F", 1);
-		goto error;
-	}
-
 	/* Force tty output for header output and per-thread stat. */
 	if (report.header || report.header_only || report.show_threads)
 		use_browser = 0;
@@ -930,6 +921,15 @@ repeat:
 	else
 		use_browser = 0;
 
+	if (setup_sorting(session->evlist) < 0) {
+		if (sort_order)
+			parse_options_usage(report_usage, options, "s", 1);
+		if (field_order)
+			parse_options_usage(sort_order ? NULL : report_usage,
+					    options, "F", 1);
+		goto error;
+	}
+
 	if (report.header || report.header_only) {
 		perf_session__fprintf_info(session, stdout,
 					   report.show_full_info);
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325672 — [PATCH 06/29] perf hists: Add 'hpp__equal' callback function

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 17:50 +0100
Subject[PATCH 06/29] perf hists: Add 'hpp__equal' callback function
Message-ID<qY8MZ-4sb-69@gated-at.bofh.it>
In reply to#1325629
See http://www.infradead.org/rpr.html

From: Jiri Olsa <jolsa@kernel.org>

Adding 'hpp__equal' callback function to compare hpp output format
entries.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-7-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/hist.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 71c8bb71a350..b543f4b7d7d3 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -371,6 +371,19 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
 	return 0;
 }
 
+static bool perf_hpp__is_hpp_entry(struct perf_hpp_fmt *a)
+{
+	return a->header == hpp__header_fn;
+}
+
+static bool hpp__equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b)
+{
+	if (!perf_hpp__is_hpp_entry(a) || !perf_hpp__is_hpp_entry(b))
+		return false;
+
+	return a->idx == b->idx;
+}
+
 #define HPP__COLOR_PRINT_FNS(_name, _fn, _idx)		\
 	{						\
 		.name   = _name,			\
@@ -382,6 +395,7 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
 		.collapse = hpp__nop_cmp,		\
 		.sort	= hpp__sort_ ## _fn,		\
 		.idx	= PERF_HPP__ ## _idx,		\
+		.equal	= hpp__equal,			\
 	}
 
 #define HPP__COLOR_ACC_PRINT_FNS(_name, _fn, _idx)	\
@@ -395,6 +409,7 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
 		.collapse = hpp__nop_cmp,		\
 		.sort	= hpp__sort_ ## _fn,		\
 		.idx	= PERF_HPP__ ## _idx,		\
+		.equal	= hpp__equal,			\
 	}
 
 #define HPP__PRINT_FNS(_name, _fn, _idx)		\
@@ -407,6 +422,7 @@ static int64_t hpp__nop_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
 		.collapse = hpp__nop_cmp,		\
 		.sort	= hpp__sort_ ## _fn,		\
 		.idx	= PERF_HPP__ ## _idx,		\
+		.equal	= hpp__equal,			\
 	}
 
 struct perf_hpp_fmt perf_hpp__format[] = {
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325673 — [PATCH 21/29] perf hists: Introduce perf_hpp_list__for_each_sort_list macro

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 17:50 +0100
Subject[PATCH 21/29] perf hists: Introduce perf_hpp_list__for_each_sort_list macro
Message-ID<qY8MZ-4sb-71@gated-at.bofh.it>
In reply to#1325629
See http://www.infradead.org/rpr.html

From: Jiri Olsa <jolsa@kernel.org>

Introducing perf_hpp_list__for_each_sort_list macro to iterate
perf_hpp_list object's sort entries.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-22-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/hist.c   | 4 ++--
 tools/perf/util/hist.c | 6 +++---
 tools/perf/util/hist.h | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 348706a908f9..f09eabe18167 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -553,7 +553,7 @@ void perf_hpp__setup_output_field(void)
 	struct perf_hpp_fmt *fmt;
 
 	/* append sort keys to output field */
-	perf_hpp__for_each_sort_list(fmt) {
+	perf_hpp_list__for_each_sort_list(&perf_hpp_list, fmt) {
 		struct perf_hpp_fmt *pos;
 
 		perf_hpp_list__for_each_format(&perf_hpp_list, pos) {
@@ -575,7 +575,7 @@ void perf_hpp__append_sort_keys(void)
 	perf_hpp_list__for_each_format(&perf_hpp_list, fmt) {
 		struct perf_hpp_fmt *pos;
 
-		perf_hpp__for_each_sort_list(pos) {
+		perf_hpp_list__for_each_sort_list(&perf_hpp_list, pos) {
 			if (fmt_equal(fmt, pos))
 				goto next;
 		}
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index b762ecc31505..dea475d1fab0 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -961,7 +961,7 @@ hist_entry__cmp(struct hist_entry *left, struct hist_entry *right)
 	struct perf_hpp_fmt *fmt;
 	int64_t cmp = 0;
 
-	perf_hpp__for_each_sort_list(fmt) {
+	perf_hpp_list__for_each_sort_list(&perf_hpp_list, fmt) {
 		cmp = fmt->cmp(fmt, left, right);
 		if (cmp)
 			break;
@@ -976,7 +976,7 @@ hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
 	struct perf_hpp_fmt *fmt;
 	int64_t cmp = 0;
 
-	perf_hpp__for_each_sort_list(fmt) {
+	perf_hpp_list__for_each_sort_list(&perf_hpp_list, fmt) {
 		cmp = fmt->collapse(fmt, left, right);
 		if (cmp)
 			break;
@@ -1120,7 +1120,7 @@ static int hist_entry__sort(struct hist_entry *a, struct hist_entry *b)
 	struct perf_hpp_fmt *fmt;
 	int64_t cmp = 0;
 
-	perf_hpp__for_each_sort_list(fmt) {
+	perf_hpp_list__for_each_sort_list(&perf_hpp_list, fmt) {
 		if (perf_hpp__should_skip(fmt, a->hists))
 			continue;
 
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index f5b2309de16e..c9b2ea4a4929 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -254,8 +254,8 @@ static inline void perf_hpp__register_sort_field(struct perf_hpp_fmt *format)
 #define perf_hpp_list__for_each_format_safe(_list, format, tmp)	\
 	list_for_each_entry_safe(format, tmp, &(_list)->fields, list)
 
-#define perf_hpp__for_each_sort_list(format) \
-	list_for_each_entry(format, &perf_hpp_list.sorts, sort_list)
+#define perf_hpp_list__for_each_sort_list(_list, format) \
+	list_for_each_entry(format, &(_list)->sorts, sort_list)
 
 #define perf_hpp__for_each_sort_list_safe(format, tmp)	\
 	list_for_each_entry_safe(format, tmp, &perf_hpp_list.sorts, sort_list)
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325676 — [PATCH 04/29] perf hists: Use struct perf_hpp_fmt::idx in perf_hpp__reset_width

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 17:50 +0100
Subject[PATCH 04/29] perf hists: Use struct perf_hpp_fmt::idx in perf_hpp__reset_width
Message-ID<qY8MZ-4sb-77@gated-at.bofh.it>
In reply to#1325629
From: Jiri Olsa <jolsa@kernel.org>

We are going to add dynamic hpp format fields, so we need to make the
'len' change for the format itself, not in the perf_hpp__format
template.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/hist.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index d392801ea17e..5a11bf0aabc7 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -629,20 +629,12 @@ unsigned int hists__sort_list_width(struct hists *hists)
 
 void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists)
 {
-	int idx;
-
 	if (perf_hpp__is_sort_entry(fmt))
 		return perf_hpp__reset_sort_width(fmt, hists);
 
-	for (idx = 0; idx < PERF_HPP__MAX_INDEX; idx++) {
-		if (fmt == &perf_hpp__format[idx])
-			break;
-	}
-
-	if (idx == PERF_HPP__MAX_INDEX)
-		return;
+	BUG_ON(fmt->idx >= PERF_HPP__MAX_INDEX);
 
-	switch (idx) {
+	switch (fmt->idx) {
 	case PERF_HPP__OVERHEAD:
 	case PERF_HPP__OVERHEAD_SYS:
 	case PERF_HPP__OVERHEAD_US:
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325677 — [PATCH 11/29] perf hists: Remove perf_hpp__column_(disable|enable)

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 17:50 +0100
Subject[PATCH 11/29] perf hists: Remove perf_hpp__column_(disable|enable)
Message-ID<qY8MZ-4sb-79@gated-at.bofh.it>
In reply to#1325629
From: Jiri Olsa <jolsa@kernel.org>

Those functions are no longer needed. They operate over perf_hpp__format
array which is now used only as template for dynamic entries.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-11-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/hist.c   | 12 ------------
 tools/perf/util/hist.h |  2 --
 2 files changed, 14 deletions(-)

diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index c877c52ff4bc..80d63a997287 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -519,18 +519,6 @@ void perf_hpp__register_sort_field(struct perf_hpp_fmt *format)
 	list_add_tail(&format->sort_list, &perf_hpp__sort_list);
 }
 
-void perf_hpp__column_enable(unsigned col)
-{
-	BUG_ON(col >= PERF_HPP__MAX_INDEX);
-	perf_hpp__column_register(&perf_hpp__format[col]);
-}
-
-void perf_hpp__column_disable(unsigned col)
-{
-	BUG_ON(col >= PERF_HPP__MAX_INDEX);
-	perf_hpp__column_unregister(&perf_hpp__format[col]);
-}
-
 void perf_hpp__cancel_cumulate(void)
 {
 	struct perf_hpp_fmt *fmt, *acc, *ovh, *tmp;
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 9a240d7b8d3b..1f9e21dd53f3 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -259,8 +259,6 @@ enum {
 void perf_hpp__init(void);
 void perf_hpp__column_register(struct perf_hpp_fmt *format);
 void perf_hpp__column_unregister(struct perf_hpp_fmt *format);
-void perf_hpp__column_enable(unsigned col);
-void perf_hpp__column_disable(unsigned col);
 void perf_hpp__cancel_cumulate(void);
 
 void perf_hpp__register_sort_field(struct perf_hpp_fmt *format);
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325678 — [PATCH 18/29] perf hists: Pass perf_hpp_list all the way through setup_output_list

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 18:00 +0100
Subject[PATCH 18/29] perf hists: Pass perf_hpp_list all the way through setup_output_list
Message-ID<qY8WC-4vK-13@gated-at.bofh.it>
In reply to#1325629
See http://www.infradead.org/rpr.html

From: Jiri Olsa <jolsa@kernel.org>

Passing perf_hpp_list all the way through setup_output_list so the
output entry could be added on the arbitrary list.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-19-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 36dbd5554f0e..f643bed8f63b 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1616,14 +1616,15 @@ static int __sort_dimension__add_hpp_sort(struct sort_dimension *sd)
 	return 0;
 }
 
-static int __sort_dimension__add_hpp_output(struct sort_dimension *sd)
+static int __sort_dimension__add_hpp_output(struct perf_hpp_list *list,
+					    struct sort_dimension *sd)
 {
 	struct hpp_sort_entry *hse = __sort_dimension__alloc_hpp(sd);
 
 	if (hse == NULL)
 		return -1;
 
-	perf_hpp__column_register(&hse->hpp);
+	perf_hpp_list__column_register(list, &hse->hpp);
 	return 0;
 }
 
@@ -2117,19 +2118,21 @@ static int __hpp_dimension__add(struct hpp_dimension *hd)
 	return 0;
 }
 
-static int __sort_dimension__add_output(struct sort_dimension *sd)
+static int __sort_dimension__add_output(struct perf_hpp_list *list,
+					struct sort_dimension *sd)
 {
 	if (sd->taken)
 		return 0;
 
-	if (__sort_dimension__add_hpp_output(sd) < 0)
+	if (__sort_dimension__add_hpp_output(list, sd) < 0)
 		return -1;
 
 	sd->taken = 1;
 	return 0;
 }
 
-static int __hpp_dimension__add_output(struct hpp_dimension *hd)
+static int __hpp_dimension__add_output(struct perf_hpp_list *list,
+				       struct hpp_dimension *hd)
 {
 	struct perf_hpp_fmt *fmt;
 
@@ -2141,14 +2144,14 @@ static int __hpp_dimension__add_output(struct hpp_dimension *hd)
 		return -1;
 
 	hd->taken = 1;
-	perf_hpp__column_register(fmt);
+	perf_hpp_list__column_register(list, fmt);
 	return 0;
 }
 
 int hpp_dimension__add_output(unsigned col)
 {
 	BUG_ON(col >= PERF_HPP__MAX_INDEX);
-	return __hpp_dimension__add_output(&hpp_sort_dimensions[col]);
+	return __hpp_dimension__add_output(&perf_hpp_list, &hpp_sort_dimensions[col]);
 }
 
 static int sort_dimension__add(const char *tok,
@@ -2492,7 +2495,7 @@ void sort__setup_elide(FILE *output)
 	}
 }
 
-static int output_field_add(char *tok)
+static int output_field_add(struct perf_hpp_list *list, char *tok)
 {
 	unsigned int i;
 
@@ -2502,7 +2505,7 @@ static int output_field_add(char *tok)
 		if (strncasecmp(tok, sd->name, strlen(tok)))
 			continue;
 
-		return __sort_dimension__add_output(sd);
+		return __sort_dimension__add_output(list, sd);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(hpp_sort_dimensions); i++) {
@@ -2511,7 +2514,7 @@ static int output_field_add(char *tok)
 		if (strncasecmp(tok, hd->name, strlen(tok)))
 			continue;
 
-		return __hpp_dimension__add_output(hd);
+		return __hpp_dimension__add_output(list, hd);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(bstack_sort_dimensions); i++) {
@@ -2520,7 +2523,7 @@ static int output_field_add(char *tok)
 		if (strncasecmp(tok, sd->name, strlen(tok)))
 			continue;
 
-		return __sort_dimension__add_output(sd);
+		return __sort_dimension__add_output(list, sd);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(memory_sort_dimensions); i++) {
@@ -2529,20 +2532,20 @@ static int output_field_add(char *tok)
 		if (strncasecmp(tok, sd->name, strlen(tok)))
 			continue;
 
-		return __sort_dimension__add_output(sd);
+		return __sort_dimension__add_output(list, sd);
 	}
 
 	return -ESRCH;
 }
 
-static int setup_output_list(char *str)
+static int setup_output_list(struct perf_hpp_list *list, char *str)
 {
 	char *tmp, *tok;
 	int ret = 0;
 
 	for (tok = strtok_r(str, ", ", &tmp);
 			tok; tok = strtok_r(NULL, ", ", &tmp)) {
-		ret = output_field_add(tok);
+		ret = output_field_add(list, tok);
 		if (ret == -EINVAL) {
 			error("Invalid --fields key: `%s'", tok);
 			break;
@@ -2599,7 +2602,7 @@ static int __setup_output_field(void)
 		goto out;
 	}
 
-	ret = setup_output_list(strp);
+	ret = setup_output_list(&perf_hpp_list, strp);
 
 out:
 	free(str);
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325679 — [PATCH 28/29] perf report: Update documention of --percent-limit option

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 18:00 +0100
Subject[PATCH 28/29] perf report: Update documention of --percent-limit option
Message-ID<qY8WC-4vK-11@gated-at.bofh.it>
In reply to#1325629
See http://www.infradead.org/rpr.html

From: Namhyung Kim <namhyung@kernel.org>

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 1cb8fac596b1..89cab84e92fd 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.
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325685 — [PATCH 09/29] perf top: Move UI initialization ahead of sort setup

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 18:00 +0100
Subject[PATCH 09/29] perf top: Move UI initialization ahead of sort setup
Message-ID<qY8WD-4vK-31@gated-at.bofh.it>
In reply to#1325629
From: Arnaldo Carvalho de Melo <acme@redhat.com>

The ui initialization changes hpp format callbacks, based on the used
browser. Thus we need this init being processed before setup_sorting.

Replica of a patch by Jiri for 'perf report'.

Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-9-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-top.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index f1bbe2a589f5..a75de3940b97 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1245,6 +1245,13 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 	/* display thread wants entries to be collapsed in a different tree */
 	sort__need_collapse = 1;
 
+	if (top.use_stdio)
+		use_browser = 0;
+	else if (top.use_tui)
+		use_browser = 1;
+
+	setup_browser(false);
+
 	if (setup_sorting(top.evlist) < 0) {
 		if (sort_order)
 			parse_options_usage(top_usage, options, "s", 1);
@@ -1254,13 +1261,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 		goto out_delete_evlist;
 	}
 
-	if (top.use_stdio)
-		use_browser = 0;
-	else if (top.use_tui)
-		use_browser = 1;
-
-	setup_browser(false);
-
 	status = target__validate(target);
 	if (status) {
 		target__strerror(target, status, errbuf, BUFSIZ);
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1325686 — [PATCH 29/29] perf hists browser: Add 'L' hotkey to change percent limit

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-02-03 18:00 +0100
Subject[PATCH 29/29] perf hists browser: Add 'L' hotkey to change percent limit
Message-ID<qY8WD-4vK-37@gated-at.bofh.it>
In reply to#1325629
See http://www.infradead.org/rpr.html

From: Namhyung Kim <namhyung@kernel.org>

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 3a1e0965a8fd..a5a5390476ac 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.5.0

[toc] | [prev] | [next] | [standalone]


#1326466

FromIngo Molnar <mingo@kernel.org>
Date2016-02-04 09:00 +0100
Message-ID<qYmZB-5D0-11@gated-at.bofh.it>
In reply to#1325629
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:

> Hi Ingo,
> 
> 	Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 8eb22c984eb9eeaed47130f5679acd367af69678:
> 
>   Merge tag 'perf-core-for-mingo-3' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-02-03 11:02:37 +0100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
> 
> for you to fetch changes up to b62e8dfcda8cb133c062c0e1207afea2476eb7fd:
> 
>   perf hists browser: Add 'L' hotkey to change percent limit (2016-02-03 12:24:22 -0300)
> 
> ----------------------------------------------------------------
> perf/core improvements and fixes:
> 
> New features:
> 
> - Add 'L' hotkey to dynamicly set the percent threshold for histogram
>   entries and callchains, i.e. dynamicly do what the --percent-limit
>   command line option to 'top' and 'report' does. (Namhyung Kim)
> 
> Infrastructure:
> 
> - Per hists field and sort lists, that will be used, for instance,
>   in the c2c tool (Jiri Olsa)
> 
> Documentation:
> 
> - Update documentation of --sort and --perf-limit options
>   for 'perf report' (Namhyung Kim)
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
>       perf top: Move UI initialization ahead of sort setup
> 
> Jiri Olsa (25):
>       perf hists: Factor output_resort from hists__output_resort
>       perf hists: Introduce perf_evsel__output_resort function
>       perf hists: Add _idx fields into struct perf_hpp_fmt
>       perf hists: Use struct perf_hpp_fmt::idx in perf_hpp__reset_width
>       perf hists: Add 'equal' method to perf_hpp_fmt struct
>       perf hists: Add 'hpp__equal' callback function
>       perf hists: Make hpp setup function generic
>       perf report: Move UI initialization ahead of sort setup
>       perf hists: Allocate output sort field
>       perf hists: Remove perf_hpp__column_(disable|enable)
>       perf hists: Properly release format fields
>       perf hists: Separate sort fields parsing into setup_sort_list function
>       perf hists: Separate output fields parsing into setup_output_list function
>       perf hists: Introduce struct perf_hpp_list
>       perf hists: Introduce perf_hpp_list__init function
>       perf hists: Add perf_hpp_list register helpers
>       perf hists: Pass perf_hpp_list all the way through setup_output_list
>       perf hists: Introduce perf_hpp_list__for_each_format macro
>       perf hists: Introduce perf_hpp_list__for_each_format_safe macro
>       perf hists: Introduce perf_hpp_list__for_each_sort_list macro
>       perf hists: Introduce perf_hpp_list__for_each_sort_list_safe macro
>       perf hists: Add struct perf_hpp_list argument to helper functions
>       perf tools: Add hpp_list into struct hists object
>       perf hists: Introduce hists__for_each_format macro
>       perf hists: Introduce hists__for_each_sort_list macro
> 
> Namhyung Kim (3):
>       perf report: Update documentation of --sort option
>       perf report: Update documention of --percent-limit option
>       perf hists browser: Add 'L' hotkey to change percent limit
> 
>  tools/perf/Documentation/perf-report.txt |  37 +++---
>  tools/perf/builtin-annotate.c            |   2 +-
>  tools/perf/builtin-report.c              |  20 +--
>  tools/perf/builtin-top.c                 |  24 ++--
>  tools/perf/tests/hists_cumulate.c        |   2 +-
>  tools/perf/tests/hists_filter.c          |   2 +-
>  tools/perf/tests/hists_output.c          |  10 +-
>  tools/perf/ui/browsers/hists.c           |  63 +++++++++-
>  tools/perf/ui/gtk/hists.c                |   6 +-
>  tools/perf/ui/hist.c                     | 170 +++++++++++++------------
>  tools/perf/ui/stdio/hist.c               |   8 +-
>  tools/perf/util/hist.c                   |  47 +++++--
>  tools/perf/util/hist.h                   |  65 +++++++---
>  tools/perf/util/sort.c                   | 205 +++++++++++++++++++++----------
>  14 files changed, 425 insertions(+), 236 deletions(-)

Pulled, thanks a lot Arnaldo!

	Ingo

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web