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


Groups > linux.kernel > #1318303 > unrolled thread

[PATCH 00/26] perf/core improvements and fixes

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2016-01-26 20:30 +0100
Last post2016-01-26 20:40 +0100
Articles 6 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/26] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 20:30 +0100
    [PATCH 15/26] perf hists browser: Only offer symbol scripting when a symbol is under the cursor Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 20:30 +0100
    [PATCH 10/26] perf config: Document 'buildid.dir' variable in man page Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 20:40 +0100
    [PATCH 08/26] perf config: Document variables for 'colors' section in man page Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 20:40 +0100
    [PATCH 07/26] perf annotate: Rename 'colors.code' to 'colors.jump_arrows' Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 20:40 +0100
    [PATCH 09/26] perf config: Document variables for 'tui' and 'gtk' sections in man page Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-26 20:40 +0100

#1318303 — [PATCH 00/26] perf/core improvements and fixes

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-01-26 20:30 +0100
Subject[PATCH 00/26] perf/core improvements and fixes
Message-ID<qVhjH-cn-9@gated-at.bofh.it>
Hi Ingo,

	Please consider pulling, this is on top of the perf-urgent-for-mingo
branch I sent you today.

- Arnaldo

The following changes since commit 3f416f22d1e21709a631189ba169f76fd267b374:

  perf stat: Do not clean event's private stats (2016-01-26 11:15:11 -0300)

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 5ac76283b32b116c58e362e99542182ddcfc8262:

  perf cpumap: Auto initialize cpu__max_{node,cpu} (2016-01-26 16:08:36 -0300)

----------------------------------------------------------------
perf/core improvements and fixes:

User visible:

- Rename the "colors.code" ~/.perfconfig variable to "colors.jump_arrows",
  as it controls just the that UI element in the annotate browser (Taeung Song)

- Avoid trying to read ELF symtabs from device files, noticed while doing
  memory profiling work (Jiri Olsa)

- Improve context detection when offering options in the hists browser,
  i.e.  some options don't make sense when the browser is not working with
  a perf.data file ('perf top' mode), only in 'perf report' mode, like
  scripting (Namhyung Kim)

Infrastructure:

- Elliminate duplication in the hists browser filter functions, getting the
  common part into a function that receives callbacks for filtering by
  DSO, thread, etc (Namhyung Kim)

- Fix misleadingly indented assignment, found using
  gcc6 -Wmisleading-indentation (Markus Trippelsdorf)

- Handle LLVM relocation oddities in libbpf, introducing a 'perf test' that
  detects such problems and then fixing the problem, so that the test now
  passes (Wang Nan)

- More improvements to the build infrastructure to allow reusing the
  feature detection facilities (Wang Nan)

- Auto initialize the globals needed by cpu__max_{cpu,node}() routines
  (Arnaldo Carvalho de Melo)

Documentation:

- Document the perf sysctls in Documentation/sysctl/kernel.txt (Ben Hutchings)

- Document a bunch more ~/.perfconfig knobs (Taeung Song)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (3):
      perf machine: Introduce machine__find_kernel_symbol_by_name()
      perf test: Fixup aliases checking in the 'vmlinux matches kallsyms' test
      perf cpumap: Auto initialize cpu__max_{node,cpu}

Ben Hutchings (1):
      perf tools: Document the perf sysctls

Jiri Olsa (2):
      perf symbols: Do not read symbols/data from device files
      perf stat: Making several helper functions static

Markus Trippelsdorf (1):
      perf pmu: Fix misleadingly indented assignment (whitespace)

Namhyung Kim (9):
      perf hists: Remove parent filter check in DSO filter function
      perf hists: Cleanup filtering functions
      perf sort: Provide a way to find out if per-thread bucketing is in place
      perf hists browser: Only 'Zoom into thread' only when sort order has 'pid'
      perf hists browser: Only offer symbol scripting when a symbol is under the cursor
      perf hists browser: Offer 'Zoom into DSO'/'Map details' only when sort order has 'dso'
      perf hists browser: Be a bit more strict about presenting CPU socket zoom
      perf hists browser: Offer non-symbol specific menu options for --sort without 'sym'
      perf hists browser: Skip scripting when perf.data file not available

