lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 07 Jul 2009 17:31:25 -0400
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	lkml <linux-kernel@...r.kernel.org>,
	systemtap <systemtap@...rces.redhat.com>,
	kvm <kvm@...r.kernel.org>,
	DLE <dle-develop@...ts.sourceforge.net>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Christoph Hellwig <hch@...radead.org>,
	Tom Zanussi <tzanussi@...il.com>
Subject: Re: [PATCH -tip -v10 7/7] tracing: add kprobe-based event tracer

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

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 :-)

Thank you,

-- 
Masami Hiramatsu

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

e-mail: mhiramat@...hat.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