public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Ingo Molnar <mingo@elte.hu>, lkml<linux-kernel@vger.kernel.org>
Cc: systemtap<systemtap@sources.redhat.com>,
	        DLE<dle-develop@lists.sourceforge.net>,
	        Masami Hiramatsu <mhiramat@redhat.com>,
	Ingo Molnar <mingo@elte.hu>,
	        Paul Mackerras <paulus@samba.org>,
	        Arnaldo Carvalho de Melo <acme@redhat.com>,
	        Peter Zijlstra <peterz@infradead.org>,
	Mike Galbraith <efault@gmx.de>,
	        Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH -tip 3/7] perf probe: Use the last field name as the argument 	name
Date: Mon, 29 Mar 2010 20:30:00 -0000	[thread overview]
Message-ID: <20100329203804.2577.14597.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20100329203736.2577.56018.stgit@localhost6.localdomain6>

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.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
---

 tools/perf/Documentation/perf-probe.txt |    2 +-
 tools/perf/util/probe-event.c           |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index 0657cf4..d781fc5 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -87,7 +87,7 @@ Each probe argument follows below syntax.
 
  [NAME=]LOCALVAR|$retval|%REG|@SYMBOL
 
-'NAME' specifies the name of this argument (optional). You can use the name of local variable, local data structure member (e.g. var->field, var.field2), or kprobe-tracer argument format (e.g. $retval, %ax, etc).
+'NAME' specifies the name of this argument (optional). You can use the name of local variable, local data structure member (e.g. var->field, var.field2), or kprobe-tracer argument format (e.g. $retval, %ax, etc). Note that the name of this argument will be set as the last member name if you specify a local data structure member (e.g. field2 for 'var->field1.field2'.)
 
 LINE SYNTAX
 -----------
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index ab6f53d..19de8b7 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 */


-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

  reply	other threads:[~2010-03-29 20:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 20:30 [PATCH -tip 0/7] perf-probe updates - data-structure support improvements, etc Masami Hiramatsu
2010-03-29 20:30 ` Masami Hiramatsu [this message]
2010-03-29 20:30 ` [PATCH -tip 1/7] [BUGFIX] perf probe: Fix to close dwarf when failing to analyze it Masami Hiramatsu
2010-03-29 20:30 ` [PATCH -tip 2/7] perf probe: Support argument name Masami Hiramatsu
2010-03-29 20:31 ` [PATCH -tip 4/7] trace/kprobes: Support basic types Masami Hiramatsu
2010-03-29 20:31 ` [PATCH -tip 5/7] perf probe: Query basic types from debuginfo Masami Hiramatsu
2010-03-29 20:51   ` Arnaldo Carvalho de Melo
2010-03-29 21:22     ` Masami Hiramatsu
     [not found]       ` <20100329215009.GA2851@ghostprotocols.net>
2010-03-29 22:05         ` Masami Hiramatsu
2010-03-29 22:25           ` Arnaldo Carvalho de Melo
2010-03-29 20:31 ` [PATCH -tip 7/7] perf probe: Support DW_OP_call_frame_cfa in debuginfo Masami Hiramatsu
2010-03-29 20:40 ` [PATCH -tip 6/7] perf probe: Support basic type casting Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100329203804.2577.14597.stgit@localhost6.localdomain6 \
    --to=mhiramat@redhat.com \
    --cc=acme@redhat.com \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).