Skip to contentSkip to conversation

perf trace: Use vfs_getname hook if available

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Oct 23, 2013 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  c522739d72a341a3e74a369ce6298b9412813d3f
Gitweb:     http://git.kernel.org/tip/c522739d72a341a3e74a369ce6298b9412813d3f
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 27 Sep 2013 18:06:19 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 16 Oct 2013 11:18:24 -0300

perf trace: Use vfs_getname hook if available

Initially it tries to find a probe:vfs_getname that should be setup with:

perf probe 'vfs_getname=getname_flags:65 pathname=result->name:string'

or with slight changes to cope with code flux in the getname_flags code.

In the future, if a "vfs:getname" tracepoint becomes available, then it will be preferred.

This is not strictly required and more expensive method of reading the /proc/pid/fd/ symlink will be used when the fd->path array entry is not populated by a previous vfs_getname + open syscall ret sequence.

As with any other 'perf probe' probe the setup must be done just once and the probe will be left inactive, waiting for users, be it 'perf trace' of any other tool.

Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Masami Hiramatsu <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/Documentation/perf-trace.txt |  4 ++
 tools/perf/builtin-trace.c              | 83 ++++++++++++++++++++++++++++-----
 2 files changed, 75 insertions(+), 12 deletions(-)
tools/perf/Documentation/perf-trace.txt +4 -0
index 54139c6..7b0497f 100644
@@ -97,6 +97,10 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
 	Show a summary of syscalls by thread with min, max, and average times (in
     msec) and relative stddev.
 
+--tool_stats::
+	Show tool stats such as number of times fd->pathname was discovered thru
+	hooking the open syscall return + vfs_getname or via reading /proc/pid/fd, etc.
+
 SEE ALSO
 --------
 linkperf:perf-record[1], linkperf:perf-script[1]
tools/perf/builtin-trace.c +71 -12

177 lines not on this page · raw message