This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: kprobe fault handling


Hi Frank,

On Tue, Sep 06, 2005 at 11:09:13AM -0400, Frank Ch. Eigler wrote:
> 
> prasanna wrote:
> 
> > [...]  yes, in situtations when fault_handler is executed, users can
> > either correct the faulty instruction and singlestep again or he can
> > just replace back the original instruction, disarm the probe and
> > continue.  [...]
> 
> Is there a modules-accessible kprobes API for disarming a probe on the
> fly?

There is a arch specific routine to disable the probes as shown below.
void arch_disarm_kprobe(struct kprobe *p)
{
	*p->addr = p->opcode;
	flush_icache_range((unsigned long) p->addr,
			   (unsigned long) p->addr + sizeof(kprobe_opcode_t));
}


> For example, if a probe handler does something crazy and branches to
> pc=0, I'd like to unwind/disable the handler, signal the situation,
> and let the kernel run along as if the probe wasn't there in the first
> place.  It looks like this may not be all there now, so I will disable
> the new code in the translator code.

Is it enough to export the above routine in all architectures?


Thanks
Prasanna

-- 

Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<prasanna@in.ibm.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]