Taeung Song (6):
      perf annotate: Rename 'colors.code' to 'colors.jump_arrows'
      perf config: Document variables for 'colors' section in man page
      perf config: Document variables for 'tui' and 'gtk' sections in man page
      perf config: Document 'buildid.dir' variable in man page
      perf config: Document variables for 'annotate' section in man page
      perf config: Document 'hist.percentage' variable in man page

Wang Nan (4):
      perf test: Add libbpf relocation checker
      perf bpf: Check relocation target section
      tools build: Allow subprojects select all feature checkers
      perf build: Select all feature checkers for feature-dump

 Documentation/sysctl/kernel.txt               |  13 ++
 tools/build/Makefile.feature                  |  21 ++-
 tools/lib/bpf/libbpf.c                        |  34 +++--
 tools/perf/Documentation/perf-config.txt      | 200 +++++++++++++++++++++++++-
 tools/perf/Documentation/perfconfig.example   |   2 +-
 tools/perf/Makefile.perf                      |  11 +-
 tools/perf/tests/.gitignore                   |   1 +
 tools/perf/tests/Build                        |   9 +-
 tools/perf/tests/bpf-script-test-relocation.c |  50 +++++++
 tools/perf/tests/bpf.c                        |  26 +++-
 tools/perf/tests/llvm.c                       |  17 ++-
 tools/perf/tests/llvm.h                       |   5 +-
 tools/perf/tests/vmlinux-kallsyms.c           |  24 +---
 tools/perf/ui/browser.c                       |   4 +-
 tools/perf/ui/browser.h                       |   2 +-
 tools/perf/ui/browsers/annotate.c             |   2 +-
 tools/perf/ui/browsers/hists.c                |  38 ++---
 tools/perf/util/cpumap.c                      |  30 ++++
 tools/perf/util/cpumap.h                      |  32 +----
 tools/perf/util/dso.c                         |   5 +
 tools/perf/util/evsel.c                       |  15 +-
 tools/perf/util/hist.c                        |  92 ++++--------
 tools/perf/util/machine.h                     |  10 ++
 tools/perf/util/pmu.c                         |   2 +-
 tools/perf/util/sort.c                        |   3 +
 tools/perf/util/sort.h                        |   2 +
 tools/perf/util/stat.c                        |  14 +-
 tools/perf/util/stat.h                        |  10 --
 tools/perf/util/symbol.c                      |   6 +-
 tools/perf/util/util.c                        |  10 ++
 tools/perf/util/util.h                        |   1 +
 31 files changed, 507 insertions(+), 184 deletions(-)
 create mode 100644 tools/perf/tests/bpf-script-test-relocation.c

[toc] | [next] | [standalone]


#1318310 — [PATCH 15/26] perf hists browser: Only offer symbol scripting when a symbol is under the cursor

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-01-26 20:30 +0100
Subject[PATCH 15/26] perf hists browser: Only offer symbol scripting when a symbol is under the cursor
Message-ID<qVhtr-gQ-93@gated-at.bofh.it>
In reply to#1318303
From: Namhyung Kim <namhyung@kernel.org>

When this feature was introduced a check was made if there was a
resolved symbol under the cursor, it got lost in commit ea7cd5923309
("perf hists browser: Split popup menu actions - part 2"), reinstate it.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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>
Fixes: ea7cd5923309 ("perf hists browser: Split popup menu actions - part 2")
Link: http://lkml.kernel.org/r/1452960197-5323-9-git-send-email-namhyung@kernel.org
[ Carved out from a  larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index e66b3a30dd9f..2801d80c6903 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2322,10 +2322,12 @@ skip_annotation:
 			 *
 			 * See hist_browser__show_entry.
 			 */
-			nr_options += add_script_opt(browser,
-						     &actions[nr_options],
-						     &options[nr_options],
-						     NULL, browser->selection->sym);
+			if (sort__has_sym && browser->selection->sym) {
+				nr_options += add_script_opt(browser,
+							     &actions[nr_options],
+							     &options[nr_options],
+							     NULL, browser->selection->sym);
+			}
 		}
 		nr_options += add_script_opt(browser, &actions[nr_options],
 					     &options[nr_options], NULL, NULL);
-- 
2.5.0

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


