public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
	        lkml <linux-kernel@vger.kernel.org>,
	        systemtap <systemtap@sources.redhat.com>,
	kvm <kvm@vger.kernel.org>,
	        DLE <dle-develop@lists.sourceforge.net>,
	        Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	        Christoph Hellwig <hch@infradead.org>,
	        Tom Zanussi <tzanussi@gmail.com>
Subject: Re: [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer
Date: Tue, 07 Jul 2009 21:39:00 -0000	[thread overview]
Message-ID: <4A53C144.20807@redhat.com> (raw)
In-Reply-To: <20090707213447.GC7412@nowhere>

Frederic Weisbecker wrote:
> On Tue, Jul 07, 2009 at 05:31:25PM -0400, Masami Hiramatsu wrote:
>> Frederic Weisbecker wrote:
>>> On Tue, Jul 07, 2009 at 04:42:32PM -0400, Masami Hiramatsu wrote:
>>>> Frederic Weisbecker wrote:
>>>>> On Tue, Jul 07, 2009 at 03:55:28PM -0400, Masami Hiramatsu wrote:
>>>>>> Frederic Weisbecker wrote:
>>>>>>>> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
>>>>>>>> index 206cb7d..65945eb 100644
>>>>>>>> --- a/kernel/trace/trace.h
>>>>>>>> +++ b/kernel/trace/trace.h
>>>>>>>> @@ -45,6 +45,8 @@ enum trace_type {
>>>>>>>>  	TRACE_POWER,
>>>>>>>>  	TRACE_BLK,
>>>>>>>>  	TRACE_KSYM,
>>>>>>>> +	TRACE_KPROBE,
>>>>>>>> +	TRACE_KRETPROBE,
>>>>>>>>  
>>>>>>>>  	__TRACE_LAST_TYPE,
>>>>>>>>  };
>>>>>>>> @@ -227,6 +229,22 @@ struct trace_ksym {
>>>>>>>>  	char			ksym_name[KSYM_NAME_LEN];
>>>>>>>>  	char			p_name[TASK_COMM_LEN];
>>>>>>>>  };
>>>>>>>> +#define TRACE_KPROBE_ARGS 6
>>>>>>>> +
>>>>>>>> +struct kprobe_trace_entry {
>>>>>>>> +	struct trace_entry	ent;
>>>>>>>> +	unsigned long		ip;
>>>>>>>> +	int			nargs;
>>>>>>>> +	unsigned long		args[TRACE_KPROBE_ARGS];
>>>>>>> I see that you actually make use of arg as a dynamic sizeable
>>>>>>> array.
>>>>>>> For clarity, args[TRACE_KPROBE_ARGS] could be args[0].
>>>>>>>
>>>>>>> It's just a neat and wouldn't affect the code nor the data
>>>>>>> but would be clearer for readers of that code.
>>>>>> Hmm. In that case, I think we'll need a new macro for field
>>>>>> definition, like TRACE_FIELD_ZERO(type, item).
>>>>>
>>>>> You mean that for trace_define_field() to describe fields of events?
>>>>> Actually the fields should be defined dynamically depending on how
>>>>> is built the kprobe event (which arguments are requested, how many,
>>>>> etc..).
>>>> Yeah, if you specified a probe point with its event name, the tracer
>>>> will make a corresponding event dynamically. There are also anonymous
>>>> probes which don't have corresponding events. For those anonymous
>>>> probes, I need to define two generic event types(kprobe and kretprobe).
>>>>
>>>> Thank you,
>>>
>>> Ok. Btw, why do you need to define those two anonymous events?
>>> Actually your event types are always dynamically created.
>>> Those you defined through TRACE_FORMAT_EVENT are only "ghost events",
>>> they only stand there as a abstract pattern, right?
>>>
>> Not always created.
>>
>> Below command will create an event "event1";
>> p probe_point:event1 a1 a2 a3 ... > /debug/tracing/kprobe_events
>>
>> But next command doesn't create.
>> p probe_point a1 a2 a3 ... > /debug/tracing/kprobe_events
> 
> 
> Aah, ok.
> 
> 
>> This just inserts a kprobe to probe_point. the advantage of this
>> "simple" command is that you never be annoyed by making different
>> name for new events :-)
> 
> 
> Indeed.
> But speaking about that, may be you could dynamically create a name
> following this simple model: func+offset
> Unless we can set several kprobes on the exact same address?

Actually, we can...
I thought that someone might want to insert events in the same
address for retrieving more than 6 arguments.

Thanks,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

  reply	other threads:[~2009-07-07 21:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01  1:05 [PATCH -tip -v10 0/7] tracing: kprobe-based event tracer and x86 instruction decoder Masami Hiramatsu
2009-07-01  1:05 ` [PATCH -tip -v10 2/7] x86: x86 instruction decoder build-time selftest Masami Hiramatsu
2009-07-01  1:05 ` [PATCH -tip -v10 1/7] x86: instruction decoder API Masami Hiramatsu
2009-07-01  1:06 ` [PATCH -tip -v10 3/7] kprobes: checks probe address is instruction boudary on x86 Masami Hiramatsu
2009-07-01  1:06 ` [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer Masami Hiramatsu
     [not found]   ` <20090707073103.GA6173@nowhere>
2009-07-07 19:52     ` Masami Hiramatsu
2009-07-07 20:20       ` Frederic Weisbecker
2009-07-07 20:39         ` Masami Hiramatsu
2009-07-07 20:59           ` Frederic Weisbecker
2009-07-07 21:28             ` Masami Hiramatsu
2009-07-07 21:35               ` Frederic Weisbecker
2009-07-07 21:39                 ` Masami Hiramatsu [this message]
2009-07-07 21:58                   ` Masami Hiramatsu
2009-07-01  1:06 ` [PATCH -tip -v10 4/7] kprobes: cleanup fix_riprel() using insn decoder on x86 Masami Hiramatsu
2009-07-01  1:17 ` [PATCH -tip -v10 6/7] tracing: ftrace dynamic ftrace_event_call support Masami Hiramatsu
2009-07-06  2:00   ` Frederic Weisbecker
2009-07-01  1:17 ` [PATCH -tip -v10 5/7] x86: add pt_regs register and stack access APIs Masami Hiramatsu
2009-07-06  1:42   ` Frederic Weisbecker
2009-07-06 14:37   ` Andi Kleen
2009-07-06 19:25     ` Masami Hiramatsu
2009-07-06 20:06       ` Andi Kleen
2009-07-07  0:04         ` 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=4A53C144.20807@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=ananth@in.ibm.com \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=fweisbec@gmail.com \
    --cc=hch@infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=systemtap@sources.redhat.com \
    --cc=tzanussi@gmail.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).