From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Namhyung Kim <namhyung.kim@lge.com>,
Hyeoncheol Lee <cheol.lee@lge.com>,
LKML <linux-kernel@vger.kernel.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Oleg Nesterov <oleg@redhat.com>,
"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Subject: Re: Re: [PATCH 13/13] tracing/uprobes: Add support for full argument access methods
Date: Wed, 28 Aug 2013 20:17:18 +0900 [thread overview]
Message-ID: <521DDC3E.8020503@hitachi.com> (raw)
In-Reply-To: <87d2oyv0cr.fsf@sejong.aot.lge.com>
(2013/08/28 14:41), Namhyung Kim wrote:
> On Tue, 27 Aug 2013 20:54:45 +0900, Masami Hiramatsu wrote:
>> (2013/08/27 17:48), Namhyung Kim wrote:
>>> @@ -315,13 +316,18 @@ static int parse_probe_vars(char *arg, const struct fetch_type *t,
>>> ret = -EINVAL;
>>> } else if (strncmp(arg, "stack", 5) == 0) {
>>> if (arg[5] == '\0') {
>>> - if (strcmp(t->name, DEFAULT_FETCH_TYPE_STR) == 0)
>>> - f->fn = fetch_stack_address;
>>> - else
>>> - ret = -EINVAL;
>>> + if (strcmp(t->name, DEFAULT_FETCH_TYPE_STR))
>>> + return -EINVAL;
>>> +
>>> + if (is_kprobe)
>>> + f->fn = fetch_kernel_stack_address;
>>> + else {
>>> + f->fn = t->fetch[FETCH_MTD_stack];
>>> + f->data = (void *)0;
>>> + }
>>
>> No, the 'stack' means the address of the stack frame. Perhaps you might make a
>> new function to retrieve it from pt_regs.
>
> Hmm.. right. How about this?
>
>
> static __kprobes void fetch_user_stack_address(struct pt_regs *regs,
> void *dummy, void *dest, void *priv)
> {
> *(unsigned long *)dest = user_stack_pointer(regs);
> }
>
>
> ...
>
> if (is_kprobe)
> f->fn = fetch_kernel_stack_address;
> else
> f->fn = fetch_user_stack_address;
Yeah, this looks good for me ;)
Thank you!
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
prev parent reply other threads:[~2013-08-28 11:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-27 8:48 [PATCHSET 00/13] tracing/uprobes: Add support for more fetch methods (v4) Namhyung Kim
2013-08-27 8:48 ` [PATCH 01/13] tracing/uprobes: Fix documentation of uprobe registration syntax Namhyung Kim
2013-08-27 8:48 ` [PATCH 02/13] tracing/probes: Fix basic print type functions Namhyung Kim
2013-08-27 8:48 ` [PATCH 03/13] tracing/kprobes: Move fetch functions to trace_kprobe.c Namhyung Kim
2013-08-27 8:48 ` [PATCH 04/13] tracing/kprobes: Add fetch{,_size} member into deref fetch method Namhyung Kim
2013-08-27 8:48 ` [PATCH 05/13] tracing/kprobes: Staticize stack and memory fetch functions Namhyung Kim
2013-08-27 8:48 ` [PATCH 06/13] tracing/kprobes: Factor out struct trace_probe Namhyung Kim
2013-08-27 8:48 ` [PATCH 07/13] tracing/uprobes: Convert to " Namhyung Kim
2013-08-27 8:48 ` [PATCH 08/13] tracing/kprobes: Move common functions to trace_probe.h Namhyung Kim
2013-08-27 8:48 ` [PATCH 09/13] tracing/kprobes: Integrate duplicate set_print_fmt() Namhyung Kim
2013-08-27 8:48 ` [PATCH 10/13] tracing/uprobes: Fetch args before reserving a ring buffer Namhyung Kim
2013-08-27 8:48 ` [PATCH 11/13] tracing/kprobes: Add priv argument to fetch functions Namhyung Kim
2013-08-27 8:48 ` [PATCH 12/13] tracing/uprobes: Add more " Namhyung Kim
2013-08-27 12:03 ` Masami Hiramatsu
2013-08-28 5:37 ` Namhyung Kim
2013-08-27 8:48 ` [PATCH 13/13] tracing/uprobes: Add support for full argument access methods Namhyung Kim
2013-08-27 11:54 ` Masami Hiramatsu
2013-08-28 5:41 ` Namhyung Kim
2013-08-28 11:17 ` Masami Hiramatsu [this message]
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=521DDC3E.8020503@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=acme@ghostprotocols.net \
--cc=cheol.lee@lge.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.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
all inboxes | Powered by JetHome®