Skip to contentSkip to conversation

perf/core improvements and fixes

GIT PULL New Arnaldo Carvalho de Melo 2 participants 15 messages Aug 12, 2015 – Aug 13, 2015 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

Hi Ingo,

Please consider applying,

- Arnaldo

The following changes since commit 5f1230c9b80b89f404938ff88dfa64a963f74f2c:

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-08-12 12:16:11 +0200)

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 71ef150ee06df29c5b427307dc0bacfe06a8baea:

perf tests: Add tests to callgraph and time parse (2015-08-12 13:20:29 -0300)

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

User visible:

- Allow selecting the type of callchains per event, including disabling callchains in all but one entry in an event list, to save space, and also to ask for the callchains collected in one event to be used in other events (Kan Liang)

- Beautify more syscall arguments in 'perf trace': (Arnaldo Carvalho de Melo)
- A bunch more translate file/pathnames from pointers to strings
- Convert numbers to strings for the 'keyctl' syscall 'option' arg.
- Add missing 'clockid' entries

- Fix 'perf probe -L sys_*' as it was not showing all the source code for syscall functions in the kernel (Masami Hiramatsu)

- Make ESC unzoom as well in the hists browser, i.e. in 'report' and 'top', as we're considering repurposing the right and left arrow keys to use in horizontal scrolling, i.e. leave just ESC to be used for what <- works now, and ENTER for what -> does (they are already aliases for ages) (Arnaldo Carvalho de Melo)

Infrastructure fixes:

- Check for SRCLINE_UNKNOWN case in "srcfile" processing (Andi Kleen)

- Wrap the slsmg_{printf,write_nstring} slang functions behing ui_browser, so that we can make the ui_browser based browsers (annotate, menus, hists, etc) UI library agnostic and usable with multiple backends (slang now, GTK+ and others in the future, maybe) (Arnaldo Carvalho de Melo)

----------------------------------------------------------------
Andi Kleen (1):
perf sort: Check for SRCLINE_UNKNOWN case in "srcfile" processing

Arnaldo Carvalho de Melo (7):
perf trace: Associate some more syscall args with the getname beautifier perf trace: Add missing clockid entries
perf trace: Use the FD beautifier for socket syscall fds perf trace: Beautify keyctl's option arg
perf ui browser: Introduce ui_browser__write_nstring()
perf ui browser: Introduce ui_browser__printf()
perf hists browser: Make ESC unzoom as well

Kan Liang (4):
perf callchain: Per-event type selection support perf callchain: Allow disabling call graphs per event perf report: Show call graph from reference events perf tests: Add tests to callgraph and time parse

Masami Hiramatsu (1):
perf probe: Fix to show lines of sys_ functions correctly

 tools/perf/Documentation/perf-record.txt |  4 ++
 tools/perf/Documentation/perf-report.txt | 11 ++++++
 tools/perf/builtin-annotate.c            |  2 +
 tools/perf/builtin-diff.c                |  3 ++
 tools/perf/builtin-report.c              |  7 ++++
 tools/perf/builtin-trace.c               | 54 +++++++++++++++++++------
 tools/perf/tests/hists_cumulate.c        |  4 ++
 tools/perf/tests/parse-events.c          | 38 ++++++++++++++++++
 tools/perf/ui/browser.c                  | 17 +++++++-
 tools/perf/ui/browser.h                  |  3 ++
 tools/perf/ui/browsers/annotate.c        | 43 ++++++++++----------
 tools/perf/ui/browsers/header.c          |  2 +-
 tools/perf/ui/browsers/hists.c           | 54 ++++++++++++-------------
 tools/perf/ui/browsers/map.c             | 11 +++---
 tools/perf/ui/browsers/scripts.c         |  2 +-
 tools/perf/ui/libslang.h                 |  3 ++
 tools/perf/ui/tui/util.c                 |  2 +-
 tools/perf/util/dwarf-aux.c              | 18 ++++++---
 tools/perf/util/evsel.c                  | 67 +++++++++++++++++++++++++++++++-
 tools/perf/util/evsel.h                  |  4 ++
 tools/perf/util/hist.c                   | 14 +++++--
 tools/perf/util/parse-events.c           | 12 ++++++
 tools/perf/util/parse-events.h           |  2 +
 tools/perf/util/parse-events.l           |  2 +
 tools/perf/util/pmu.c                    |  4 +-
 tools/perf/util/sort.c                   |  2 +
 tools/perf/util/symbol.h                 |  3 +-
 27 files changed, 307 insertions(+), 81 deletions(-)
author maintainer
#1 lore raw

PATCH 1/13 perf trace: Associate some more syscall args with the getname beautifier

From: Arnaldo Carvalho de Melo <[email protected]>

This time using 'trinity' to test these:

fchmodat, futimesat, llistxattr, lremovexattr, lstat, mknodat, mq_unlink, stat and vmsplice.

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Milian Wolff <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-trace.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
tools/perf/builtin-trace.c +18 -5
index a25048c85b76..7cdcbee642b9 100644
@@ -1014,7 +1014,8 @@ static struct syscall_fmt {
 	{ .name	    = "fchmod",	    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FD, /* fd */ }, },
 	{ .name	    = "fchmodat",   .errmsg = true,
-	  .arg_scnprintf = { [0] = SCA_FDAT, /* fd */ }, },
+	  .arg_scnprintf = { [0] = SCA_FDAT, /* fd */
+			     [1] = SCA_FILENAME, /* filename */ }, },
 	{ .name	    = "fchown",	    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FD, /* fd */ }, },
 	{ .name	    = "fchownat",   .errmsg = true,
@@ -1045,7 +1046,8 @@ static struct syscall_fmt {
 	{ .name	    = "futex",	    .errmsg = true,
 	  .arg_scnprintf = { [1] = SCA_FUTEX_OP, /* op */ }, },
 	{ .name	    = "futimesat", .errmsg = true,
-	  .arg_scnprintf = { [0] = SCA_FDAT, /* fd */ }, },
+	  .arg_scnprintf = { [0] = SCA_FDAT, /* fd */
+			     [1] = SCA_FILENAME, /* filename */ }, },
 	{ .name	    = "getdents",   .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FD, /* fd */ }, },
 	{ .name	    = "getdents64", .errmsg = true,
@@ -1078,13 +1080,18 @@ static struct syscall_fmt {
 	  .arg_scnprintf = { [0] = SCA_FDAT, /* fd */ }, },
 	{ .name	    = "listxattr",  .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
+	{ .name	    = "llistxattr", .errmsg = true,
+	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
+	{ .name	    = "lremovexattr",  .errmsg = true,
+	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
 	{ .name	    = "lseek",	    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FD, /* fd */
 			     [2] = SCA_STRARRAY, /* whence */ },
 	  .arg_parm	 = { [2] = &strarray__whences, /* whence */ }, },
 	{ .name	    = "lsetxattr",  .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
-	{ .name	    = "lstat",	    .errmsg = true, .alias = "newlstat", },
+	{ .name	    = "lstat",	    .errmsg = true, .alias = "newlstat",
+	  .arg_scnprintf = { [0] = SCA_FILENAME, /* filename */ }, },
 	{ .name	    = "lsxattr",    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
 	{ .name     = "madvise",    .errmsg = true,
@@ -1098,7 +1105,8 @@ static struct syscall_fmt {
 	{ .name	    = "mknod",      .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FILENAME, /* filename */ }, },
 	{ .name	    = "mknodat",    .errmsg = true,
-	  .arg_scnprintf = { [0] = SCA_FDAT, /* fd */ }, },
+	  .arg_scnprintf = { [0] = SCA_FDAT, /* fd */
+			     [1] = SCA_FILENAME, /* filename */ }, },
 	{ .name	    = "mlock",	    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_HEX, /* addr */ }, },
 	{ .name	    = "mlockall",   .errmsg = true,
@@ -1111,6 +1119,8 @@ static struct syscall_fmt {
 	{ .name	    = "mprotect",   .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_HEX, /* start */
 			     [2] = SCA_MMAP_PROT, /* prot */ }, },
+	{ .name	    = "mq_unlink", .errmsg = true,
+	  .arg_scnprintf = { [0] = SCA_FILENAME, /* u_name */ }, },
 	{ .name	    = "mremap",	    .hexret = true,
 	  .arg_scnprintf = { [0] = SCA_HEX, /* addr */
 			     [3] = SCA_MREMAP_FLAGS, /* flags */
@@ -1201,7 +1211,8 @@ static struct syscall_fmt {
 	  .arg_scnprintf = { [0] = SCA_STRARRAY, /* family */
 			     [1] = SCA_SK_TYPE, /* type */ },
 	  .arg_parm	 = { [0] = &strarray__socket_families, /* family */ }, },
-	{ .name	    = "stat",	    .errmsg = true, .alias = "newstat", },
+	{ .name	    = "stat",	    .errmsg = true, .alias = "newstat",
+	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
 	{ .name	    = "statfs",	    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
 	{ .name	    = "swapoff",    .errmsg = true,
@@ -1227,6 +1238,8 @@ static struct syscall_fmt {
 			     [1] = SCA_FILENAME, /* filename */ }, },
 	{ .name	    = "utimes",  .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FILENAME, /* filename */ }, },
+	{ .name	    = "vmsplice",  .errmsg = true,
+	  .arg_scnprintf = { [0] = SCA_FD, /* fd */ }, },
 	{ .name	    = "write",	    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FD, /* fd */ }, },
 	{ .name	    = "writev",	    .errmsg = true,
Signature · 1 line
2.1.0
author maintainer
#2 lore raw

PATCH 2/13 perf trace: Add missing clockid entries

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>

We were missing:

CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM, CLOCK_BOOTTIME_ALARM, CLOCK_SGI_CYCLE and CLOCK_TAI.

Add them.

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Milian Wolff <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-trace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/builtin-trace.c +2 -1
index 7cdcbee642b9..5c494a8c8942 100644
@@ -599,7 +599,8 @@ static DEFINE_STRARRAY(sighow);
 
 static const char *clockid[] = {
 	"REALTIME", "MONOTONIC", "PROCESS_CPUTIME_ID", "THREAD_CPUTIME_ID",
-	"MONOTONIC_RAW", "REALTIME_COARSE", "MONOTONIC_COARSE",
+	"MONOTONIC_RAW", "REALTIME_COARSE", "MONOTONIC_COARSE", "BOOTTIME",
+	"REALTIME_ALARM", "BOOTTIME_ALARM", "SGI_CYCLE", "TAI"
 };
 static DEFINE_STRARRAY(clockid);
 
Signature · 1 line
2.1.0
author maintainer
#3 lore raw

PATCH 3/13 perf sort: Check for SRCLINE_UNKNOWN case in "srcfile" processing

In reply to Arnaldo Carvalho de Melo

From: Andi Kleen <[email protected]>

Handle the SRCLINE_UNKNOWN case correctly when processing "srcfile".

Commiter note:

We can't just free it, as it was't allocated via malloc, its a guard variable.

---
 tools/perf/util/sort.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/sort.c +2 -0
index c0c32b050e45..7e3871606df3 100644
@@ -330,6 +330,8 @@ static char *get_srcfile(struct hist_entry *e)
 
 	sf = get_srcline(map->dso, map__rip_2objdump(map, e->ip),
 			 e->ms.sym, true);
+	if (!strcmp(sf, SRCLINE_UNKNOWN))
+		return no_srcfile;
 	p = strchr(sf, ':');
 	if (p && *sf) {
 		*p = 0;
Signature · 1 line
2.1.0
author maintainer
#4 lore raw

PATCH 4/13 perf trace: Use the FD beautifier for socket syscall fds

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>

But we really should have something like 'strace -yy' here...

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-trace.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
tools/perf/builtin-trace.c +12 -6
index 5c494a8c8942..12fc6dfbae99 100644
@@ -1173,11 +1173,14 @@ static struct syscall_fmt {
 	{ .name	    = "readv",	    .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FD, /* fd */ }, },
 	{ .name	    = "recvfrom",   .errmsg = true,
-	  .arg_scnprintf = { [3] = SCA_MSG_FLAGS, /* flags */ }, },
+	  .arg_scnprintf = { [0] = SCA_FD, /* fd */
+			     [3] = SCA_MSG_FLAGS, /* flags */ }, },
 	{ .name	    = "recvmmsg",   .errmsg = true,
-	  .arg_scnprintf = { [3] = SCA_MSG_FLAGS, /* flags */ }, },
+	  .arg_scnprintf = { [0] = SCA_FD, /* fd */
+			     [3] = SCA_MSG_FLAGS, /* flags */ }, },
 	{ .name	    = "recvmsg",    .errmsg = true,
-	  .arg_scnprintf = { [2] = SCA_MSG_FLAGS, /* flags */ }, },
+	  .arg_scnprintf = { [0] = SCA_FD, /* fd */
+			     [2] = SCA_MSG_FLAGS, /* flags */ }, },
 	{ .name	    = "removexattr", .errmsg = true,
 	  .arg_scnprintf = { [0] = SCA_FILENAME, /* pathname */ }, },
 	{ .name	    = "renameat",   .errmsg = true,
@@ -1193,11 +1196,14 @@ static struct syscall_fmt {
 	  .arg_scnprintf = { [2] = SCA_SIGNUM, /* sig */ }, },
 	{ .name	    = "select",	    .errmsg = true, .timeout = true, },
 	{ .name	    = "sendmmsg",    .errmsg = true,
-	  .arg_scnprintf = { [3] = SCA_MSG_FLAGS, /* flags */ }, },
+	  .arg_scnprintf = { [0] = SCA_FD, /* fd */
+			     [3] = SCA_MSG_FLAGS, /* flags */ }, },
 	{ .name	    = "sendmsg",    .errmsg = true,
-	  .arg_scnprintf = { [2] = SCA_MSG_FLAGS, /* flags */ }, },
+	  .arg_scnprintf = { [0] = SCA_FD, /* fd */
+			     [2] = SCA_MSG_FLAGS, /* flags */ }, },
 	{ .name	    = "sendto",	    .errmsg = true,
-	  .arg_scnprintf = { [3] = SCA_MSG_FLAGS, /* flags */ }, },
+	  .arg_scnprintf = { [0] = SCA_FD, /* fd */
+			     [3] = SCA_MSG_FLAGS, /* flags */ }, },
 	{ .name	    = "setitimer",  .errmsg = true, STRARRAY(0, which, itimers), },
 	{ .name	    = "setrlimit",  .errmsg = true, STRARRAY(0, resource, rlimit_resources), },
 	{ .name	    = "setxattr",   .errmsg = true,
Signature · 1 line
2.1.0
author maintainer
#5 lore raw

PATCH 5/13 perf trace: Beautify keyctl's option arg

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>

8.697 (0.103 ms): pool/2343 keyctl(option: GET_PERSISTENT, arg2: 1000, arg3: 4294967294, arg4: 140703061514067, arg5: 140703692383680) = 1023192809 8.763 (0.049 ms): pool/2343 keyctl(option: SEARCH, arg2: 1023192809, arg3: 140703745767772, arg4: 140703745767832, arg5: 4294967294) = 140224497 8.789 (0.016 ms): pool/2343 keyctl(option: SEARCH, arg2: 140224497, arg3: 140703745767814, arg4: 140703745767900) = 512300257
8.807 (0.011 ms): pool/2343 keyctl(option: READ, arg2: 512300257 ) = 13
8.822 (0.008 ms): pool/2343 keyctl(option: READ, arg2: 512300257, arg3: 140703061514000, arg4: 13 ) = 13
8.837 (0.007 ms): pool/2343 keyctl(option: READ, arg2: 140224497 ) = 4
8.852 (0.009 ms): pool/2343 keyctl(option: READ, arg2: 140224497, arg3: 140703061514000, arg4: 4 ) = 4
8.869 (0.010 ms): pool/2343 keyctl(option: SEARCH, arg2: 140224497, arg3: 140703745767772, arg4: 140703061514032) = -1 ENOKEY Required key not available
8.892 (0.017 ms): pool/2343 keyctl(option: DESCRIBE, arg2: 512300257 ) = 43
8.910 (0.012 ms): pool/2343 keyctl(option: DESCRIBE, arg2: 512300257, arg3: 140703061544384, arg4: 43) = 43

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-trace.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/perf/builtin-trace.c +10 -0
index 12fc6dfbae99..489cc118a36a 100644
@@ -569,6 +569,15 @@ static DEFINE_STRARRAY_OFFSET(epoll_ctl_ops, 1);
 static const char *itimers[] = { "REAL", "VIRTUAL", "PROF", };
 static DEFINE_STRARRAY(itimers);
 
+static const char *keyctl_options[] = {
+	"GET_KEYRING_ID", "JOIN_SESSION_KEYRING", "UPDATE", "REVOKE", "CHOWN",
+	"SETPERM", "DESCRIBE", "CLEAR", "LINK", "UNLINK", "SEARCH", "READ",
+	"INSTANTIATE", "NEGATE", "SET_REQKEY_KEYRING", "SET_TIMEOUT",
+	"ASSUME_AUTHORITY", "GET_SECURITY", "SESSION_TO_PARENT", "REJECT",
+	"INSTANTIATE_IOV", "INVALIDATE", "GET_PERSISTENT",
+};
+static DEFINE_STRARRAY(keyctl_options);
+
 static const char *whences[] = { "SET", "CUR", "END",
 #ifdef SEEK_DATA
 "DATA",
@@ -1071,6 +1080,7 @@ static struct syscall_fmt {
 #else
 			     [2] = SCA_HEX, /* arg */ }, },
 #endif
+	{ .name	    = "keyctl",	    .errmsg = true, STRARRAY(0, option, keyctl_options), },
 	{ .name	    = "kill",	    .errmsg = true,
 	  .arg_scnprintf = { [1] = SCA_SIGNUM, /* sig */ }, },
 	{ .name	    = "lchown",    .errmsg = true,
Signature · 1 line
2.1.0
author maintainer
#6 lore raw

PATCH 6/13 perf ui browser: Introduce ui_browser__write_nstring()

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>

To remove direct access to libslang functions, with the immediate goal of implementing horizontal scrolling at the ui_browser level, but also because we may at some point want to implement ui_browser with other UIs in addition to the current libslang implementation.

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/ui/browser.c           |  8 +++++++-
 tools/perf/ui/browser.h           |  2 ++
 tools/perf/ui/browsers/annotate.c | 24 ++++++++++++------------
 tools/perf/ui/browsers/header.c   |  2 +-
 tools/perf/ui/browsers/hists.c    | 10 +++++-----
 tools/perf/ui/browsers/map.c      |  2 +-
 tools/perf/ui/browsers/scripts.c  |  2 +-
 tools/perf/ui/tui/util.c          |  2 +-
 8 files changed, 30 insertions(+), 22 deletions(-)
tools/perf/ui/browser.c +7 -1
index 6680fa5cb9dd..5c730ab553e9 100644
@@ -46,6 +46,12 @@ void ui_browser__gotorc(struct ui_browser *browser, int y, int x)
 	SLsmg_gotorc(browser->y + y, browser->x + x);
 }
 
+void ui_browser__write_nstring(struct ui_browser *browser __maybe_unused, const char *msg,
+			       unsigned int width)
+{
+	slsmg_write_nstring(msg, width);
+}
+
 static struct list_head *
 ui_browser__list_head_filter_entries(struct ui_browser *browser,
 				     struct list_head *pos)
@@ -234,7 +240,7 @@ void __ui_browser__show_title(struct ui_browser *browser, const char *title)
 {
 	SLsmg_gotorc(0, 0);
 	ui_browser__set_color(browser, HE_COLORSET_ROOT);
-	slsmg_write_nstring(title, browser->width + 1);
+	ui_browser__write_nstring(browser, title, browser->width + 1);
 }
 
 void ui_browser__show_title(struct ui_browser *browser, const char *title)
tools/perf/ui/browser.h +2 -0
index 92ae72113965..ba276c7ba26f 100644
@@ -37,6 +37,8 @@ void ui_browser__refresh_dimensions(struct ui_browser *browser);
 void ui_browser__reset_index(struct ui_browser *browser);
 
 void ui_browser__gotorc(struct ui_browser *browser, int y, int x);
+void ui_browser__write_nstring(struct ui_browser *browser, const char *msg,
+			       unsigned int width);
 void ui_browser__write_graph(struct ui_browser *browser, int graph);
 void __ui_browser__line_arrow(struct ui_browser *browser, unsigned int column,
 			      u64 start, u64 end);
tools/perf/ui/browsers/annotate.c +12 -12
index b5fc847f9660..c14f8f9e0b6a 100644
@@ -141,22 +141,22 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 					slsmg_printf("%6.2f ", bdl->samples[i].percent);
 			}
 		} else {
-			slsmg_write_nstring(" ", 7 * ab->nr_events);
+			ui_browser__write_nstring(browser, " ", 7 * ab->nr_events);
 		}
 	} else {
 		ui_browser__set_percent_color(browser, 0, current_entry);
-		slsmg_write_nstring(" ", 7 * ab->nr_events);
+		ui_browser__write_nstring(browser, " ", 7 * ab->nr_events);
 	}
 	if (ab->have_cycles) {
 		if (dl->ipc)
 			slsmg_printf("%*.2f ", IPC_WIDTH - 1, dl->ipc);
 		else
-			slsmg_write_nstring(" ", IPC_WIDTH);
+			ui_browser__write_nstring(browser, " ", IPC_WIDTH);
 		if (dl->cycles)
 			slsmg_printf("%*" PRIu64 " ",
 				     CYCLES_WIDTH - 1, dl->cycles);
 		else
-			slsmg_write_nstring(" ", CYCLES_WIDTH);
+			ui_browser__write_nstring(browser, " ", CYCLES_WIDTH);
 	}
 
 	SLsmg_write_char(' ');
@@ -166,7 +166,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 		width += 1;
 
 	if (!*dl->line)
-		slsmg_write_nstring(" ", width - pcnt_width);
+		ui_browser__write_nstring(browser, " ", width - pcnt_width);
 	else if (dl->offset == -1) {
 		if (dl->line_nr && annotate_browser__opts.show_linenr)
 			printed = scnprintf(bf, sizeof(bf), "%-*d ",
@@ -174,8 +174,8 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 		else
 			printed = scnprintf(bf, sizeof(bf), "%*s  ",
 				    ab->addr_width, " ");
-		slsmg_write_nstring(bf, printed);
-		slsmg_write_nstring(dl->line, width - printed - pcnt_width + 1);
+		ui_browser__write_nstring(browser, bf, printed);
+		ui_browser__write_nstring(browser, dl->line, width - printed - pcnt_width + 1);
 	} else {
 		u64 addr = dl->offset;
 		int color = -1;
@@ -194,7 +194,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 							    bdl->jump_sources);
 					prev = annotate_browser__set_jumps_percent_color(ab, bdl->jump_sources,
 											 current_entry);
-					slsmg_write_nstring(bf, printed);
+					ui_browser__write_nstring(browser, bf, printed);
 					ui_browser__set_color(browser, prev);
 				}
 
@@ -208,7 +208,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 
 		if (change_color)
 			color = ui_browser__set_color(browser, HE_COLORSET_ADDR);
-		slsmg_write_nstring(bf, printed);
+		ui_browser__write_nstring(browser, bf, printed);
 		if (change_color)
 			ui_browser__set_color(browser, color);
 		if (dl->ins && dl->ins->ops->scnprintf) {
@@ -222,11 +222,11 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 				ui_browser__write_graph(browser, SLSMG_RARROW_CHAR);
 				SLsmg_write_char(' ');
 			} else {
-				slsmg_write_nstring(" ", 2);
+				ui_browser__write_nstring(browser, " ", 2);
 			}
 		} else {
 			if (strcmp(dl->name, "retq")) {
-				slsmg_write_nstring(" ", 2);
+				ui_browser__write_nstring(browser, " ", 2);
 			} else {
 				ui_browser__write_graph(browser, SLSMG_LARROW_CHAR);
 				SLsmg_write_char(' ');
@@ -234,7 +234,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 		}
 
 		disasm_line__scnprintf(dl, bf, sizeof(bf), !annotate_browser__opts.use_offset);
-		slsmg_write_nstring(bf, width - pcnt_width - 3 - printed);
+		ui_browser__write_nstring(browser, bf, width - pcnt_width - 3 - printed);
 	}
 
 	if (current_entry)
tools/perf/ui/browsers/header.c +1 -1
index e8278c558d4a..f10681717f93 100644
@@ -25,7 +25,7 @@ static void ui_browser__argv_write(struct ui_browser *browser,
 	ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED :
 						       HE_COLORSET_NORMAL);
 
-	slsmg_write_nstring(str, browser->width);
+	ui_browser__write_nstring(browser, str, browser->width);
 }
 
 static int list_menu__run(struct ui_browser *menu)
