From: Masami Hiramatsu on
Mark Wielaard wrote:
> On Tue, 2010-03-16 at 18:06 -0400, Masami Hiramatsu wrote:
>> Support accessing members in the data structures. With this,
>> perf-probe accepts data-structure members(IOW, it now accepts
>> dot '.' and arrow '->' operators) as probe arguemnts.
>>
>> e.g.
>>
>> ./perf probe --add 'schedule:44 rq->curr'
>>
>> ./perf probe --add 'vfs_read file->f_op->read file->f_path.dentry'
>>
>> Note that '>' can be interpreted as redirection in command-line.
>
> If you find that a problem then you can do like SystemTap does and allow
> '.' in place of '->'. In the code you already use the
> perf_probe_arg_field ref flag only to check that the DIE gives you the
> same information. So you could just drop that and use any separator.
> Then you decide based on whether you see a DW_TAG_pointer_type. This
> gives the user some extra flexibility by letting them not having to care
> about specifying extra type information already available elsewhere.

Thanks, when designing this feature, I considered it too.

Since perf probe already support displaying source code by --line option,
users will read the probed code itself and try to probe it. In that case,
I think they naturally use '.' and '->' as they read (they might try to
copy & paste it).

So, I think that it would be good to support both of '.' and '->' as
they are used in the code, because it will not confuse users.

Thank you,

--
Masami Hiramatsu
e-mail: mhiramat(a)redhat.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/