Re: [RFC] [PATCH 0/7] UBP, XOL and Uprobes

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jim Keniston
Date: Monday, January 11, 2010 - 3:59 pm

On Mon, 2010-01-11 at 09:35 -0500, Masami Hiramatsu wrote:
...

Return probes are on the TODO list, but we actually already have a
pretty solid implementation of that.  It's held out for now because
Srikar's patch set is already big, and we want get a review of the basic
ubp/xol/uprobes feature.

For the most part, we don't need special symbol information for return
probes.  We just do as we did in kretprobes: hijack the return address
and replace it with the address of a trampoline.  In user-space return
probes, the trampoline is one of the instruction slots in the XOL vma,
and contains a breakpoint to trap us into the kernel.  (Of course, as in
kretprobes, we need to know the address of the function so we can hijack
the return address upon entry to the function.)

One place where symbol info would come in handy is when a function
returns in a weird way.  We handle longjmps by noticing that the task's
stack is smaller than expected, and presumably missing stack frames that
were bypassed by the longjmp.  But this heuristic gets dicey when you
consider that in a 32-bit x86 app, a struct-returning function pops not
only the return address upon return, but also the address of the
returned struct value.  So it'd be nice to know if a function returns a
struct.

Does this answer your question, or did I miss something?


Yes, I think that's what Srikar meant: avoid single-stepping by adding a
jump instruction after the instruction-copy in the XOL slot -- as you
did in your kprobes-booster work.  Your instruction-analysis work makes
this much more feasible.


