lkml.org 
[lkml]   [2013]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 13/13] tracing/uprobes: Add support for full argument access methods
Date
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


\
 
 \ /
  Last update: 2013-08-28 08:21    [W:0.187 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site