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: return probe not executed on SMP system


Hien Nguyen <hien@us.ibm.com> wrote on 2005-11-04 09:10:53:

> Hi,
> After looking deep into this issue I found out the problem is in the 
> stpd. The sptd unloads the systemtap module a little too early before 
> the return probes have a chance to fire their handlers.
> 
> If you have the systemtap src tree try this tempory_fix.patch. I will 
> file a bugzilla tomorrow.
> 
> Hien.
> 
I applied your patch, and I also raise the maxaction from 1 to 10, then
it worked really well, all return probed are caught.

But the default setting of maxaction to 1 is too low for a multi-processor
system. It will cause a lot of misses of kretprobe(I counter it on Power5
system for a while, about 2000 kprobes are caught, but only about 400
kretprobe was caught, so about 1600 kretprobes are missed)

I read the "kernel/kprobes.c", and found:

/* Pre-allocate memory for max kretprobe instances */
if (rp->maxactive <= 0) {
#ifdef CONFIG_PREEMPT
                rp->maxactive = max(10, 2 * NR_CPUS);
#else
                rp->maxactive = NR_CPUS;
#endif
        }

Is it appropriate to just delete "if (rp->maxactive <= 0)", to change the 
above block as:

#ifdef CONFIG_PREEMPT
     rp->maxactive = max(10, 2 * NR_CPUS);
#else
     rp->maxactive = NR_CPUS;
#endif

so that kretprobe will never miss on a multi-processor system?

Thanks for your help.



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