#1318311 — [PATCH 10/26] perf config: Document 'buildid.dir' variable in man page

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-01-26 20:40 +0100
Subject[PATCH 10/26] perf config: Document 'buildid.dir' variable in man page
Message-ID<qVhD3-nw-1@gated-at.bofh.it>
In reply to#1318303
From: Taeung Song <treeze.taeung@gmail.com>

Explain 'buildid.dir' variable.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-4-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-config.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index ccbdb64696a7..a095f0cabf5e 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -154,6 +154,21 @@ tui.*, gtk.*::
 	will make the TUI be the default for the 'top' subcommand. Those will be
 	available if the required libs were detected at tool build time.
 
+buildid.*::
+	buildid.dir::
+		Each executable and shared library in modern distributions comes with a
+		content based identifier that, if available, will be inserted in a
+		'perf.data' file header to, at analysis time find what is needed to do
+		symbol resolution, code annotation, etc.
+
+		The recording tools also stores a hard link or copy in a per-user
+		directory, $HOME/.debug/, of binaries, shared libraries, /proc/kallsyms
+		and /proc/kcore files to be used at analysis time.
+
+		The buildid.dir variable can be used to either change this directory
+		cache location, or to disable it altogether. If you want to disable it,
+		set buildid.dir to /dev/null. The default is $HOME/.debug
+
 SEE ALSO
 --------
 linkperf:perf[1]
-- 
2.5.0

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


#1318315 — [PATCH 08/26] perf config: Document variables for 'colors' section in man page

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-01-26 20:40 +0100
Subject[PATCH 08/26] perf config: Document variables for 'colors' section in man page
Message-ID<qVhD4-nw-19@gated-at.bofh.it>
In reply to#1318303
From: Taeung Song <treeze.taeung@gmail.com>

Explain 'colors' section and its variables, used for The variables for
customizing the colors used in the output for the 'report', 'top' and
'annotate' in the TUI, those are:

'top', 'medium', 'normal', 'selected',
'jump_arrows', 'addr' and 'root'.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-config.txt | 46 ++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index 1ee488b9aaf7..80517823b7e5 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -98,6 +98,52 @@ Given a $HOME/.perfconfig like this:
 		order = caller
 		sort-key = function
 
+Variables
+~~~~~~~~~
+
+colors.*::
+	The variables for customizing the colors used in the output for the
+	'report', 'top' and 'annotate' in the TUI. They should specify the
+	foreground and background colors, separated by a comma, for example:
+
+		medium = green, lightgray
+
+	If you want to use the color configured for you terminal, just leave it
+	as 'default', for example:
+
+		medium = default, lightgray
+
+	Available colors:
+	red, yellow, green, cyan, gray, black, blue,
+	white, default, magenta, lightgray
+
+	colors.top::
+		'top' means a overhead percentage which is more than 5%.
+		And values of this variable specify percentage colors.
+		Basic key values are foreground-color 'red' and
+		background-color 'default'.
+	colors.medium::
+		'medium' means a overhead percentage which has more than 0.5%.
+		Default values are 'green' and 'default'.
+	colors.normal::
+		'normal' means the rest of overhead percentages
+		except 'top', 'medium', 'selected'.
+		Default values are 'lightgray' and 'default'.
+	colors.selected::
+		This selects the colors for the current entry in a list of entries
+		from sub-commands (top, report, annotate).
+		Default values are 'black' and 'lightgray'.
+	colors.jump_arrows::
+		Colors for jump arrows on assembly code listings
+		such as 'jns', 'jmp', 'jane', etc.
+		Default values are 'blue', 'default'.
+	colors.addr::
+		This selects colors for addresses from 'annotate'.
+		Default values are 'magenta', 'default'.
+	colors.root::
+		Colors for headers in the output of a sub-commands (top, report).
+		Default values are 'white', 'blue'.
+
 SEE ALSO
 --------
 linkperf:perf[1]
-- 
2.5.0

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


#1318316 — [PATCH 07/26] perf annotate: Rename 'colors.code' to 'colors.jump_arrows'

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-01-26 20:40 +0100
Subject[PATCH 07/26] perf annotate: Rename 'colors.code' to 'colors.jump_arrows'
Message-ID<qVhD4-nw-25@gated-at.bofh.it>
In reply to#1318303
From: Taeung Song <treeze.taeung@gmail.com>