tools/perf/ui/browsers/hists.c +5 -5
index fa67613976a8..9e94dc88621b 100644
@@ -540,10 +540,10 @@ static void hist_browser__show_callchain_entry(struct hist_browser *browser,
 
 	ui_browser__set_color(&browser->b, color);
 	hist_browser__gotorc(browser, row, 0);
-	slsmg_write_nstring(" ", offset);
+	ui_browser__write_nstring(&browser->b, " ", offset);
 	slsmg_printf("%c", folded_sign);
 	ui_browser__write_graph(&browser->b, show_annotated ? SLSMG_RARROW_CHAR : ' ');
-	slsmg_write_nstring(str, width);
+	ui_browser__write_nstring(&browser->b, str, width);
 }
 
 static void hist_browser__fprintf_callchain_entry(struct hist_browser *b __maybe_unused,
@@ -822,7 +822,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 		if (!browser->b.navkeypressed)
 			width += 1;
 
-		slsmg_write_nstring("", width);
+		ui_browser__write_nstring(&browser->b, "", width);
 
 		++row;
 		++printed;
@@ -899,7 +899,7 @@ static void hist_browser__show_headers(struct hist_browser *browser)
 	hists__scnprintf_headers(headers, sizeof(headers), browser->hists);
 	ui_browser__gotorc(&browser->b, 0, 0);
 	ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
-	slsmg_write_nstring(headers, browser->b.width + 1);
+	ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1);
 }
 
 static void ui_browser__hists_init_top(struct ui_browser *browser)
