Skip to content

Commit

Permalink
uprobes: Allocate ->utask before handler_chain() for tracing handlers
Browse files Browse the repository at this point in the history
uprobe_trace_print() and uprobe_perf_print() need to pass the additional
info to call_fetch() methods, currently there is no simple way to do this.

current->utask looks like a natural place to hold this info, but we need
to allocate it before handler_chain().

This is a bit unfortunate, perhaps we will find a better solution later,
but this is simple and should work right now.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
  • Loading branch information
Oleg Nesterov authored and Steven Rostedt committed Jan 3, 2014
1 parent b079d37 commit 72fd293
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,10 @@ static void handle_swbp(struct pt_regs *regs)
if (unlikely(!test_bit(UPROBE_COPY_INSN, &uprobe->flags)))
goto out;

/* Tracing handlers use ->utask to communicate with fetch methods */
if (!get_utask())
goto out;

handler_chain(uprobe, regs);
if (can_skip_sstep(uprobe, regs))
goto out;
Expand Down

0 comments on commit 72fd293

Please sign in to comment.