summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-event.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2010-04-12 19:17:00 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-14 22:26:14 +0200
commitdf0faf4be02996135bc3a06b4f34360449c78084 (patch)
treea881d7b195d1759e470c0c024c52221508067ebf /tools/perf/util/probe-event.c
parentperf probe: Support argument name (diff)
downloadlinux-df0faf4be02996135bc3a06b4f34360449c78084.tar.xz
linux-df0faf4be02996135bc3a06b4f34360449c78084.zip
perf probe: Use the last field name as the argument name
Set the last field name to the argument name when the argument is refering a data-structure member. e.g. ./perf probe --add 'vfs_read file->f_mode' Add new event: probe:vfs_read (on vfs_read with f_mode=file->f_mode) This probe records file->f_mode, but the argument name becomes "f_mode". This enables perf-trace command to parse trace event format correctly. Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20100412171700.3790.72961.stgit@localhost6.localdomain6> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r--tools/perf/util/probe-event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index ab6f53deabad..19de8b77973d 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -481,6 +481,10 @@ static void parse_perf_probe_arg(const char *str, struct perf_probe_arg *arg)
} while (tmp);
(*fieldp)->name = xstrdup(str);
pr_debug("%s(%d)\n", (*fieldp)->name, (*fieldp)->ref);
+
+ /* If no name is specified, set the last field name */
+ if (!arg->name)
+ arg->name = xstrdup((*fieldp)->name);
}
/* Parse perf-probe event command */