Re: gdbstub initial code

2010-07-13 Thread Srikar Dronamraju
* Roland McGrath rol...@redhat.com [2010-07-12 22:59:05]: When I had posted a prototype of a gdbstub which Frank and I had worked on. http://lkml.org/lkml/2009/11/30/173, Peter and Ingo showed a preference for a combined gdbstub in kernel, i.e kgdb and the newer stub should use only one

Re: gdbstub initial code

2010-07-12 Thread Srikar Dronamraju
Hi Oleg, Hello. Please see the attachment. Don't take this code seriously, this is the early prototype and everything should be rewritten. It barely uses utrace, only to stop the target. (gdb) file /path/to/binary (gdb) target extended-remote /proc/ugdb (gdb) attach

Re: gdbstub initial code

2010-07-12 Thread Srikar Dronamraju
Hello. Please see the attachment. Don't take this code seriously, this is the early prototype and everything should be rewritten. It barely uses utrace, only to stop the target. (gdb) file /path/to/binary (gdb) target extended-remote /proc/ugdb (gdb) attach PID

Fw: Re: linux-next: add utrace tree

2010-01-21 Thread Srikar Dronamraju
Hi Roland, Oleg, Would it be a good idea to probably start looking at user space api for utrace? By doing that we would get usecases that maintainers in LKML are looking for and start looking at its usefulness. Currently its probably a egg and chicken case where they look at what end customers

Re: [RFC] [PATCH 0/7] UBP, XOL and Uprobes [ Summary of Comments and actions to be taken ]

2010-01-21 Thread Srikar Dronamraju
Here is a summary of the Comments and actions that need to be taken for the current uprobes patchset. Please let me know if I missed or misunderstood any of your comments. 1. Uprobes depends on trap signal. Uprobes depends on trap signal rather than hooking to the global die notifier.

Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Layer (UBP)

2010-01-19 Thread Srikar Dronamraju
* Frederic Weisbecker fweis...@gmail.com [2010-01-19 19:06:12]: On Tue, Jan 19, 2010 at 09:47:45AM -0800, Jim Keniston wrote: What does the code in the jumped-to vma do? Is the instrumentation code that corresponds to the uprobe handlers encoded in an ad hoc .so? Once the

Re: [RFC] [PATCH 1/7] User Space Breakpoint Assistance Layer (UBP)

2010-01-18 Thread Srikar Dronamraju
* Avi Kivity a...@redhat.com [2010-01-18 14:17:10]: On 01/18/2010 02:13 PM, Pekka Enberg wrote: So how big chunks of the address space are we talking here for uprobes? That's for the authors to answer, but at a guess, 32 bytes per probe (largest x86 instruction is 15 bytes), so 32 MB will

Re: [RFC] [PATCH 4/7] Uprobes Implementation

2010-01-15 Thread Srikar Dronamraju
Hi Peter, My reply in http://lkml.indiana.edu/hypermail/linux/kernel/1001.1/02483.html addresses this. Right, so all that need be done is add the multiple probe stuff to UBP and its a sane interface to use on its own, at which point I'd be inclined to call that uprobes (UBP

Re: [RFC] [PATCH 3/7] Execution out of line (XOL)

2010-01-15 Thread Srikar Dronamraju
* Peter Zijlstra pet...@infradead.org [2010-01-15 10:07:35]: On Thu, 2010-01-14 at 14:43 -0800, Jim Keniston wrote: Yeah, there's not a lot of context there. I hope it will make more sense if you read section 1.1 of Documentation/uprobes.txt (patch #6). Or look at get_insn_slot() in

Re: [RFC] [PATCH 4/7] Uprobes Implementation

2010-01-15 Thread Srikar Dronamraju
* Peter Zijlstra pet...@infradead.org [2010-01-15 11:33:27]: Uprobes layer would need to be notified of process life-time events like fork/clone/exec/exit. No so much the process lifetimes as the vma life times are interesting, placing a hook in the vm code to track that isn't too

[RFC] [PATCH 2/7] x86 support for UBP

2010-01-11 Thread Srikar Dronamraju
x86 support for user breakpoint Infrastructure This patch provides x86 specific userspace breakpoint assistance implementation details. This patch requires x86: instruction decoder API patch. http://lkml.org/lkml/2009/6/1/459 Signed-off-by: Jim Keniston jkeni...@us.ibm.com Signed-off-by: Srikar

[RFC] [PATCH 3/7] Execution out of line (XOL)

2010-01-11 Thread Srikar Dronamraju
current vma. 3. If we cant expand the vma, allocate a new vma. Signed-off-by: Jim Keniston jkeni...@us.ibm.com Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com --- arch/Kconfig|4 include/linux/ubp_xol.h | 56 kernel/Makefile |1 kernel/ubp_xol.c

[RFC] [PATCH 6/7] Uprobes Documentation

