Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182405
b: refs/heads/master
c: 1e12a4a
h: refs/heads/master
i:
  182403: 9bbf8da
v: v3
  • Loading branch information
Xiao Guangrong authored and Frederic Weisbecker committed Jan 29, 2010
1 parent 6f63454 commit 2212433
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 430ad5a600a83956749307b13257c464c3826b55
refs/heads/master: 1e12a4a7a3a78bc9c3aaf3486dde3b8ab1cdf465
27 changes: 10 additions & 17 deletions trunk/kernel/trace/trace_kprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ static const struct file_operations kprobe_profile_ops = {
};

/* Kprobe handler */
static __kprobes int kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
static __kprobes void kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
{
struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
struct kprobe_trace_entry *entry;
Expand All @@ -962,7 +962,7 @@ static __kprobes int kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
event = trace_current_buffer_lock_reserve(&buffer, call->id, size,
irq_flags, pc);
if (!event)
return 0;
return;

entry = ring_buffer_event_data(event);
entry->nargs = tp->nr_args;
Expand All @@ -972,11 +972,10 @@ static __kprobes int kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)

if (!filter_current_check_discard(buffer, call, entry, event))
trace_nowake_buffer_unlock_commit(buffer, event, irq_flags, pc);
return 0;
}

/* Kretprobe handler */
static __kprobes int kretprobe_trace_func(struct kretprobe_instance *ri,
static __kprobes void kretprobe_trace_func(struct kretprobe_instance *ri,
struct pt_regs *regs)
{
struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
Expand All @@ -995,7 +994,7 @@ static __kprobes int kretprobe_trace_func(struct kretprobe_instance *ri,
event = trace_current_buffer_lock_reserve(&buffer, call->id, size,
irq_flags, pc);
if (!event)
return 0;
return;

entry = ring_buffer_event_data(event);
entry->nargs = tp->nr_args;
Expand All @@ -1006,8 +1005,6 @@ static __kprobes int kretprobe_trace_func(struct kretprobe_instance *ri,

if (!filter_current_check_discard(buffer, call, entry, event))
trace_nowake_buffer_unlock_commit(buffer, event, irq_flags, pc);

return 0;
}

/* Event entry printers */
Expand Down Expand Up @@ -1237,7 +1234,7 @@ static int kretprobe_event_show_format(struct ftrace_event_call *call,
#ifdef CONFIG_PERF_EVENTS

/* Kprobe profile handler */
static __kprobes int kprobe_profile_func(struct kprobe *kp,
static __kprobes void kprobe_profile_func(struct kprobe *kp,
struct pt_regs *regs)
{
struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
Expand All @@ -1252,24 +1249,22 @@ static __kprobes int kprobe_profile_func(struct kprobe *kp,
size -= sizeof(u32);
if (WARN_ONCE(size > FTRACE_MAX_PROFILE_SIZE,
"profile buffer not large enough"))
return 0;
return;

entry = ftrace_perf_buf_prepare(size, call->id, &rctx, &irq_flags);
if (!entry)
return 0;
return;

entry->nargs = tp->nr_args;
entry->ip = (unsigned long)kp->addr;
for (i = 0; i < tp->nr_args; i++)
entry->args[i] = call_fetch(&tp->args[i].fetch, regs);

ftrace_perf_buf_submit(entry, size, rctx, entry->ip, 1, irq_flags);

return 0;
}

/* Kretprobe profile handler */
static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
static __kprobes void kretprobe_profile_func(struct kretprobe_instance *ri,
struct pt_regs *regs)
{
struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
Expand All @@ -1284,11 +1279,11 @@ static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
size -= sizeof(u32);
if (WARN_ONCE(size > FTRACE_MAX_PROFILE_SIZE,
"profile buffer not large enough"))
return 0;
return;

entry = ftrace_perf_buf_prepare(size, call->id, &rctx, &irq_flags);
if (!entry)
return 0;
return;

entry->nargs = tp->nr_args;
entry->func = (unsigned long)tp->rp.kp.addr;
Expand All @@ -1297,8 +1292,6 @@ static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
entry->args[i] = call_fetch(&tp->args[i].fetch, regs);

ftrace_perf_buf_submit(entry, size, rctx, entry->ret_ip, 1, irq_flags);

return 0;
}

static int probe_profile_enable(struct ftrace_event_call *call)
Expand Down

0 comments on commit 2212433

Please sign in to comment.