lkml.org 
[lkml]   [2013]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 16/17] uprobes: Allocate ->utask before handler_chain() for tracing handlers
    (2013/12/09 15:20), Namhyung Kim wrote:
    > From: Oleg Nesterov <oleg@redhat.com>
    >
    > 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 simnple and should work right now.

    Hmm, when this will happen? and isn't it better to increment
    miss-hit counter of the uprobe?

    Thank you,

    >
    > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    > Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
    > Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
    > ---
    > kernel/events/uprobes.c | 4 ++++
    > 1 file changed, 4 insertions(+)
    >
    > diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
    > index 24b7d6ca871b..3cc8e0bb8acf 100644
    > --- a/kernel/events/uprobes.c
    > +++ b/kernel/events/uprobes.c
    > @@ -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;
    >


    --
    Masami HIRAMATSU
    IT Management Research Dept. Linux Technology Center
    Hitachi, Ltd., Yokohama Research Laboratory
    E-mail: masami.hiramatsu.pt@hitachi.com




    \
     
     \ /
      Last update: 2013-12-10 13:01    [W:4.404 / U:0.332 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site