@@ -2057,7 +2057,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser,
 		warn = bf;
 	}
 
-	slsmg_write_nstring(warn, browser->width - printed);
+	ui_browser__write_nstring(browser, warn, browser->width - printed);
 
 	if (current_entry)
 		menu->selection = evsel;
tools/perf/ui/browsers/map.c +1 -1
index b11639f33682..fb1ae241f0de 100644
@@ -32,7 +32,7 @@ static void map_browser__write(struct ui_browser *browser, void *nd, int row)
 		     sym->binding == STB_LOCAL  ? 'l' : 'w');
 	width = browser->width - ((mb->addrlen * 2) + 4);
 	if (width > 0)
-		slsmg_write_nstring(sym->name, width);
+		ui_browser__write_nstring(browser, sym->name, width);
 }
 
 /* FIXME uber-kludgy, see comment on cmd_report... */
tools/perf/ui/browsers/scripts.c +1 -1
index 402d2bd30b09..e13b48d705ef 100644
@@ -81,7 +81,7 @@ static void script_browser__write(struct ui_browser *browser,
 	ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED :
 						       HE_COLORSET_NORMAL);
 
-	slsmg_write_nstring(sline->line, browser->width);
+	ui_browser__write_nstring(browser, sline->line, browser->width);
 }
 
 static int script_browser__run(struct perf_script_browser *browser)
tools/perf/ui/tui/util.c +1 -1
index bf890f72fe80..d96ad7c8325d 100644
@@ -21,7 +21,7 @@ static void ui_browser__argv_write(struct ui_browser *browser,
 
 	ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED :
 						       HE_COLORSET_NORMAL);
-	slsmg_write_nstring(*arg, browser->width);
+	ui_browser__write_nstring(browser, *arg, browser->width);
 }
 
 static int popup_menu__run(struct ui_browser *menu)
Signature · 1 line
2.1.0
author maintainer
#7 lore raw

PATCH 7/13 perf ui browser: Introduce ui_browser__printf()

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>

To remove direct access to libslang functions, with the immediate goal of implementing horizontal scrolling at the ui_browser level, but also because we may at some point want to implement ui_browser with other UIs in addition to the current libslang implementation.

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/ui/browser.c           |  9 +++++++++
 tools/perf/ui/browser.h           |  1 +
 tools/perf/ui/browsers/annotate.c | 19 ++++++++++---------
 tools/perf/ui/browsers/hists.c    | 16 ++++++++--------
 tools/perf/ui/browsers/map.c      |  9 ++++-----
 tools/perf/ui/libslang.h          |  3 +++
 6 files changed, 35 insertions(+), 22 deletions(-)
tools/perf/ui/browser.c +9 -0
index 5c730ab553e9..c6c7e5189214 100644
@@ -52,6 +52,15 @@ void ui_browser__write_nstring(struct ui_browser *browser __maybe_unused, const
 	slsmg_write_nstring(msg, width);
 }
 
+void ui_browser__printf(struct ui_browser *browser __maybe_unused, const char *fmt, ...)
+{
+	va_list args;
+
+	va_start(args, fmt);
+	slsmg_vprintf(fmt, args);
+	va_end(args);
+}
+
 static struct list_head *
 ui_browser__list_head_filter_entries(struct ui_browser *browser,
 				     struct list_head *pos)
tools/perf/ui/browser.h +1 -0
index ba276c7ba26f..52be87125def 100644
@@ -39,6 +39,7 @@ void ui_browser__reset_index(struct ui_browser *browser);
 void ui_browser__gotorc(struct ui_browser *browser, int y, int x);
 void ui_browser__write_nstring(struct ui_browser *browser, const char *msg,
 			       unsigned int width);
+void ui_browser__printf(struct ui_browser *browser, const char *fmt, ...);
 void ui_browser__write_graph(struct ui_browser *browser, int graph);
 void __ui_browser__line_arrow(struct ui_browser *browser, unsigned int column,
 			      u64 start, u64 end);
tools/perf/ui/browsers/annotate.c +10 -9
index c14f8f9e0b6a..29739b347599 100644
@@ -1,7 +1,6 @@
 #include "../../util/util.h"
 #include "../browser.h"
 #include "../helpline.h"
-#include "../libslang.h"
 #include "../ui.h"
 #include "../util.h"
 #include "../../util/annotate.h"
@@ -134,11 +133,13 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 				ui_browser__set_percent_color(browser,
 							bdl->samples[i].percent,
 							current_entry);
-				if (annotate_browser__opts.show_total_period)
-					slsmg_printf("%6" PRIu64 " ",
-						     bdl->samples[i].nr);
-				else
-					slsmg_printf("%6.2f ", bdl->samples[i].percent);
+				if (annotate_browser__opts.show_total_period) {
+					ui_browser__printf(browser, "%6" PRIu64 " ",
+							   bdl->samples[i].nr);
+				} else {
+					ui_browser__printf(browser, "%6.2f ",
+							   bdl->samples[i].percent);
+				}
 			}
 		} else {
 			ui_browser__write_nstring(browser, " ", 7 * ab->nr_events);
@@ -149,12 +150,12 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 	}
 	if (ab->have_cycles) {
 		if (dl->ipc)
-			slsmg_printf("%*.2f ", IPC_WIDTH - 1, dl->ipc);
+			ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->ipc);
 		else
 			ui_browser__write_nstring(browser, " ", IPC_WIDTH);
 		if (dl->cycles)
-			slsmg_printf("%*" PRIu64 " ",
-				     CYCLES_WIDTH - 1, dl->cycles);
+			ui_browser__printf(browser, "%*" PRIu64 " ",
+					   CYCLES_WIDTH - 1, dl->cycles);
 		else
 			ui_browser__write_nstring(browser, " ", CYCLES_WIDTH);
 	}
tools/perf/ui/browsers/hists.c +8 -8
index 9e94dc88621b..2de53d6e4df4 100644
@@ -1,5 +1,4 @@
 #include <stdio.h>
-#include "../libslang.h"
 #include <stdlib.h>
 #include <string.h>
 #include <linux/rbtree.h>
@@ -541,7 +540,7 @@ static void hist_browser__show_callchain_entry(struct hist_browser *browser,
 	ui_browser__set_color(&browser->b, color);
 	hist_browser__gotorc(browser, row, 0);
 	ui_browser__write_nstring(&browser->b, " ", offset);
-	slsmg_printf("%c", folded_sign);
+	ui_browser__printf(&browser->b, "%c", folded_sign);
 	ui_browser__write_graph(&browser->b, show_annotated ? SLSMG_RARROW_CHAR : ' ');
 	ui_browser__write_nstring(&browser->b, str, width);
 }
@@ -680,7 +679,7 @@ static int __hpp__slsmg_color_printf(struct perf_hpp *hpp, const char *fmt, ...)
 	ui_browser__set_percent_color(arg->b, percent, arg->current_entry);
 
 	ret = scnprintf(hpp->buf, hpp->size, fmt, len, percent);
-	slsmg_printf("%s", hpp->buf);
+	ui_browser__printf(arg->b, "%s", hpp->buf);
 
 	advance_hpp(hpp, ret);
 	return ret;
@@ -713,10 +712,11 @@ hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt,		\
 				struct hist_entry *he)			\
 {									\
 	if (!symbol_conf.cumulate_callchain) {				\
+		struct hpp_arg *arg = hpp->ptr;				\
 		int len = fmt->user_len ?: fmt->len;			\
 		int ret = scnprintf(hpp->buf, hpp->size,		\
 				    "%*s", len, "N/A");			\
-		slsmg_printf("%s", hpp->buf);				\
+		ui_browser__printf(arg->b, "%s", hpp->buf);		\
 									\
 		return ret;						\
 	}								\
@@ -801,12 +801,12 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 
 			if (first) {
 				if (symbol_conf.use_callchain) {
-					slsmg_printf("%c ", folded_sign);
+					ui_browser__printf(&browser->b, "%c ", folded_sign);
 					width -= 2;
 				}
 				first = false;
 			} else {
-				slsmg_printf("  ");
+				ui_browser__printf(&browser->b, "  ");
 				width -= 2;
 			}
 
@@ -814,7 +814,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 				width -= fmt->color(fmt, &hpp, entry);
 			} else {
 				width -= fmt->entry(fmt, &hpp, entry);
-				slsmg_printf("%s", s);
+				ui_browser__printf(&browser->b, "%s", s);
 			}
 		}
 
