2014-12-29 20:52:36 +08:00
|
|
|
perf-y += builtin-bench.o
|
2014-12-29 22:13:44 +08:00
|
|
|
perf-y += builtin-annotate.o
|
2015-11-17 21:53:21 +08:00
|
|
|
perf-y += builtin-config.o
|
2014-12-29 22:13:44 +08:00
|
|
|
perf-y += builtin-diff.o
|
|
|
|
perf-y += builtin-evlist.o
|
2013-03-07 20:45:20 +08:00
|
|
|
perf-y += builtin-ftrace.o
|
2014-12-29 22:13:44 +08:00
|
|
|
perf-y += builtin-help.o
|
|
|
|
perf-y += builtin-sched.o
|
|
|
|
perf-y += builtin-buildid-list.o
|
|
|
|
perf-y += builtin-buildid-cache.o
|
2017-01-06 02:33:32 +08:00
|
|
|
perf-y += builtin-kallsyms.o
|
2014-12-29 22:13:44 +08:00
|
|
|
perf-y += builtin-list.o
|
|
|
|
perf-y += builtin-record.o
|
|
|
|
perf-y += builtin-report.o
|
|
|
|
perf-y += builtin-stat.o
|
|
|
|
perf-y += builtin-timechart.o
|
|
|
|
perf-y += builtin-top.o
|
|
|
|
perf-y += builtin-script.o
|
|
|
|
perf-y += builtin-kmem.o
|
|
|
|
perf-y += builtin-lock.o
|
|
|
|
perf-y += builtin-kvm.o
|
|
|
|
perf-y += builtin-inject.o
|
|
|
|
perf-y += builtin-mem.o
|
2015-02-21 06:16:59 +08:00
|
|
|
perf-y += builtin-data.o
|
2015-12-08 12:21:48 +08:00
|
|
|
perf-y += builtin-version.o
|
2016-09-22 23:36:38 +08:00
|
|
|
perf-y += builtin-c2c.o
|
2014-12-29 22:13:44 +08:00
|
|
|
|
|
|
|
perf-$(CONFIG_AUDIT) += builtin-trace.o
|
2014-12-30 06:52:25 +08:00
|
|
|
perf-$(CONFIG_LIBELF) += builtin-probe.o
|
2014-12-29 22:13:44 +08:00
|
|
|
|
2014-12-29 20:52:36 +08:00
|
|
|
perf-y += bench/
|
2014-12-29 22:03:09 +08:00
|
|
|
perf-y += tests/
|
2014-12-29 22:13:44 +08:00
|
|
|
|
2014-12-31 00:09:15 +08:00
|
|
|
perf-y += perf.o
|
|
|
|
|
2014-12-29 22:13:44 +08:00
|
|
|
paths += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))"
|
|
|
|
paths += -DPERF_INFO_PATH="BUILD_STR($(infodir_SQ))"
|
|
|
|
paths += -DPERF_MAN_PATH="BUILD_STR($(mandir_SQ))"
|
|
|
|
|
|
|
|
CFLAGS_builtin-help.o += $(paths)
|
|
|
|
CFLAGS_builtin-timechart.o += $(paths)
|
2015-12-15 23:39:35 +08:00
|
|
|
CFLAGS_perf.o += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" \
|
|
|
|
-DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))" \
|
2017-01-16 23:22:37 +08:00
|
|
|
-DPREFIX="BUILD_STR($(prefix_SQ))"
|
perf trace: Support 'strace' syscall event groups
I.e.:
$ cat ~/share/perf-core/strace/groups/file
access
chmod
creat
execve
faccessat
getcwd
lstat
mkdir
open
openat
quotactl
readlink
rename
rmdir
stat
statfs
symlink
unlink
$
Then, on a quiet desktop, try running this and then moving your mouse to
see the deluge of mouse related activity:
# perf probe 'vfs_getname=getname_flags:72 pathname=filename:string'
Added new event:
probe:vfs_getname (on getname_flags:72 with pathname=filename:string)
You can now use it in all perf tools, such as:
perf record -e probe:vfs_getname -aR sleep 1
#
# trace --ev probe:vfs_getname --filter-pids 2232 -e file
0.042 (0.042 ms): mousetweaks/2235 open(filename: 0x14e3910, mode: 438 ) ...
0.042 ( ): probe:vfs_getname:(ffffffff812230bc) pathname="/home/acme/.icons/Adwaita/cursors/xterm")
0.100 (0.100 ms): mousetweaks/2235 ... [continued]: open()) = -1 ENOENT No such file or directory
0.142 (0.018 ms): mousetweaks/2235 open(filename: 0x14c3c10, mode: 438 ) ...
0.142 ( ): probe:vfs_getname:(ffffffff812230bc) pathname="/home/acme/.icons/Adwaita/index.theme")
0.192 (0.069 ms): mousetweaks/2235 ... [continued]: open()) = -1 ENOENT No such file or directory
0.230 (0.017 ms): mousetweaks/2235 open(filename: 0x14c3c10, mode: 438 ) ...
0.230 ( ): probe:vfs_getname:(ffffffff812230bc) pathname="/usr/share/icons/Adwaita/cursors/xterm")
0.253 (0.041 ms): mousetweaks/2235 ... [continued]: open()) = 14
0.459 (0.008 ms): mousetweaks/2235 open(filename: 0x14e3910, mode: 438 ) ...
0.459 ( ): probe:vfs_getname:(ffffffff812230bc) pathname="/home/acme/.icons/Adwaita/cursors/left_side")
0.468 (0.017 ms): mousetweaks/2235 ... [continued]: open()) = -1 ENOENT No such file or directory
Need to combine that raw_syscalls:sys_enter(open) + probe:vfs_getname +
raw_syscalls:sys_exit(open) sequence...
Now, if you're bored, please write some more syscall groups, like the ones
in 'strace' and send it our way :-)
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Milian Wolff <mail@milianw.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-a42xklu59lcbxp7bbnic74a8@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-07-20 23:02:09 +08:00
|
|
|
CFLAGS_builtin-trace.o += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))"
|
2016-01-07 19:41:53 +08:00
|
|
|
CFLAGS_builtin-report.o += -DTIPDIR="BUILD_STR($(tipdir_SQ))"
|
2016-01-09 18:16:28 +08:00
|
|
|
CFLAGS_builtin-report.o += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
|
2014-12-30 00:42:46 +08:00
|
|
|
|
|
|
|
libperf-y += util/
|
|
|
|
libperf-y += arch/
|
2014-12-30 07:16:01 +08:00
|
|
|
libperf-y += ui/
|
2014-12-30 20:11:32 +08:00
|
|
|
libperf-y += scripts/
|
perf trace: Beautify statx syscall 'flag' and 'mask' arguments
To test it, build samples/statx/test_statx, which I did as:
$ make headers_install
$ cc -I ~/git/linux/usr/include samples/statx/test-statx.c -o /tmp/statx
And then use perf trace on it:
# perf trace -e statx /tmp/statx /etc/passwd
statx(/etc/passwd) = 0
results=7ff
Size: 3496 Blocks: 8 IO Block: 4096 regular file
Device: fd:00 Inode: 280156 Links: 1
Access: (0644/-rw-r--r--) Uid: 0 Gid: 0
Access: 2017-03-29 16:01:01.650073438-0300
Modify: 2017-03-10 16:25:14.156479354-0300
Change: 2017-03-10 16:25:14.171479328-0300
0.000 ( 0.007 ms): statx/30648 statx(dfd: CWD, filename: 0x7ef503f4, flags: SYMLINK_NOFOLLOW, mask: TYPE|MODE|NLINK|UID|GID|ATIME|MTIME|CTIME|INO|SIZE|BLOCKS|BTIME, buffer: 0x7fff7ef4eb10) = 0
#
Using the test-stat.c options to change the mask:
# perf trace -e statx /tmp/statx -O /etc/passwd > /dev/null
0.000 ( 0.008 ms): statx/30745 statx(dfd: CWD, filename: 0x3a0753f4, flags: SYMLINK_NOFOLLOW, mask: BTIME, buffer: 0x7ffd3a0735c0) = 0
#
# perf trace -e statx /tmp/statx -A /etc/passwd > /dev/null
0.000 ( 0.010 ms): statx/30757 statx(dfd: CWD, filename: 0xa94e63f4, flags: SYMLINK_NOFOLLOW|NO_AUTOMOUNT, mask: TYPE|MODE|NLINK|UID|GID|ATIME|MTIME|CTIME|INO|SIZE|BLOCKS|BTIME, buffer: 0x7ffea94e49d0) = 0
#
# trace --no-inherit -e statx /tmp/statx -F /etc/passwd > /dev/null
0.000 ( 0.011 ms): statx(dfd: CWD, filename: 0x3b02d3f3, flags: SYMLINK_NOFOLLOW|STATX_FORCE_SYNC, mask: TYPE|MODE|NLINK|UID|GID|ATIME|MTIME|CTIME|INO|SIZE|BLOCKS|BTIME, buffer: 0x7ffd3b02c850) = 0
#
# trace --no-inherit -e statx /tmp/statx -F -L /etc/passwd > /dev/null
0.000 ( 0.008 ms): statx(dfd: CWD, filename: 0x15cff3f3, flags: STATX_FORCE_SYNC, mask: TYPE|MODE|NLINK|UID|GID|ATIME|MTIME|CTIME|INO|SIZE|BLOCKS|BTIME, buffer: 0x7fff15cfdda0) = 0
#
# trace --no-inherit -e statx /tmp/statx -D -O /etc/passwd > /dev/null
0.000 ( 0.009 ms): statx(dfd: CWD, filename: 0xfa37f3f3, flags: SYMLINK_NOFOLLOW|STATX_DONT_SYNC, mask: BTIME, buffer: 0x7ffffa37da20) = 0
#
Adding a probe to get the filename collected as well:
# perf probe 'vfs_getname=getname_flags:72 pathname=result->name:string'
Added new event:
probe:vfs_getname (on getname_flags:72 with pathname=result->name:string)
You can now use it in all perf tools, such as:
perf record -e probe:vfs_getname -aR sleep 1
# trace --no-inherit -e statx /tmp/statx -D -O /etc/passwd > /dev/null
0.169 ( 0.007 ms): statx(dfd: CWD, filename: /etc/passwd, flags: SYMLINK_NOFOLLOW|STATX_DONT_SYNC, mask: BTIME, buffer: 0x7ffda9bf50f0) = 0
#
Same technique could be used to collect and beautify the result put in
the 'buffer' argument.
Finally do a system wide 'perf trace' session looking for any use of statx,
then run the test proggie with various flags:
# trace -e statx
16612.967 ( 0.028 ms): statx/4562 statx(dfd: CWD, filename: /tmp/statx, flags: SYMLINK_NOFOLLOW, mask: TYPE|MODE|NLINK|UID|GID|ATIME|MTIME|CTIME|INO|SIZE|BLOCKS|BTIME, buffer: 0x7ffef195d660) = 0
33064.447 ( 0.011 ms): statx/4569 statx(dfd: CWD, filename: /tmp/statx, flags: SYMLINK_NOFOLLOW|STATX_FORCE_SYNC, mask: TYPE|MODE|NLINK|UID|GID|ATIME|MTIME|CTIME|INO|SIZE|BLOCKS|BTIME, buffer: 0x7ffc5484c790) = 0
36050.891 ( 0.023 ms): statx/4576 statx(dfd: CWD, filename: /tmp/statx, flags: SYMLINK_NOFOLLOW, mask: BTIME, buffer: 0x7ffeb18b66e0) = 0
38039.889 ( 0.023 ms): statx/4584 statx(dfd: CWD, filename: /tmp/statx, flags: SYMLINK_NOFOLLOW, mask: TYPE|MODE|NLINK|UID|GID|ATIME|MTIME|CTIME|INO|SIZE|BLOCKS|BTIME, buffer: 0x7fff1db0ea90) = 0
^C#
This one also starts moving the beautifiers from files directly included
in builtin-trace.c to separate objects + a beauty.h header with
prototypes, so that we can add test cases in tools/perf/tests/ to fire
syscalls with various arguments and then get them intercepted as
syscalls:sys_enter_foo or raw_syscalls:sys_enter + sys_exit to then
format and check that the formatted output is the one we expect.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: David Ahern <dsahern@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-xvzw8eynffvez5czyzidhrno@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-03-15 03:19:30 +08:00
|
|
|
libperf-y += trace/beauty/
|
2014-12-30 07:34:23 +08:00
|
|
|
|
|
|
|
gtk-y += ui/gtk/
|