Jim Keniston

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] [PATCH 0/7] UBP, XOL and Uprobes, Srikar Dronamraju, (Mon Jan 11, 5:25 am)
[RFC] [PATCH 1/7] User Space Breakpoint Assistance Layer (UBP), Srikar Dronamraju, (Mon Jan 11, 5:25 am)
[RFC] [PATCH 2/7] x86 support for UBP, Srikar Dronamraju, (Mon Jan 11, 5:25 am)
[RFC] [PATCH 3/7] Execution out of line (XOL), Srikar Dronamraju, (Mon Jan 11, 5:25 am)
[RFC] [PATCH 4/7] Uprobes Implementation, Srikar Dronamraju, (Mon Jan 11, 5:25 am)
[RFC] [PATCH 5/7] X86 Support for Uprobes, Srikar Dronamraju, (Mon Jan 11, 5:25 am)
[RFC] [PATCH 6/7] Uprobes Documentation, Srikar Dronamraju, (Mon Jan 11, 5:26 am)
[RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Srikar Dronamraju, (Mon Jan 11, 5:26 am)
Re: [RFC] [PATCH 0/7] UBP, XOL and Uprobes, Masami Hiramatsu, (Mon Jan 11, 7:35 am)
Re: [RFC] [PATCH 0/7] UBP, XOL and Uprobes, Jim Keniston, (Mon Jan 11, 3:59 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Paul E. McKenney, (Mon Jan 11, 7:01 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Frederic Weisbecker, (Mon Jan 11, 9:54 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Steven Rostedt, (Mon Jan 11, 10:08 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Frederic Weisbecker, (Mon Jan 11, 10:36 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Frederic Weisbecker, (Mon Jan 11, 10:44 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Ananth N Mavinakayan ..., (Tue Jan 12, 1:14 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Srikar Dronamraju, (Tue Jan 12, 1:21 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Srikar Dronamraju, (Tue Jan 12, 1:54 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Frank Ch. Eigler, (Tue Jan 12, 11:54 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Tim Bird, (Tue Jan 12, 12:12 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Masami Hiramatsu, (Tue Jan 12, 3:00 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Frank Ch. Eigler, (Tue Jan 12, 3:15 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Masami Hiramatsu, (Tue Jan 12, 3:30 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Jim Keniston, (Tue Jan 12, 5:53 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Masami Hiramatsu, (Wed Jan 13, 2:58 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Masami Hiramatsu, (Wed Jan 13, 3:12 pm)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Steven Rostedt, (Wed Jan 13, 4:36 pm)
Re: [RFC] [PATCH 3/7] Execution out of line (XOL), Peter Zijlstra, (Thu Jan 14, 4:08 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Thu Jan 14, 4:09 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Thu Jan 14, 4:12 am)
Re: [RFC] [PATCH 5/7] X86 Support for Uprobes, Peter Zijlstra, (Thu Jan 14, 4:13 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Peter Zijlstra, (Thu Jan 14, 4:23 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Peter Zijlstra, (Thu Jan 14, 4:29 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Frederic Weisbecker, (Thu Jan 14, 4:35 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Peter Zijlstra, (Thu Jan 14, 4:43 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Mark Wielaard, (Thu Jan 14, 5:16 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Peter Zijlstra, (Thu Jan 14, 5:19 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Frederic Weisbecker, (Thu Jan 14, 5:23 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Peter Zijlstra, (Thu Jan 14, 5:29 am)
Re: [RFC] [PATCH 3/7] Execution out of line (XOL), Jim Keniston, (Thu Jan 14, 3:43 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Jim Keniston, (Thu Jan 14, 3:49 pm)
Re: [RFC] [PATCH 5/7] X86 Support for Uprobes, Jim Keniston, (Thu Jan 14, 4:07 pm)
Re: [RFC] [PATCH 3/7] Execution out of line (XOL), Peter Zijlstra, (Fri Jan 15, 2:07 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 2:10 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Frank Ch. Eigler, (Fri Jan 15, 2:26 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 2:35 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Ananth N Mavinakayan ..., (Fri Jan 15, 2:38 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Ananth N Mavinakayan ..., (Fri Jan 15, 3:10 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Ananth N Mavinakayan ..., (Fri Jan 15, 3:22 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Srikar Dronamraju, (Fri Jan 15, 3:26 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 3:33 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Maneesh Soni, (Fri Jan 15, 4:05 am)
Re: [RFC] [PATCH 3/7] Execution out of line (XOL), Srikar Dronamraju, (Fri Jan 15, 4:12 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 4:12 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 4:18 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Srikar Dronamraju, (Fri Jan 15, 6:08 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Frank Ch. Eigler, (Fri Jan 15, 6:10 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 6:16 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 6:25 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 6:38 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Frank Ch. Eigler, (Fri Jan 15, 6:38 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 6:47 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Frank Ch. Eigler, (Fri Jan 15, 7:00 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 7:06 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Srikar Dronamraju, (Fri Jan 15, 7:20 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Frank Ch. Eigler, (Fri Jan 15, 7:22 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 7:25 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Fri Jan 15, 7:40 am)
Re: [RFC] [PATCH 3/7] Execution out of line (XOL), Jim Keniston, (Fri Jan 15, 1:18 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Jim Keniston, (Fri Jan 15, 3:27 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Jim Keniston, (Fri Jan 15, 4:11 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Jim Keniston, (Fri Jan 15, 4:44 pm)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Peter Zijlstra, (Sat Jan 16, 3:04 am)
Re: [RFC] [PATCH 4/7] Uprobes Implementation, Frank Ch. Eigler, (Sat Jan 16, 8:50 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Srikar Dronamraju, (Mon Jan 18, 5:44 am)
Re: [RFC] [PATCH 7/7] Ftrace plugin for Uprobes, Frederic Weisbecker, (Mon Jan 18, 6:00 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Ananth N Mavinakayan ..., (Mon Jan 18, 8:43 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Ananth N Mavinakayan ..., (Mon Jan 18, 10:10 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Frederic Weisbecker, (Tue Jan 19, 11:06 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Srikar Dronamraju, (Tue Jan 19, 11:36 pm)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Srikar Dronamraju, (Wed Jan 20, 3:45 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Frederic Weisbecker, (Wed Jan 20, 3:51 am)
Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Lay ..., Masami Hiramatsu, (Wed Jan 20, 12:31 pm)
Re: [RFC] [PATCH 0/7] UBP, XOL and Uprobes [ Summary of Co ..., Srikar Dronamraju, (Fri Jan 22, 12:02 am)
Re: [RFC] [PATCH 0/7] UBP, XOL and Uprobes [ Summary of Co ..., Ananth N Mavinakayan ..., (Fri Jan 22, 12:24 am)
Re: [RFC] [PATCH 0/7] UBP, XOL and Uprobes [ Summary of Co ..., Masami Hiramatsu, (Fri Jan 22, 11:36 am)