@@ -2044,7 +2044,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser,
 	nr_events = convert_unit(nr_events, &unit);
 	printed = scnprintf(bf, sizeof(bf), "%lu%c%s%s", nr_events,
 			   unit, unit == ' ' ? "" : " ", ev_name);
-	slsmg_printf("%s", bf);
+	ui_browser__printf(browser, "%s", bf);
 
 	nr_events = hists->stats.nr_events[PERF_RECORD_LOST];
 	if (nr_events != 0) {
tools/perf/ui/browsers/map.c +4 -5
index fb1ae241f0de..8c154c7d4669 100644
@@ -1,4 +1,3 @@
-#include "../libslang.h"
 #include <elf.h>
 #include <inttypes.h>
 #include <sys/ttydefaults.h>
@@ -26,10 +25,10 @@ static void map_browser__write(struct ui_browser *browser, void *nd, int row)
 	int width;
 
 	ui_browser__set_percent_color(browser, 0, current_entry);
-	slsmg_printf("%*" PRIx64 " %*" PRIx64 " %c ",
-		     mb->addrlen, sym->start, mb->addrlen, sym->end,
-		     sym->binding == STB_GLOBAL ? 'g' :
-		     sym->binding == STB_LOCAL  ? 'l' : 'w');
+	ui_browser__printf(browser, "%*" PRIx64 " %*" PRIx64 " %c ",
+			   mb->addrlen, sym->start, mb->addrlen, sym->end,
+			   sym->binding == STB_GLOBAL ? 'g' :
+				sym->binding == STB_LOCAL  ? 'l' : 'w');
 	width = browser->width - ((mb->addrlen * 2) + 4);
 	if (width > 0)
 		ui_browser__write_nstring(browser, sym->name, width);
tools/perf/ui/libslang.h +3 -0
index 4d54b6450f5b..db816695ad97 100644
@@ -14,12 +14,15 @@
 #if SLANG_VERSION < 20104
 #define slsmg_printf(msg, args...) \
 	SLsmg_printf((char *)(msg), ##args)
+#define slsmg_vprintf(msg, vargs) \
+	SLsmg_vprintf((char *)(msg), vargs)
 #define slsmg_write_nstring(msg, len) \
 	SLsmg_write_nstring((char *)(msg), len)
 #define sltt_set_color(obj, name, fg, bg) \
 	SLtt_set_color(obj,(char *)(name), (char *)(fg), (char *)(bg))
 #else
 #define slsmg_printf SLsmg_printf
+#define slsmg_vprintf SLsmg_vprintf
 #define slsmg_write_nstring SLsmg_write_nstring
 #define sltt_set_color SLtt_set_color
 #endif
Signature · 1 line
2.1.0
author maintainer
#8 lore raw

PATCH 8/13 perf hists browser: Make ESC unzoom as well

In reply to Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <[email protected]>

In addition to <-, that may be repurposed for horizontal scrolling.

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/ui/browsers/hists.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
tools/perf/ui/browsers/hists.c +8 -11
index 2de53d6e4df4..f296b7348449 100644
@@ -1868,6 +1868,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 		case K_RIGHT:
 			/* menu */
 			break;
+		case K_ESC:
 		case K_LEFT: {
 			const void *top;
 
@@ -1877,6 +1878,12 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 				 */
 				if (left_exits)
 					goto out_free_stack;
+
+				if (key == K_ESC &&
+				    ui_browser__dialog_yesno(&browser->b,
+							     "Do you really want to exit?"))
+					goto out_free_stack;
+
 				continue;
 			}
 			top = pstack__peek(browser->pstack);
@@ -1892,12 +1899,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 				do_zoom_thread(browser, actions);
 			continue;
 		}
-		case K_ESC:
-			if (!left_exits &&
-			    !ui_browser__dialog_yesno(&browser->b,
-					       "Do you really want to exit?"))
-				continue;
-			/* Fall thru */
 		case 'q':
 		case CTRL('c'):
 			goto out_free_stack;
@@ -2120,15 +2121,11 @@ browse_hists:
 				else
 					pos = perf_evsel__prev(pos);
 				goto browse_hists;
-			case K_ESC:
-				if (!ui_browser__dialog_yesno(&menu->b,
-						"Do you really want to exit?"))
-					continue;
-				/* Fall thru */
 			case K_SWITCH_INPUT_DATA:
 			case 'q':
 			case CTRL('c'):
 				goto out;
+			case K_ESC:
 			default:
 				continue;
 			}
Signature · 1 line
2.1.0
author maintainer
#9 lore raw

PATCH 9/13 perf probe: Fix to show lines of sys_ functions correctly

In reply to Arnaldo Carvalho de Melo

From: Masami Hiramatsu <[email protected]>

"perf probe --lines sys_poll" shows only the first line of sys_poll, because the SYSCALL_DEFINE macro:

  ----
  SYSCALL_DEFINE*(foo,...)
  {
    body;
  }
  ----

is expanded as below (on debuginfo)

----

  static inline int SYSC_foo(...)
  {
    body;
  }
  int SyS_foo(...) <- is an alias of sys_foo.
  {
    return SYSC_foo(...);
  }
  ----

So, "perf probe --lines sys_foo" decodes SyS_foo function and it also skips inlined functions(SYSC_foo) inside the target function because those functions are usually defined somewhere else.

To fix this issue, this fix checks whether the inlined function is defined at the same point of the target function, and if so, it doesn't skip the inline function.

---
 tools/perf/util/dwarf-aux.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
tools/perf/util/dwarf-aux.c +13 -5
index 57f3ef41c2bc..445f455dd377 100644
@@ -734,15 +734,18 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
 	Dwarf_Lines *lines;
 	Dwarf_Line *line;
 	Dwarf_Addr addr;
-	const char *fname;
+	const char *fname, *decf = NULL;
 	int lineno, ret = 0;
+	int decl = 0, inl;
 	Dwarf_Die die_mem, *cu_die;
 	size_t nlines, i;
 
 	/* Get the CU die */
-	if (dwarf_tag(rt_die) != DW_TAG_compile_unit)
+	if (dwarf_tag(rt_die) != DW_TAG_compile_unit) {
 		cu_die = dwarf_diecu(rt_die, &die_mem, NULL, NULL);
-	else
+		dwarf_decl_line(rt_die, &decl);
+		decf = dwarf_decl_file(rt_die);
+	} else
 		cu_die = rt_die;
 	if (!cu_die) {
 		pr_debug2("Failed to get CU from given DIE.\n");
@@ -773,9 +776,14 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
 			 * The line is included in given function, and
 			 * no inline block includes it.
 			 */
-			if (!dwarf_haspc(rt_die, addr) ||
-			    die_find_inlinefunc(rt_die, addr, &die_mem))
+			if (!dwarf_haspc(rt_die, addr))
 				continue;
+			if (die_find_inlinefunc(rt_die, addr, &die_mem)) {
+				dwarf_decl_line(&die_mem, &inl);
+				if (inl != decl ||
+				    decf != dwarf_decl_file(&die_mem))
+					continue;
+			}
 		/* Get source line */
 		fname = dwarf_linesrc(line, NULL, NULL);
 
Signature · 1 line
2.1.0
author maintainer
#10 lore raw

PATCH 10/13 perf callchain: Per-event type selection support

In reply to Arnaldo Carvalho de Melo

From: Kan Liang <[email protected]>

This patchkit adds the ability to set callgraph mode (fp, dwarf, lbr) per event. This in term can reduce sampling overhead and the size of the perf.data.

Here is an example.

perf record -e 'cpu/cpu-cycles,period=1000,call-graph=fp,time=1/,cpu/instructions,call-graph=lbr/' sleep 1

perf evlist -v cpu/cpu-cycles,period=1000,call-graph=fp,time=1/: type: 4, size: 112,
config: 0x3c, { sample_period, sample_freq }: 1000, sample_type:
IP|TID|TIME|CALLCHAIN|PERIOD|IDENTIFIER, read_format: ID, disabled: 1,
inherit: 1, mmap: 1, comm: 1, enable_on_exec: 1, task: 1, sample_id_all:
1, exclude_guest: 1, mmap2: 1, comm_exec: 1 cpu/instructions,call-graph=lbr/: type: 4, size: 112, config: 0xc0, { sample_period, sample_freq }: 4000, sample_type:
IP|TID|TIME|CALLCHAIN|PERIOD|BRANCH_STACK|IDENTIFIER, read_format: ID,
disabled: 1, inherit: 1, freq: 1, enable_on_exec: 1, sample_id_all: 1,
exclude_guest: 1

---
 tools/perf/Documentation/perf-record.txt |  3 ++
 tools/perf/util/evsel.c                  | 62 ++++++++++++++++++++++++++++++--
 tools/perf/util/evsel.h                  |  4 +++
 tools/perf/util/parse-events.c           | 12 +++++++
 tools/perf/util/parse-events.h           |  2 ++
 tools/perf/util/parse-events.l           |  2 ++
 tools/perf/util/pmu.c                    |  4 ++-
 7 files changed, 86 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-record.txt +3 -0
index afbe45ef7e3e..7f82dec2b541 100644
@@ -53,6 +53,9 @@ OPTIONS
 	  - 'time': Disable/enable time stamping. Acceptable values are 1 for
 		    enabling time stamping. 0 for disabling time stamping.
 		    The default is 1.
+	  - 'call-graph': Disable/enable callgraph. Acceptable str are "fp" for
+			 FP mode, "dwarf" for DWARF mode, "lbr" for LBR mode.
+	  - 'stack-size': user stack size for dwarf mode
 	  Note: If user explicitly sets options which conflict with the params,
 	  the value set by the params will be overridden.
 
tools/perf/util/evsel.c +60 -2

88 lines not on this page · raw message

tools/perf/util/evsel.h +4 -0
index fdf2674ab339..93ac6b128149 100644
@@ -41,6 +41,8 @@ enum {
 	PERF_EVSEL__CONFIG_TERM_PERIOD,
 	PERF_EVSEL__CONFIG_TERM_FREQ,
 	PERF_EVSEL__CONFIG_TERM_TIME,
+	PERF_EVSEL__CONFIG_TERM_CALLGRAPH,
+	PERF_EVSEL__CONFIG_TERM_STACK_USER,
 	PERF_EVSEL__CONFIG_TERM_MAX,
 };
 
@@ -51,6 +53,8 @@ struct perf_evsel_config_term {
 		u64	period;
 		u64	freq;
 		bool	time;
+		char	*callgraph;
+		u64	stack_user;
 	} val;
 };
 
