Re: [PATCH 2/2] Kprobes: Move kprobes examples to samples/

2008-02-04 Thread Abhishek Sagar
On 2/5/08, Ananth N Mavinakayanahalli <[EMAIL PROTECTED]> wrote: > + * Build and insert the kernel module as done in the kprobe example. > + * You will see the trace data in /var/log/messages and on the console > + * whenever sys_open() returns a negative value. A passing observation"sys_open

[PATCH] ktime: Allow ktime_t comparison using ktime_compare

2008-02-02 Thread Abhishek Sagar
Add a timespec style comparison function. Allows two ktime types to be compared without having to convert to timespec/timeval. Useful for modules doing ktime based math, especially the ones using ktime_get heavily. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> --- diff --git a/include

Re: [PATCH 0/3][RFC] x86: Catch stray non-kprobe breakpoints

2008-01-29 Thread Abhishek Sagar
On 1/29/08, Masami Hiramatsu <[EMAIL PROTECTED]> wrote: > In that case, why don't you just reduce the priority of kprobe_exceptions_nb? > Then, the execution path becomes very simple. Ananth mentioned that the kprobe notifier has to be the first to run. It still wouldnt allow us to notice breakpoi

Re: [PATCH 0/3][RFC] x86: Catch stray non-kprobe breakpoints

2008-01-29 Thread Abhishek Sagar
On 1/29/08, Ananth N Mavinakayanahalli <[EMAIL PROTECTED]> wrote: > > May be I'm completely off the mark here, but shouldn't a small subset > > of this section simply be 'breakpoint-free' rather than 'kprobe-free'? > > Placing a breakpoint on kprobe_handler (say) can loop into a recursive > > trap

Re: [PATCH 0/3][RFC] x86: Catch stray non-kprobe breakpoints

2008-01-29 Thread Abhishek Sagar
On 1/29/08, Ananth N Mavinakayanahalli <[EMAIL PROTECTED]> wrote: > > Non kprobe breakpoints in the kernel might lie inside the .kprobes.text > > section. Such breakpoints can easily be identified by in_kprobes_functions > > and can be caught early. These are problematic and a warning should be

Re: [PATCH 3/3] x86: WARN_ON breakpoints from .kprobes.text section

2008-01-28 Thread Abhishek Sagar
iew it shouldn't matter. In any case, nothing can be done if the kprobe exception notifier is circumvented. > Masami Hiramatsu > > Software Engineer > Hitachi Computer Products (America) Inc. > Software Solutions Division > > e-mail: [EMAIL PROTECTED] -- Thanks, Abhish

Re: [PATCH -mm] kprobes: kretprobe user entry-handler (updated)

2008-01-28 Thread Abhishek Sagar
On 1/28/08, Andrew Morton <[EMAIL PROTECTED]> wrote: > Neither the changelog nor the newly-added documentation explain why Linux > needs this feature. What will it be used for?? There's a detailed discussion along with an example on this thread: http://lkml.org/lkml/2007/11/13/58 and a bit on: h

Re: [PATCH 3/3] x86: WARN_ON breakpoints from .kprobes.text section

2008-01-27 Thread Abhishek Sagar
re Solutions Division > > e-mail: [EMAIL PROTECTED] Thanks, Abhishek Sagar -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 2/3] x86: Macrofy resuable code

2008-01-27 Thread Abhishek Sagar
Sam Ravnborg wrote: > Small static functions are preferred over macros. > Any particular reason to use a macro here? > > Sam These macros have very limited(two) instantiations. But here's an alternative patch inlined. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED

[PATCH 3/3] x86: WARN_ON breakpoints from .kprobes.text section

2008-01-27 Thread Abhishek Sagar
Identify breakpoints in .kprobes.text section. These certainly aren't kprobe traps. However, we make an exception for the breakpoint hardcoded into jprobe_return. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> --- diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kpro

[PATCH 2/3] x86: Macrofy resuable code