USe 'jump_arrows' config name instead of 'code' on 'colors' section.
'colors.code' config is only for jump arrows on assembly code listings
i.e.

    │     ┌──jmp    1333
    │     │  xchg   %ax,%ax
    │     │  mov    %r15,%r10
    │     └─→cmp    %r15,%r14

But this config name seems unfit.

 'jump_arrows' is more descriptive than 'code'.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452240971-25418-1-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-config.txt    | 2 +-
 tools/perf/Documentation/perfconfig.example | 2 +-
 tools/perf/ui/browser.c                     | 4 ++--
 tools/perf/ui/browser.h                     | 2 +-
 tools/perf/ui/browsers/annotate.c           | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index b9ca1e304158..1ee488b9aaf7 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -62,7 +62,7 @@ Given a $HOME/.perfconfig like this:
 		medium = green, default
 		normal = lightgray, default
 		selected = white, lightgray
-		code = blue, default
+		jump_arrows = blue, default
 		addr = magenta, default
 		root = white, blue
 
diff --git a/tools/perf/Documentation/perfconfig.example b/tools/perf/Documentation/perfconfig.example
index 767ea2436e1c..1d8d5bc4cd2d 100644
--- a/tools/perf/Documentation/perfconfig.example
+++ b/tools/perf/Documentation/perfconfig.example
@@ -5,7 +5,7 @@
 	medium = green, lightgray
 	normal = black, lightgray
 	selected = lightgray, magenta
-	code = blue, lightgray
+	jump_arrows = blue, lightgray
 	addr = magenta, lightgray
 
 [tui]
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index d37202121689..af68a9d488bf 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -531,8 +531,8 @@ static struct ui_browser_colorset {
 		.bg	  = "yellow",
 	},
 	{
-		.colorset = HE_COLORSET_CODE,
-		.name	  = "code",
+		.colorset = HE_COLORSET_JUMP_ARROWS,
+		.name	  = "jump_arrows",
 		.fg	  = "blue",
 		.bg	  = "default",
 	},
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h
index 01781de59532..be3b70eb5fca 100644
--- a/tools/perf/ui/browser.h
+++ b/tools/perf/ui/browser.h
@@ -7,7 +7,7 @@
 #define HE_COLORSET_MEDIUM	51
 #define HE_COLORSET_NORMAL	52
 #define HE_COLORSET_SELECTED	53
-#define HE_COLORSET_CODE	54
+#define HE_COLORSET_JUMP_ARROWS	54
 #define HE_COLORSET_ADDR	55
 #define HE_COLORSET_ROOT	56
 
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 718bd46d47fa..4fc208e82c6f 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -284,7 +284,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
 		to = (u64)btarget->idx;
 	}
 
-	ui_browser__set_color(browser, HE_COLORSET_CODE);
+	ui_browser__set_color(browser, HE_COLORSET_JUMP_ARROWS);
 	__ui_browser__line_arrow(browser, pcnt_width + 2 + ab->addr_width,
 				 from, to);
 }
-- 
2.5.0

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


#1318318 — [PATCH 09/26] perf config: Document variables for 'tui' and 'gtk' sections in man page

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-01-26 20:40 +0100
Subject[PATCH 09/26] perf config: Document variables for 'tui' and 'gtk' sections in man page
Message-ID<qVhD5-nw-33@gated-at.bofh.it>
In reply to#1318303
From: Taeung Song <treeze.taeung@gmail.com>

Explain 'tui' and 'gtk' sections and these variables.

'top', 'report' and 'annotate'

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1452253193-30502-3-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-config.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index 80517823b7e5..ccbdb64696a7 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -144,6 +144,16 @@ colors.*::
 		Colors for headers in the output of a sub-commands (top, report).
 		Default values are 'white', 'blue'.
 
+tui.*, gtk.*::
+	Subcommands that can be configured here are 'top', 'report' and 'annotate'.
+	These values are booleans, for example:
+
+	[tui]
+		top = true
+
+	will make the TUI be the default for the 'top' subcommand. Those will be
+	available if the required libs were detected at tool build time.
+
 SEE ALSO
 --------
 linkperf:perf[1]
-- 
2.5.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web