This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Default number of active kretprobes
- From: William Cohen <wcohen at redhat dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Thu, 23 Mar 2006 10:07:59 -0500
- Subject: Default number of active kretprobes
Martin noticed that some of the examples were dropping kretprobes on
his laptop running a uniprocessor kernel. It appears the maximum
number of return events allowed at a time is too small. Example works
on smp kernel, but run out of return probes on uniprocessor
kernels. Did some investigation earlier this week. The struct
kretprobe has maxactive field to track number of entries available.
struct kretprobe {
struct kprobe kp;
kretprobe_handler_t handler;
int maxactive;
int nmissed;
struct hlist_head free_instances;
struct hlist_head used_instances;
};
kprobe register_kretprobe() has the following questionable code. Why
handle preemptable kernels specially? Why not just have max(10, 2
*NR_CPUS) in all cases?
#ifdef CONFIG_PREEMPT
rp->maxactive = max(10, 2 * NR_CPUS);
#else
rp->maxactive = NR_CPUS;
#endif
in include/linux/threads.h
#ifdef CONFIG_SMP
#define NR_CPUS CONFIG_NR_CPUS
#else
#define NR_CPUS 1
#endif
CONFIG_NR_CPUS
./arch/i386/defconfig:CONFIG_NR_CPUS=8