2010-01-11 Thread Srikar Dronamraju
contributions to Uprobes: +Jim Keniston - jkeni...@us.ibm.com +Srikar Dronamraju - sri...@linux.vnet.ibm.com +Ananth Mavinakayanahalli - ana...@in.ibm.com +Prasanna Panchamukhi - prasa...@in.ibm.com +Dave Wilder - dwil...@us.ibm.com + +11. Uprobes Example + +Here's a sample kernel module showing

Re: [RFC] [PATCH] In-kernel gdbstub based on utrace Infrastructure.

2009-11-30 Thread Srikar Dronamraju
* Peter Zijlstra pet...@infradead.org [2009-11-30 13:09:12]: On Mon, 2009-11-30 at 17:33 +0530, Srikar Dronamraju wrote: This patch implements an in-kernel gdb stub. It provides an interface between gdb and Linux Kernel by implementing the remote serial protocol. This gdbstub uses utrace

Re: [RFC] [PATCH] In-kernel gdbstub based on utrace Infrastructure.

2009-11-30 Thread Srikar Dronamraju
* Peter Zijlstra pet...@infradead.org [2009-11-30 13:41:47]: This is a In-kernel gdbstub to debug user space programs. This stub doesnt help in debugging kernel. Hence I am not sure how to compare kgdb gdbstub with this gdbstub. Can you please provide more pointers on what you were

Re: [RFC] [PATCH] In-kernel gdbstub based on utrace Infrastructure.

2009-11-30 Thread Srikar Dronamraju
I guess Christoph, Roland and Frank would be able to explain in a better fashion the rational and advantages of this stub over convential gdb. Hmm,. wouldn't it make much more sense to extend the current kgdb stub to include userspace debugging, providing an all-in-one solution? I see

Re: [RFC,PATCH 0/14] utrace/ptrace

2009-11-25 Thread Srikar Dronamraju
Hi Christoph, The other thing is that this patchset really doesn't quite justify utrace. It's growing a lot more code without actually growing any useful functionality. What about all those other utrace killer features that have been promised for a long time? We are working on

Re: [PATCH 1-13] utrace-ptrace V1, for internal review

2009-11-24 Thread Srikar Dronamraju
Hi Oleg, Roland, Ananth When I get the latest set of ptrace-tests by using. cvs -d :pserver:anoncvs:anon...@sources.redhat.com:/cvs/systemtap co ptrace-tests I get errors when I run make syscall-from-clone.c: In function ‘main’: syscall-from-clone.c:127: error: storage size of

Re: [PATCH 3] ptrace: introduce user_single_step_siginfo() helper

2009-11-22 Thread Srikar Dronamraju
+#ifdef ARCH_HAS_USER_SINGLE_STEP_INFO +extern void user_single_step_siginfo(struct task_struct *tsk, + struct pt_regs *regs, siginfo_t *info); +#else +static inline void user_single_step_siginfo(struct task_struct *tsk, + struct

Re: [PATCH 3/7] ptrace_init_task: cleanup the usage of ptrace_link()