2008-01-27 Thread Abhishek Sagar
Encapsulate reusable code . Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> --- diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index a99e764..45f2949 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c @@ -74,6 +74,13 @@ DEFINE_PER_CPU(

[PATCH 0/3][RFC] x86: Catch stray non-kprobe breakpoints

2008-01-27 Thread Abhishek Sagar
occur). For this, a check can route the trap handling of such breakpoints away from kprobe_handler (which ends up calling even more functions marked as __kprobes) from inside kprobe_exceptions_notify. All comments/suggestions are welcome. -- Thanks & Regards, Abhishek Sagar -- To unsubscribe

[PATCH 1/3] x86: Move in_kprobes_functions to linux/kprobes.h

2008-01-27 Thread Abhishek Sagar
Moving in_kprobes_functions to linux/kprobes.h to share it with arch/x86/kerne/kprobes.c. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> --- diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 6168c0a..2762145 100644 --- a/include/linux/kprobes.h +++ b/include

[PATCH -mm] kprobes: kretprobe user entry-handler (updated)

2008-01-26 Thread Abhishek Sagar
ifies the kprobe smoke tests to include an entry-handler during the kretprobe sanity test. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> --- diff -upNr -X /home/guest/patches/dontdiff.txt linux-2.6.24-rc8-mm1/Documentation/kprobes.txt linux-2.6.24-rc8-mm1_kp/Documentation/kprobes.tx

[PATCH] x86: Fix singlestep handling in reenter_kprobe

2008-01-12 Thread Abhishek Sagar
cases leading up to KPROBE_HIT_SS are possible bugs. Identify and WARN_ON such cases. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> --- diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index 93aff49..afb5c96 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/

Re: [PATCH] x86: kprobes change kprobe_handler flow

2008-01-03 Thread Abhishek Sagar
a probe. So instead of singlestepping we'll let the kernel handle it. If it cant, it'll panic/die() for us. I'll try to cleanup this case and incorporate these suggestions in a separate patch, as u suggested. > Masami Hiramatsu > > Software Engineer > Hitachi Computer Pr

Re: [PATCH] x86: kprobes change kprobe_handler flow

2008-01-03 Thread Abhishek Sagar
Now I think your original suggestion is correct. > Please fix it in another patch. Ok. > -- > Masami Hiramatsu > > Software Engineer > Hitachi Computer Products (America) Inc. > Software Solutions Division > > e-mail: [EMAIL PROTECTED], [EMAIL PROTECTED] Thanks, Abhishek Sa

Re: [PATCH] x86: kprobes change kprobe_handler flow

2008-01-03 Thread Abhishek Sagar
t; Why would you avoid using mutiple "return"s in this function? >>> I think you can remove "ret" from this function. >> Hmm...there the are no deeply nested if-elses nor overlapping paths >> which need to be avoided. All the nested checks unroll cleanly too. >

Re: [PATCH] x86: kprobes change kprobe_handler flow

2008-01-02 Thread Abhishek Sagar
On 1/2/08, Masami Hiramatsu <[EMAIL PROTECTED]> wrote: > I think setup_singlestep() in your first patch is better, because it avoided > code duplication(*). Will retain it then. > > static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs, > >

Re: [PATCH] x86: kprobes change kprobe_handler flow

2008-01-01 Thread Abhishek Sagar
On 1/2/08, Harvey Harrison <[EMAIL PROTECTED]> wrote: > > +#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM) > > +static __always_inline int setup_boost(struct kprobe *p, struct pt_regs > > *regs) > > +{ > > + if (p->ainsn.boostable == 1 && !p->post_handler) { > > + /* Boost up --

Re: [PATCH] x86: kprobes change kprobe_handler flow