tools/perf/util/parse-events.c +12 -0
index dbf315df4220..d826e6f515db 100644
@@ -614,6 +614,12 @@ do {									   \
 			return -EINVAL;
 		}
 		break;
+	case PARSE_EVENTS__TERM_TYPE_CALLGRAPH:
+		CHECK_TYPE_VAL(STR);
+		break;
+	case PARSE_EVENTS__TERM_TYPE_STACKSIZE:
+		CHECK_TYPE_VAL(NUM);
+		break;
 	case PARSE_EVENTS__TERM_TYPE_NAME:
 		CHECK_TYPE_VAL(STR);
 		break;
@@ -668,6 +674,12 @@ do {								\
 		case PARSE_EVENTS__TERM_TYPE_TIME:
 			ADD_CONFIG_TERM(TIME, time, term->val.num);
 			break;
+		case PARSE_EVENTS__TERM_TYPE_CALLGRAPH:
+			ADD_CONFIG_TERM(CALLGRAPH, callgraph, term->val.str);
+			break;
+		case PARSE_EVENTS__TERM_TYPE_STACKSIZE:
+			ADD_CONFIG_TERM(STACK_USER, stack_user, term->val.num);
+			break;
 		default:
 			break;
 		}
tools/perf/util/parse-events.h +2 -0
index ce2d13a16226..a09b0e210997 100644
@@ -65,6 +65,8 @@ enum {
 	PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ,
 	PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE,
 	PARSE_EVENTS__TERM_TYPE_TIME,
+	PARSE_EVENTS__TERM_TYPE_CALLGRAPH,
+	PARSE_EVENTS__TERM_TYPE_STACKSIZE,
 };
 
 struct parse_events_term {
tools/perf/util/parse-events.l +2 -0
index 4306f5ad75c7..936d566f48d8 100644
@@ -185,6 +185,8 @@ period			{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); }
 freq			{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ); }
 branch_type		{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE); }
 time			{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_TIME); }
+call-graph		{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CALLGRAPH); }
+stack-size		{ return term(yyscanner, PARSE_EVENTS__TERM_TYPE_STACKSIZE); }
 ,			{ return ','; }
 "/"			{ BEGIN(INITIAL); return '/'; }
 {name_minus}		{ return str(yyscanner, PE_NAME); }