2009-10-27 Thread Srikar Dronamraju
* Oleg Nesterov o...@redhat.com [2009-10-26 04:28:46]: @@ -169,9 +164,9 @@ static inline void ptrace_init_task(stru INIT_LIST_HEAD(child-ptraced); child-parent = child-real_parent; child-ptrace = 0; - if (unlikely(ptrace)) { + if (unlikely(ptrace) (current-ptrace

[PATCH] For selinux sake allocate a fake unlinked shmem

2009-09-25 Thread Srikar Dronamraju
Hi Frank, Jim, Mark, This fix is equivalent to commit a82ac1f413712a375d5e14ef7641ce0abf7a6543 in systemtap tree. -- We allocate a fake unlinked shmem file because anonymous memory might not be granted execute permission when the selinux security hooks have their way. Signed-off-by: Srikar

[PATCH 0/2] Code cleanup patches.

2009-09-23 Thread Srikar Dronamraju
This patchset just does code cleanup and no additional bugfixes or features. After applying this patchset, checkpatch reports: total: 0 errors, 0 warnings, 0 checks, 1560 lines checked Subject: [PATCH 0/2] Code cleanup patches. File: /tmp/gdbstub-patches/4/intro Subject: [PATCH 1/2] Make gdbstub

[PATCH 2/2] use reusable functions wherever possible.

2009-09-23 Thread Srikar Dronamraju
Remove duplicate code where possible by using reusable functions. Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com --- kernel/utrace-gdb.c | 272 +++ 1 files changed, 123 insertions(+), 149 deletions(-) diff --git a/kernel/utrace-gdb.c

[PATCH 1/3] rework report_signal callback.

2009-09-04 Thread Srikar Dronamraju
() and find_gdb_connection helper functions. 5. No need to lock gdb_connections_mutex when unregistering uprobes. Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com --- kernel/utrace-gdb.c | 334 +++ 1 files changed, 202 insertions(+), 132

[PATCH 3/3] Fix a bug in defer registration patch.

2009-09-04 Thread Srikar Dronamraju
keep the uprobes engine active till the thread dies. Jim Keniston's observation on uprobes lifetime made me figure out an error in defer_registration patch that I sent earlier. Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com --- kernel/uprobes_core.c |8 ++-- 1 files changed, 2

Should SIGNAL_REPORT take preference to queued signal?

2009-09-04 Thread Srikar Dronamraju
Hi Roland, Oleg I hit upon a case where a traced thread steps over a inserted breakpoint instruction, and the tracing engine requests the traced thread to be interrupted. Here the traced thread calls report_signal callback with UTRACE_REPORT_SIGNAL and later does a report_signal callback with

[PATCH 0/2] Allow deferred registration if thread is stopped.

2009-08-26 Thread Srikar Dronamraju
/uc_make_defer_un_register_uprobe.patch Subject: [PATCH 2/2] Allow deferred register/unregister of uprobes. File: /tmp/gdbstub-patches/2/gs_use_deferred_register_uprobe.patch -- Thanks and Regards Srikar Dronamraju

[PATCH 2/2] Allow deferred register/unregister of uprobes.

2009-08-26 Thread Srikar Dronamraju
commit 20744cb97a3e4aec63ba7b92ce4115170fd468d6 Author: Srikar Dronamraju sri...@linux.vnet.ibm.com Date: Wed Aug 19 12:26:15 2009 +0530 Use deferred registration facility for register_uprobe Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com --- kernel/utrace-gdb.c | 75

[PATCH] Fix missing reference count

2009-08-25 Thread Srikar Dronamraju
one of my previous changes to gdbstub. Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com --- kernel/ubp_xol.c |1 + kernel/uprobes_core.c |1 + kernel/utrace-gdb.c |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/ubp_xol.c b/kernel

Re: [PATCH 09] move -ptrace == 0 checks to ptrace_attach_task()

2009-08-21 Thread Srikar Dronamraju
Hi Oleg, --- PU/kernel/ptrace.c~09_MV_PTRACE_CK2009-08-19 16:49:25.0 +0200 +++ PU/kernel/ptrace.c2009-08-20 20:04:59.0 +0200 @@ -471,35 +471,47 @@ static int ptrace_attach_task(struct tas { struct utrace_engine *engine; unsigned long events;

Re: [PATCH 09] move -ptrace == 0 checks to ptrace_attach_task()

2009-08-21 Thread Srikar Dronamraju
Hi Oleg, Thanks for the clarification. Please note the comment, this check relies on UTRACE_ATTACH_EXCLUSIVE above. Once we see -ptrace = 0 after utrace_attach_task(), nobody can change -ptrace. However after attaching an engine exclusively, (which would mean the child is not traced or was

[PATCH 0/4] Fixes to gdbstub.

2009-08-19 Thread Srikar Dronamraju
: /tmp/gdbstub-patches/1/only_stop_once.patch -- Thanks and Regards Srikar Dronamraju

[PATCH 3/4] Unregister uprobes after detach gdbstub engine

2009-08-19 Thread Srikar Dronamraju
commit 90cc0931707c99459aea0f6601d7f5ce2756dbd8 Author: Srikar Dronamraju sri...@linux.vnet.ibm.com Date: Wed Aug 19 10:26:00 2009 +0530 While releasing, unregister uprobes if any after detach Currently because of the way uprobes works, (register/unregister may deadlock if one of the threads

[PATCH 4/4] Stop once even for multiple interrupt requests

2009-08-19 Thread Srikar Dronamraju
commit bd86cff51a2f221b6cb10649212e5392aea7bcb7 Author: Srikar Dronamraju sri...@linux.vnet.ibm.com Date: Wed Aug 19 11:43:53 2009 +0530 We only need to intimate gdb once if we get multiple requests for look There can be multiple stop requests before gdb gets control. However continue from gdb

Re: resume from another engine results in loss of singlestep req.

2009-08-12 Thread Srikar Dronamraju
Could you show the code please? I don't really understand how it looks with 1+2 above. I am attaching the code. The module code is in try_utrace/probe5_a.c and try_utrace/probe5_b.c. But, just in case... I think module_b should re-assert SINGLESTEP from either

Re: resume from another engine results in loss of singlestep req.

2009-08-12 Thread Srikar Dronamraju
Aaahhh. Srikar, I spent 3 hours trying to understand Your code does NOT reassert SINGLESTEP. Of course, -report_signal is not called again, utrace_get_signal() just clears -report when it is called after wakeup. Because you forgot to add QUIESCE to utrace_set_events's mask !!!

resume from another engine results in loss of singlestep req.

2009-08-11 Thread Srikar . Dronamraju
Hi Roland, If we have two utrace engines for a thread with first engine requesting UTRACE_STOP and second one requesting UTRACE_SINGLESTEP, utrace correctly gives priority to UTRACE_STOP. However when the first engine detaches(or resumes) the singlestep request from the second engine is not

Re: gdbstub/uprobes problems: uprobe_unregister with halted target

2009-08-04 Thread Srikar Dronamraju
* Jim Keniston jkeni...@us.ibm.com [2009-08-03 11:10:00]: So as per my analysis, gdb_utrace_report_signal was called, followed by uprobe_report_signal. Since gdb_utrace_report_signal requested for UTRACE_STOP as resume action for SIGTRAP, the thread got stopped. uprobes was waiting

Re: gdbstub/uprobes problems: uprobe_unregister with halted target

2009-08-03 Thread Srikar Dronamraju
The target process side is also hung: zsh D 0002 3568 1288 1259 0x0080 880078c57b98 0046 00011d4a 88006d4b8000 880078c57f50 7fff138b0858 88006d4b83b8 f968

Re: [RESEND] [PATCH 0/7] Ubp, Ssol and Uprobes

2009-07-16 Thread Srikar Dronamraju
Hi Roland, et al, Did you get a chance to review this patchset? I was planning to post to LKML after addressing comments from you. -- Thanks and Regards Srikar Hi, This patchset implements uprobes over utrace. Please review the patchset and provide your valuable comments. These patches

Re: linux kernel gdb stub for userspace processes, prototype version 3

2009-07-13 Thread Srikar Dronamraju
Hi Frank, Roland Using UTRACE_STOP as action in report_signal and report_quiesce results in utrace_stop() being called which causes the thread to be scheduled out. This results in gdb not getting control/data from the remote and results in gdb command prompt. From looking at kgdb-stub, I feel it

[RESEND] [PATCH 1/7] User Space Breakpoint Assistance Layer (UBP)

2009-06-11 Thread Srikar Dronamraju
Signed-off-by: Srikar Dronamraju sri...@linux.vnet.ibm.com --- arch/Kconfig| 12 + include/linux/ubp.h | 282 ++ kernel/Makefile |1 kernel/ubp_core.c | 479 4 files changed, 774 insertions(+) Index

[RESEND] [PATCH 2/7] x86 support for UBP

2009-06-11 Thread Srikar Dronamraju
x86 support for user breakpoint Infrastructure This patch provides x86 specific userspace breakpoint assistance implementation details. This patch requires x86: instruction decoder API patch. http://lkml.org/lkml/2009/6/1/459 Signed-off-by: Jim Keniston jkeni...@us.ibm.com ---

[RESEND] [PATCH 5/7] x86 support for Uprobes

2009-06-11 Thread Srikar Dronamraju
x86 support for Uprobes Signed-off-by: Jim Keniston jkeni...@us.ibm.com --- arch/x86/Kconfig |1 + arch/x86/include/asm/uprobes.h | 27 +++ 2 files changed, 28 insertions(+) Index: uprobes.git/arch/x86/Kconfig

[RESEND] [PATCH 6/7] Uprobes documentation.

2009-06-11 Thread Srikar Dronamraju
contributions to Uprobes: +Jim Keniston - jkeni...@us.ibm.com +Srikar Dronamraju - sri...@linux.vnet.ibm.com +Ananth Mavinakayanahalli - ana...@in.ibm.com +Prasanna Panchamukhi - prasa...@in.ibm.com +Dave Wilder - dwil...@us.ibm.com + +11. Uprobes Example + +Here's a sample kernel module showing the use

[RESEND] [PATCH 7/7] Ftrace plugin for Uprobes.

2009-06-11 Thread Srikar Dronamraju
ringbuffer - Allow user to specify Nick Name for probe addresses. - Dump arguments from floating point registers. - Optimize code to use single probe instead of multiple probes for same probe addresses. -- Signed-off-by: Mahesh Salgaonkar mah...@linux.vnet.ibm.com Signed-off-by: Srikar Dronamraju

Re: Utrace in -next tree?

2009-01-12 Thread Srikar Dronamraju
* Roland McGrath rol...@redhat.com [2008-10-17 13:09:34]: What are your thoughts of getting utrace git tree into linux-next? That way, utrace will have more extensive visibility and testing. I would certainly like to. I hope that after I next post the latest utrace patch series for more

Re: abt froggy

2008-10-31 Thread Srikar Dronamraju
Hi Chris, Thanks for your quick reply. I have been regularly updating from cvs. So I thought I was always on the latest copy. To confirm I checked out a new copy using cvs -z9 -d :ext:[EMAIL PROTECTED]:/cvs/systemtap co froggy and compared it the copy I update regularly and they seem to be