2008-01-01 Thread Abhishek Sagar
sn == BREAKPOINT_INSTRUCTION) > > { > > + regs->eflags &= ~TF_MASK; > > + regs->eflags |= > > + kcb->kprobe_saved_eflags; > > +

Re: [PATCH] x86: kprobes change kprobe_handler flow

2008-01-01 Thread Abhishek Sagar
it > mm > > (do subsequent pulls via "git-pull --force", as we frequently rebase the > git tree. NOTE: this might override your own local changes, so do this > only if you dont mind about losing thse changes in that tree.) > Thanks for pointing me to the right tree. I have

Re: [PATCH] x86: kprobes change kprobe_handler flow

2007-12-31 Thread Abhishek Sagar
dler of the ARM kprobes port. This further simplifies the current x86 kprobe_handler. The resulting definition is smaller, more readable, has no goto's and contains only a single call to get_kprobe. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> Signed-off-by: Quentin Barnes <[EMAI

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-21 Thread Abhishek Sagar
andler_kretpro > >struct kretprobe_instance, uflist); > > ri->rp = rp; > > ri->task = current; > > + > > + if (rp->entry_handler) { > > + if (rp->entry_handler(ri, regs)) { > > C

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-19 Thread Abhishek Sagar
n instance based on Kevin Stafford's "data pouch" approach. Kretprobe usage example in Documentation/kprobes.txt has also been updated to demonstrate the usage of entry-handlers. Signed-off-by: Abhishek Sagar <[EMAIL PROTECTED]> --- diff -upNr linux-2.6.24-rc2/Documentation/

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-17 Thread Abhishek Sagar
On Nov 17, 2007 6:24 AM, Jim Keniston <[EMAIL PROTECTED]> wrote: > It'd be helpful to see others (especially kprobes maintainers) chime in > on this. In particular, if doing kmalloc/kfree of GFP_ATOMIC data at > kretprobe-hit time is OK, as in Abhishek's approach, then we could also > use GFP_ATOM

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-17 Thread Abhishek Sagar
On Nov 17, 2007 4:39 AM, Jim Keniston <[EMAIL PROTECTED]> wrote: > First of all, as promised, here's what would be different if it were > implemented using the data-pouch approach: > > --- abhishek1.c 2007-11-16 13:57:13.0 -0800 > +++ jim1.c 2007-11-16 14:20:39.0 -0800 > @@ -50

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-16 Thread Abhishek Sagar
On Nov 16, 2007 5:37 AM, Jim Keniston <[EMAIL PROTECTED]> wrote: > On Thu, 2007-11-15 at 20:30 +0530, Abhishek Sagar wrote: > > On Nov 15, 2007 4:21 AM, Jim Keniston <[EMAIL PROTECTED]> wrote: > > > 2. Simplify the task of correlating data (e.g., timestamps) be

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-16 Thread Abhishek Sagar
> > function entry */ > > > > } > > > > > > > > /* will only be called iff flag == 1 */ > > > > int my_return_handler(struct kretprobe_instance *ri, struct pt_regs > > > > *regs) > > > > { > > > > BUG_ON(!flag

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-15 Thread Abhishek Sagar
n time, this would let user handlers do the allocation and allow them to use different kinds of data structures per-instance. - Abhishek Sagar - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-15 Thread Abhishek Sagar
On Nov 15, 2007 4:21 AM, Jim Keniston <[EMAIL PROTECTED]> wrote: > On Wed, 2007-11-14 at 19:00 +0530, Abhishek Sagar wrote: > > First of all, some general comments. We seem to be trying to solve two > problems here: > 1. Prevent the asymmetry in entry- vs. return-handler cal

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-14 Thread Abhishek Sagar
retprobe_instance *ri, struct pt_regs *regs) { BUG_ON(!flag); exit = sched_clock(); set_bit(0, &flag); } I think something like this should do the trick for you. > Thanks > Srinivasa DS -- Thanks & Regards Abhishek Sagar - To unsubscribe from this list: send the line

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-14 Thread Abhishek Sagar
ogether. So if the entry-handler fails, no return handler gets called. Does this address your concerns? -- Regards Abhishek Sagar - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.o

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-13 Thread Abhishek Sagar
On Nov 13, 2007 12:09 AM, Abhishek Sagar <[EMAIL PROTECTED]> wrote: > Whoops...sry for the repeated email..emailer trouble. Expecting this one to makes it to the list. Summary again: This patch introduces a provision to specify a user-defined callback to run at function entry to compl

Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes

2007-11-12 Thread Abhishek Sagar
On Nov 13, 2007 12:01 AM, Abhishek Sagar <[EMAIL PROTECTED]> wrote: > Hope these simple changes would suffice; all suggestions/corrections are > welcome. Whoops...sry for the repeated email..emailer trouble. -- Regards, Abhishek - To unsubscribe from this list: send the line "

Re: Out of memory management in embedded systems

2007-09-29 Thread Abhishek Sagar
Perhaps it is even possible to do this in the kernel currently somehow...? -- Abhishek Sagar - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html >

Re: KPROBES: Instrumenting a function's call site

2007-09-26 Thread Abhishek Sagar
On 9/26/07, Ananth N Mavinakayanahalli <[EMAIL PROTECTED]> wrote: > PS: There was a thought of providing a facility to run a handler at > function entry even when just a kretprobe is used. Maybe we need to > relook at that; it'd have been useful in this case. That would be really useful. I was wr

Re: KPROBES: Instrumenting a function's call site

2007-09-26 Thread Abhishek Sagar
(not subscribed to LKML). > > Thanks, > Avishay > -- Regards Abhishek Sagar - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html >

Re: [PATCH 0/4] build system: section garbage collection for vmlinux

2007-09-14 Thread Abhishek Sagar
ones I chose to bring them under the purview of --ffunction-sections. My observation remains that if a fine-grained function/data/exported-symbol level garbage collection can be incorporated into the build environment, then it'll be something really useful. -- Abhishek Sagar --- diff -upNr li

Re: [PATCH 0/4] build system: section garbage collection for vmlinux

2007-09-13 Thread Abhishek Sagar
on quite an older 2.6 kernel for a while now. I derived that port from: http://lkml.org/lkml/2006/6/4/169 With some tweaks it worked for me. Could you also have a look at the mentioned link and see if that's a superset of what you're trying to achieve? -- Abhishek Sagar - To unsubscrib

Re: instrumentation and kprobes really still "EXPERIMENTAL"?

2007-07-02 Thread Abhishek Sagar
ds to an empty menu for any kernel configuration. I suspect that this is why the EXPERIMENTAL check is on the instrumentation menu in the first place. my original point was simply that, based on its acceptance, it would seem kprobes has progressed beyond the EXPERIMENTAL phase, that's al

Re: instrumentation and kprobes really still "EXPERIMENTAL"?

2007-07-02 Thread Abhishek Sagar
On 7/2/07, Robert P. J. Day <[EMAIL PROTECTED]> wrote: On Mon, 2 Jul 2007, Abhishek Sagar wrote: > On 7/1/07, Robert P. J. Day <[EMAIL PROTECTED]> wrote: > > isn't kprobes mature enough to not be considered experimental anymore? > > That would vary from arch to

Re: instrumentation and kprobes really still "EXPERIMENTAL"?

2007-07-02 Thread Abhishek Sagar
kprobes across different archs. It can be cleaned up I suppose. -- Abhishek Sagar P.S: Adding systemtap in CC. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/maj

Re: [PATCH 3/3] Make jprobes a little safer for users

2007-06-26 Thread Abhishek Sagar
? Core kernel functions would not be > ending with a 'jprobe_return()' anyway. There's jprobe code in net/ipv4/tcp_probe.c and net/dccp/probe.c that can be builtin or modular, so I think kernel_text_address() is right. Ok..thanks for that clarification. -- Abhishek Sagar - To u

Re: [PATCH 3/3] Make jprobes a little safer for users

2007-06-25 Thread Abhishek Sagar
probe handler to be within kernel/module range. Why not narrow this down to just module range (!module_text_address(addr), say)? Core kernel functions would not be ending with a 'jprobe_return()' anyway. -- Abhishek Sagar - To unsubscribe from this list: send the line "unsubscribe linu