tools/perf/util/pmu.c +3 -1
index d85f11b8cacf..84cad054d6f7 100644
@@ -634,7 +634,9 @@ static char *formats_error_string(struct list_head *formats)
 {
 	struct perf_pmu_format *format;
 	char *err, *str;
-	static const char *static_terms = "config,config1,config2,name,period,freq,branch_type,time\n";
+	static const char *static_terms = "config,config1,config2,name,"
+					  "period,freq,branch_type,time,"
+					  "call-graph,stack-size\n";
 	unsigned i = 0;
 
 	if (!asprintf(&str, "valid terms:"))
Signature · 1 line
2.1.0
author maintainer
#11 lore raw

PATCH 11/13 perf callchain: Allow disabling call graphs per event

In reply to Arnaldo Carvalho de Melo

From: Kan Liang <[email protected]>

This patch introduce "call-graph=no" to disable per-event callgraph.

Here is an example.

perf record -e 'cpu/cpu-cycles,call-graph=fp/,cpu/instructions,call-graph=no/' sleep 1

  perf report --stdio

# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 6 of event 'cpu/cpu-cycles,call-graph=fp/' # Event count (approx.): 774218
#

  # Children      Self  Command  Shared Object     Symbol
  # ........  ........  .......  ................  ........................................
  #
    61.94%     0.00%  sleep    [kernel.vmlinux]  [k] entry_SYSCALL_64_fastpath
              |
              ---entry_SYSCALL_64_fastpath
                 |
                 |--97.30%-- __brk
                 |
                  --2.70%-- mmap64
                            _dl_check_map_versions
                            _dl_check_all_versions

    61.94%     0.00%  sleep    [kernel.vmlinux]  [k] perf_event_mmap
              |
              ---perf_event_mmap
                 |
                 |--97.30%-- do_brk
                 |          sys_brk
                 |          entry_SYSCALL_64_fastpath
                 |          __brk
                 |
                  --2.70%-- mmap_region
                            do_mmap_pgoff
                            vm_mmap_pgoff
                            sys_mmap_pgoff
                            sys_mmap
                            entry_SYSCALL_64_fastpath
                            mmap64
                            _dl_check_map_versions
                            _dl_check_all_versions

......

# Samples: 6 of event 'cpu/instructions,call-graph=no/' # Event count (approx.): 359692
#

  # Children      Self  Command  Shared Object     Symbol
  # ........  ........  .......  ................  .................................
  #
     89.03%     0.00%  sleep    [unknown]         [.] 0xffff6598ffff6598
     89.03%     0.00%  sleep    ld-2.17.so        [.] _dl_resolve_conflicts
     89.03%     0.00%  sleep    [kernel.vmlinux]  [k] page_fault
---
 tools/perf/Documentation/perf-record.txt |  3 ++-
 tools/perf/builtin-annotate.c            |  2 ++
 tools/perf/builtin-diff.c                |  3 +++
 tools/perf/tests/hists_cumulate.c        |  4 ++++
 tools/perf/util/evsel.c                  | 17 +++++++++++------
 tools/perf/util/hist.c                   |  9 ++++++---
 6 files changed, 28 insertions(+), 10 deletions(-)
tools/perf/Documentation/perf-record.txt +2 -1
index 7f82dec2b541..347a27322ed8 100644
@@ -54,7 +54,8 @@ OPTIONS
 		    enabling time stamping. 0 for disabling time stamping.
 		    The default is 1.
 	  - 'call-graph': Disable/enable callgraph. Acceptable str are "fp" for
-			 FP mode, "dwarf" for DWARF mode, "lbr" for LBR mode.
+			 FP mode, "dwarf" for DWARF mode, "lbr" for LBR mode and
+			 "no" for disable callgraph.
 	  - 'stack-size': user stack size for dwarf mode
 	  Note: If user explicitly sets options which conflict with the params,
 	  the value set by the params will be overridden.
tools/perf/builtin-annotate.c +2 -0
index 467a23b14e2f..a32a64ef08e2 100644
@@ -239,6 +239,8 @@ static int __cmd_annotate(struct perf_annotate *ann)
 		if (nr_samples > 0) {
 			total_nr_samples += nr_samples;
 			hists__collapse_resort(hists, NULL);
+			/* Don't sort callchain */
+			perf_evsel__reset_sample_bit(pos, CALLCHAIN);
 			hists__output_resort(hists, NULL);
 
 			if (symbol_conf.event_group &&
tools/perf/builtin-diff.c +3 -0
index daaa7dca9c3b..0b180a885ba3 100644
@@ -722,6 +722,9 @@ static void data_process(void)
 		if (verbose || data__files_cnt > 2)
 			data__fprintf();
 
+		/* Don't sort callchain for perf diff */
+		perf_evsel__reset_sample_bit(evsel_base, CALLCHAIN);
+
 		hists__process(hists_base);
 	}
 }
tools/perf/tests/hists_cumulate.c +4 -0
index 7d82c8be5e36..7ed737019de7 100644
@@ -279,6 +279,7 @@ static int test1(struct perf_evsel *evsel, struct machine *machine)
 
 	symbol_conf.use_callchain = false;
 	symbol_conf.cumulate_callchain = false;
+	perf_evsel__reset_sample_bit(evsel, CALLCHAIN);
 
 	setup_sorting();
 	callchain_register_param(&callchain_param);
@@ -425,6 +426,7 @@ static int test2(struct perf_evsel *evsel, struct machine *machine)
 
 	symbol_conf.use_callchain = true;
 	symbol_conf.cumulate_callchain = false;
+	perf_evsel__set_sample_bit(evsel, CALLCHAIN);
 
 	setup_sorting();
 	callchain_register_param(&callchain_param);
@@ -482,6 +484,7 @@ static int test3(struct perf_evsel *evsel, struct machine *machine)
 
 	symbol_conf.use_callchain = false;
 	symbol_conf.cumulate_callchain = true;
+	perf_evsel__reset_sample_bit(evsel, CALLCHAIN);
 
 	setup_sorting();
 	callchain_register_param(&callchain_param);
@@ -665,6 +668,7 @@ static int test4(struct perf_evsel *evsel, struct machine *machine)
 
 	symbol_conf.use_callchain = true;
 	symbol_conf.cumulate_callchain = true;
+	perf_evsel__set_sample_bit(evsel, CALLCHAIN);
 
 	setup_sorting();
 	callchain_register_param(&callchain_param);
tools/perf/util/evsel.c +11 -6
index 6647925d5f28..b096ef7a240c 100644
@@ -651,12 +651,17 @@ static void apply_config_terms(struct perf_evsel *evsel,
 
 		/* parse callgraph parameters */
 		if (callgraph_buf != NULL) {
-			param.enabled = true;
-			if (parse_callchain_record(callgraph_buf, &param)) {
-				pr_err("per-event callgraph setting for %s failed. "
-				       "Apply callgraph global setting for it\n",
-				       evsel->name);
-				return;
+			if (!strcmp(callgraph_buf, "no")) {
+				param.enabled = false;
+				param.record_mode = CALLCHAIN_NONE;
+			} else {
+				param.enabled = true;
+				if (parse_callchain_record(callgraph_buf, &param)) {
+					pr_err("per-event callgraph setting for %s failed. "
+					       "Apply callgraph global setting for it\n",
+					       evsel->name);
+					return;
+				}
 			}
 		}
 		if (dump_size > 0) {
tools/perf/util/hist.c +6 -3
index 6bccfae334b1..1cd785b5b56e 100644
@@ -1109,13 +1109,14 @@ void hists__inc_stats(struct hists *hists, struct hist_entry *h)
 
 static void __hists__insert_output_entry(struct rb_root *entries,
 					 struct hist_entry *he,
-					 u64 min_callchain_hits)
+					 u64 min_callchain_hits,
+					 bool use_callchain)
 {
 	struct rb_node **p = &entries->rb_node;
 	struct rb_node *parent = NULL;
 	struct hist_entry *iter;
 
-	if (symbol_conf.use_callchain)
+	if (use_callchain)
 		callchain_param.sort(&he->sorted_chain, he->callchain,
 				      min_callchain_hits, &callchain_param);
 
@@ -1139,6 +1140,8 @@ void hists__output_resort(struct hists *hists, struct ui_progress *prog)
 	struct rb_node *next;
 	struct hist_entry *n;
 	u64 min_callchain_hits;
+	struct perf_evsel *evsel = hists_to_evsel(hists);
+	bool use_callchain = evsel ? (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) : symbol_conf.use_callchain;
 
 	min_callchain_hits = hists->stats.total_period * (callchain_param.min_percent / 100);
 
@@ -1157,7 +1160,7 @@ void hists__output_resort(struct hists *hists, struct ui_progress *prog)
 		n = rb_entry(next, struct hist_entry, rb_node_in);
 		next = rb_next(&n->rb_node_in);
 
-		__hists__insert_output_entry(&hists->entries, n, min_callchain_hits);
+		__hists__insert_output_entry(&hists->entries, n, min_callchain_hits, use_callchain);
 		hists__inc_stats(hists, n);
 
 		if (!n->filtered)
Signature · 1 line
2.1.0
author maintainer
#12 lore raw

PATCH 12/13 perf report: Show call graph from reference events

In reply to Arnaldo Carvalho de Melo

From: Kan Liang <[email protected]>

Introduce --show-ref-call-graph for perf report to print reference callgraph for no callgraph event.

Here is an example.

perf report --show-ref-call-graph --stdio

# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 5 of event 'cpu/cpu-cycles,call-graph=fp/' # Event count (approx.): 144985
#

 # Children      Self  Command  Shared Object     Symbol
 # ........  ........  .......  ................  ........................................
 #
    72.30%     0.00%  sleep    [kernel.vmlinux]  [k] entry_SYSCALL_64_fastpath
              |
              ---entry_SYSCALL_64_fastpath
                 |
                 |--22.62%-- __GI___libc_nanosleep
                  --77.38%-- [...]

......

# Samples: 6 of event 'cpu/instructions,call-graph=no/', show reference callgraph # Event count (approx.): 172780
#

 # Children      Self  Command  Shared Object     Symbol
 # ........  ........  .......  ................  ........................................
 #
    73.16%     0.00%  sleep    [kernel.vmlinux]  [k] entry_SYSCALL_64_fastpath
              |
              ---entry_SYSCALL_64_fastpath
                 |
                 |--31.44%-- __GI___libc_nanosleep
                  --68.56%-- [...]
---
 tools/perf/Documentation/perf-report.txt | 11 +++++++++++
 tools/perf/builtin-report.c              |  7 +++++++
 tools/perf/ui/browsers/hists.c           |  9 +++++++--
 tools/perf/util/hist.c                   |  7 ++++++-
 tools/perf/util/symbol.h                 |  3 ++-
 5 files changed, 33 insertions(+), 4 deletions(-)
tools/perf/Documentation/perf-report.txt +11 -0
index 7b07d19e2d54..a18ba757a0ed 100644
@@ -359,6 +359,17 @@ OPTIONS
 --full-source-path::
 	Show the full path for source files for srcline output.
 
+--show-ref-call-graph::
+	When multiple events are sampled, it may not be needed to collect
+	callgraphs for all of them. The sample sites are usually nearby,
+	and it's enough to collect the callgraphs on a reference event.
+	So user can use "call-graph=no" event modifier to disable callgraph
+	for other events to reduce the overhead.
+	However, perf report cannot show callgraphs for the event which
+	disable the callgraph.
+	This option extends the perf report to show reference callgraphs,
+	which collected by reference event, in no callgraph event.
+
 include::callchain-overhead-calculation.txt[]
 
 SEE ALSO
tools/perf/builtin-report.c +7 -0
index f301e865001f..62b285e32aa5 100644
@@ -316,6 +316,11 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
 	if (evname != NULL)
 		ret += fprintf(fp, " of event '%s'", evname);
 
+	if (symbol_conf.show_ref_callgraph &&
+	    strstr(evname, "call-graph=no")) {
+		ret += fprintf(fp, ", show reference callgraph");
+	}
+
 	if (rep->mem_mode) {
 		ret += fprintf(fp, "\n# Total weight : %" PRIu64, nr_events);
 		ret += fprintf(fp, "\n# Sort order   : %s", sort_order ? : default_mem_sort_order);
@@ -740,6 +745,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
 			    itrace_parse_synth_opts),
 	OPT_BOOLEAN(0, "full-source-path", &srcline_full_filename,
 			"Show full source file name path for source lines"),
+	OPT_BOOLEAN(0, "show-ref-call-graph", &symbol_conf.show_ref_callgraph,
+		    "Show callgraph from reference event"),
 	OPT_END()
 	};
 	struct perf_data_file file = {
tools/perf/ui/browsers/hists.c +7 -2
index f296b7348449..10c7ec041039 100644
@@ -1267,6 +1267,8 @@ static int hists__browser_title(struct hists *hists,
 	const char *ev_name = perf_evsel__name(evsel);
 	char buf[512];
 	size_t buflen = sizeof(buf);
+	char ref[30] = " show reference callgraph, ";
+	bool enable_ref = false;
 
 	if (symbol_conf.filter_relative) {
 		nr_samples = hists->stats.nr_non_filtered_samples;
@@ -1292,10 +1294,13 @@ static int hists__browser_title(struct hists *hists,
 		}
 	}
 
+	if (symbol_conf.show_ref_callgraph &&
+	    strstr(ev_name, "call-graph=no"))
+		enable_ref = true;
 	nr_samples = convert_unit(nr_samples, &unit);
 	printed = scnprintf(bf, size,
-			   "Samples: %lu%c of event '%s', Event count (approx.): %" PRIu64,
-			   nr_samples, unit, ev_name, nr_events);
+			   "Samples: %lu%c of event '%s',%sEvent count (approx.): %" PRIu64,
+			   nr_samples, unit, ev_name, enable_ref ? ref : " ", nr_events);
 
 
 	if (hists->uid_filter_str)
tools/perf/util/hist.c +6 -1
index 1cd785b5b56e..08b6cd945f1e 100644
@@ -1141,7 +1141,12 @@ void hists__output_resort(struct hists *hists, struct ui_progress *prog)
 	struct hist_entry *n;
 	u64 min_callchain_hits;
 	struct perf_evsel *evsel = hists_to_evsel(hists);
-	bool use_callchain = evsel ? (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) : symbol_conf.use_callchain;
+	bool use_callchain;
+
+	if (evsel && !symbol_conf.show_ref_callgraph)
+		use_callchain = evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN;
+	else
+		use_callchain = symbol_conf.use_callchain;
 
 	min_callchain_hits = hists->stats.total_period * (callchain_param.min_percent / 100);
 
tools/perf/util/symbol.h +2 -1
index b98ce51af142..a4cde92afbad 100644
@@ -106,7 +106,8 @@ struct symbol_conf {
 			filter_relative,
 			show_hist_headers,
 			branch_callstack,
-			has_filter;
+			has_filter,
+			show_ref_callgraph;
 	const char	*vmlinux_name,
 			*kallsyms_name,
 			*source_prefix,
Signature · 1 line
2.1.0
author maintainer
#13 lore raw

PATCH 13/13 perf tests: Add tests to callgraph and time parse

In reply to Arnaldo Carvalho de Melo

From: Kan Liang <[email protected]>

Add tests in tests/parse-events.c to check call-graph and time option.

---
 tools/perf/tests/parse-events.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
tools/perf/tests/parse-events.c +38 -0
index f65bb89e109e..9b6b2b6324a1 100644
@@ -479,6 +479,39 @@ static int test__checkevent_pmu_name(struct perf_evlist *evlist)
 	return 0;
 }
 
+static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel = perf_evlist__first(evlist);
+
+	/* cpu/config=1,call-graph=fp,time,period=100000/ */
+	TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries);
+	TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
+	TEST_ASSERT_VAL("wrong config",  1 == evsel->attr.config);
+	/*
+	 * The period, time and callgraph value gets configured
+	 * within perf_evlist__config,
+	 * while this test executes only parse events method.
+	 */
+	TEST_ASSERT_VAL("wrong period",     0 == evsel->attr.sample_period);
+	TEST_ASSERT_VAL("wrong callgraph",  !(PERF_SAMPLE_CALLCHAIN & evsel->attr.sample_type));
+	TEST_ASSERT_VAL("wrong time",  !(PERF_SAMPLE_TIME & evsel->attr.sample_type));
+
+	/* cpu/config=2,call-graph=no,time=0,period=2000/ */
+	evsel = perf_evsel__next(evsel);
+	TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type);
+	TEST_ASSERT_VAL("wrong config",  2 == evsel->attr.config);
+	/*
+	 * The period, time and callgraph value gets configured
+	 * within perf_evlist__config,
+	 * while this test executes only parse events method.
+	 */
+	TEST_ASSERT_VAL("wrong period",     0 == evsel->attr.sample_period);
+	TEST_ASSERT_VAL("wrong callgraph",  !(PERF_SAMPLE_CALLCHAIN & evsel->attr.sample_type));
+	TEST_ASSERT_VAL("wrong time",  !(PERF_SAMPLE_TIME & evsel->attr.sample_type));
+
+	return 0;
+}
+
 static int test__checkevent_pmu_events(struct perf_evlist *evlist)
 {
 	struct perf_evsel *evsel = perf_evlist__first(evlist);
@@ -1555,6 +1588,11 @@ static struct evlist_test test__events_pmu[] = {
 		.check = test__checkevent_pmu_name,
 		.id    = 1,
 	},
+	{
+		.name  = "cpu/config=1,call-graph=fp,time,period=100000/,cpu/config=2,call-graph=no,time=0,period=2000/",
+		.check = test__checkevent_pmu_partial_time_callgraph,
+		.id    = 2,
+	},
 };
 
 struct terms_test {
Signature · 1 line
2.1.0
#14 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 95 lines · Arnaldo Carvalho de Melo

Hi Ingo,

Please consider applying,

- Arnaldo

The following changes since commit 5f1230c9b80b89f404938ff88dfa64a963f74f2c:

Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-08-12 12:16:11 +0200)

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 71ef150ee06df29c5b427307dc0bacfe06a8baea:

perf tests: Add tests to callgraph and time parse (2015-08-12 13:20:29 -0300)

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

User visible:

- Allow selecting the type of callchains per event, including disabling callchains in all but one entry in an event list, to save space, and also to ask for the callchains collected in one event to be used in other events (Kan Liang)

- Beautify more syscall arguments in 'perf trace': (Arnaldo Carvalho de Melo)
- A bunch more translate file/pathnames from pointers to strings
- Convert numbers to strings for the 'keyctl' syscall 'option' arg.
- Add missing 'clockid' entries

- Fix 'perf probe -L sys_*' as it was not showing all the source code for syscall functions in the kernel (Masami Hiramatsu)

- Make ESC unzoom as well in the hists browser, i.e. in 'report' and 'top', as we're considering repurposing the right and left arrow keys to use in horizontal scrolling, i.e. leave just ESC to be used for what <- works now, and ENTER for what -> does (they are already aliases for ages) (Arnaldo Carvalho de Melo)

Infrastructure fixes:

- Check for SRCLINE_UNKNOWN case in "srcfile" processing (Andi Kleen)

- Wrap the slsmg_{printf,write_nstring} slang functions behing ui_browser, so that we can make the ui_browser based browsers (annotate, menus, hists, etc) UI library agnostic and usable with multiple backends (slang now, GTK+ and others in the future, maybe) (Arnaldo Carvalho de Melo)

----------------------------------------------------------------
Andi Kleen (1):
perf sort: Check for SRCLINE_UNKNOWN case in "srcfile" processing

Arnaldo Carvalho de Melo (7):
perf trace: Associate some more syscall args with the getname beautifier perf trace: Add missing clockid entries
perf trace: Use the FD beautifier for socket syscall fds perf trace: Beautify keyctl's option arg
perf ui browser: Introduce ui_browser__write_nstring()
perf ui browser: Introduce ui_browser__printf()
perf hists browser: Make ESC unzoom as well

Kan Liang (4):
perf callchain: Per-event type selection support perf callchain: Allow disabling call graphs per event perf report: Show call graph from reference events perf tests: Add tests to callgraph and time parse

Masami Hiramatsu (1):
perf probe: Fix to show lines of sys_ functions correctly

 tools/perf/Documentation/perf-record.txt |  4 ++
 tools/perf/Documentation/perf-report.txt | 11 ++++++
 tools/perf/builtin-annotate.c            |  2 +
 tools/perf/builtin-diff.c                |  3 ++
 tools/perf/builtin-report.c              |  7 ++++
 tools/perf/builtin-trace.c               | 54 +++++++++++++++++++------
 tools/perf/tests/hists_cumulate.c        |  4 ++
 tools/perf/tests/parse-events.c          | 38 ++++++++++++++++++
 tools/perf/ui/browser.c                  | 17 +++++++-
 tools/perf/ui/browser.h                  |  3 ++
 tools/perf/ui/browsers/annotate.c        | 43 ++++++++++----------
 tools/perf/ui/browsers/header.c          |  2 +-
 tools/perf/ui/browsers/hists.c           | 54 ++++++++++++-------------
 tools/perf/ui/browsers/map.c             | 11 +++---
 tools/perf/ui/browsers/scripts.c         |  2 +-
 tools/perf/ui/libslang.h                 |  3 ++
 tools/perf/ui/tui/util.c                 |  2 +-
 tools/perf/util/dwarf-aux.c              | 18 ++++++---
 tools/perf/util/evsel.c                  | 67 +++++++++++++++++++++++++++++++-
 tools/perf/util/evsel.h                  |  4 ++
Quoted 8 lines
 tools/perf/util/hist.c                   | 14 +++++--
 tools/perf/util/parse-events.c           | 12 ++++++
 tools/perf/util/parse-events.h           |  2 +
 tools/perf/util/parse-events.l           |  2 +
 tools/perf/util/pmu.c                    |  4 +-
 tools/perf/util/sort.c                   |  2 +
 tools/perf/util/symbol.h                 |  3 +-
 27 files changed, 307 insertions(+), 81 deletions(-)

Pulled, thanks a lot Arnaldo!

Ingo