From: Namhyung Kim <namhyung@kernel.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
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: [PATCH 13/13] tracing/uprobes: Add support for full argument access methods
Date: Wed, 28 Aug 2013 14:41:08 +0900 [thread overview]
Message-ID: <87d2oyv0cr.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <521C9385.8070201@hitachi.com> (Masami Hiramatsu's message of "Tue, 27 Aug 2013 20:54:45 +0900")
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;
Thanks,
Namhyung
next prev parent reply other threads:[~2013-08-28 5:41 UTC|newest]
Thread overview: 24+ 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 [this message]
2013-08-28 11:17 ` Masami Hiramatsu
-- strict thread matches above, loose matches on Subject: below --
2013-10-29 6:53 [PATCHSET 00/13] tracing/uprobes: Add support for more fetch methods (v6) Namhyung Kim
2013-10-29 6:53 ` [PATCH 13/13] tracing/uprobes: Add support for full argument access methods Namhyung Kim
2013-09-03 5:44 [PATCHSET 00/13] tracing/uprobes: Add support for more fetch methods (v5) Namhyung Kim
2013-09-03 5:44 ` [PATCH 13/13] tracing/uprobes: Add support for full argument access methods Namhyung Kim
2013-09-03 9:48 ` Masami Hiramatsu
2013-08-09 8:44 [PATCHSET 00/13] tracing/uprobes: Add support for more fetch methods (v3) Namhyung Kim
2013-08-09 8:45 ` [PATCH 13/13] tracing/uprobes: Add support for full argument access methods Namhyung Kim
2013-08-09 10:23 ` 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=87d2oyv0cr.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=acme@ghostprotocols.net \
--cc=cheol.lee@lge.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=namhyung.kim@lge.com \
--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
Powered by JetHome