diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-11-22 10:18:10 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-11-22 10:18:10 -0500 |
commit | 01b05e2ef0a8516aababf31a7decd14d07afb49b (patch) | |
tree | 82d9a6cb5f43c2c00d1a96e00991bc28b6d6141a | |
parent | 7320987632c7029c3b351b9ff8e5118d18979693 (diff) | |
download | systemtap-steved-01b05e2ef0a8516aababf31a7decd14d07afb49b.tar.gz systemtap-steved-01b05e2ef0a8516aababf31a7decd14d07afb49b.tar.xz systemtap-steved-01b05e2ef0a8516aababf31a7decd14d07afb49b.zip |
uprobes: fix & document use of MAXUPROBES
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | stap.1.in | 10 | ||||
-rw-r--r-- | tapsets.cxx | 14 |
3 files changed, 23 insertions, 7 deletions
@@ -1,5 +1,11 @@ 2008-11-22 Frank Ch. Eigler <fche@elastic.org> + * tapsets.cxx (MAXUPROBES): Tweak its definition. Use it + consistently. + * stap.1.in (MAXUPROBES): Document it. + +2008-11-22 Frank Ch. Eigler <fche@elastic.org> + PR 5689. * tapsets.cxx (dwarf_derived_probe_group::emit_module_exit,decls): Print kprobe missed stats if STP_TIMING. @@ -956,12 +956,20 @@ Maximum number of soft errors before an exit is triggered, default 0, which means that the first error will exit the script. .TP MAXSKIPPED -Maximum number of skipped reentrant probes before an exit is triggered, default 100. +Maximum number of skipped probes before an exit is triggered, default 100. +Running systemtap with \-t (timing) mode gives more details about skipped +probes. .TP MINSTACKSPACE Minimum number of free kernel stack bytes required in order to run a probe handler, default 1024. This number should be large enough for the probe handler's own needs, plus a safety margin. +.TP +MAXUPROBES +Maximum number of concurrently armed user-space probes (uprobes), default +100 times the number of user-space probe points named in the script. This +pool is large because individual uprobe objects are allocated for each +process for each script-level probe. .PP Multipule scripts can write data into a relay buffer concurrently. A host diff --git a/tapsets.cxx b/tapsets.cxx index 58954e84..5927e405 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -6994,17 +6994,19 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "#endif"; s.op->newline() << "#include \"task_finder.c\""; + s.op->newline() << "#ifndef MULTIPLE_UPROBES"; + s.op->newline() << "#define MULTIPLE_UPROBES 100"; // maximum possible armed uprobes per process() probe point + s.op->newline() << "#endif"; s.op->newline() << "#ifndef MAXUPROBES"; - s.op->newline() << "#define MAXUPROBES 16"; // maximum possible armed uprobes per process() probe point + s.op->newline() << "#define MAXUPROBES (MULTIPLE_UPROBES * " << probes.size() << ")"; s.op->newline() << "#endif"; - s.op->newline() << "#define NUMUPROBES (MAXUPROBES*" << probes.size() << ")"; // In .bss, the shared pool of uprobe/uretprobe structs. These are // too big to embed in the initialized .data stap_uprobe_spec array. s.op->newline() << "struct stap_uprobe {"; s.op->newline(1) << "union { struct uprobe up; struct uretprobe urp; };"; s.op->newline() << "int spec_index;"; // index into stap_uprobe_specs; <0 == free && unregistered - s.op->newline(-1) << "} stap_uprobes [NUMUPROBES];"; + s.op->newline(-1) << "} stap_uprobes [MAXUPROBES];"; s.op->newline() << "DEFINE_MUTEX(stap_uprobes_lock);"; // protects against concurrent registration/unregistration s.op->newline() << "struct stap_uprobe_spec {"; @@ -7088,7 +7090,7 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "printk (KERN_WARNING \"uprobe idx %d change pid %d register_p %d reloc %p pp %s\\n\", spec_index, tsk->tgid, register_p, (void*) relocation, sups->pp);"; s.op->newline() << "#endif"; - s.op->newline() << "for (i=0; i<NUMUPROBES; i++) {"; // XXX: slow linear search + s.op->newline() << "for (i=0; i<MAXUPROBES; i++) {"; // XXX: slow linear search s.op->newline(1) << "struct stap_uprobe *sup = & stap_uprobes[i];"; // register new uprobe @@ -7210,7 +7212,7 @@ uprobe_derived_probe_group::emit_module_init (systemtap_session& s) if (probes.empty()) return; s.op->newline() << "/* ---- user probes ---- */"; - s.op->newline() << "for (j=0; j<NUMUPROBES; j++) {"; + s.op->newline() << "for (j=0; j<MAXUPROBES; j++) {"; s.op->newline(1) << "struct stap_uprobe *sup = & stap_uprobes[j];"; s.op->newline() << "sup->spec_index = -1;"; // free slot // NB: we assume the rest of the struct (specificaly, sup->up) is @@ -7247,7 +7249,7 @@ uprobe_derived_probe_group::emit_module_exit (systemtap_session& s) // important stuff like utrace cleanups are done by // __stp_task_finder_cleanup() - s.op->newline() << "for (j=0; j<NUMUPROBES; j++) {"; + s.op->newline() << "for (j=0; j<MAXUPROBES; j++) {"; s.op->newline(1) << "struct stap_uprobe *sup = & stap_uprobes[j];"; s.op->newline() << "struct stap_uprobe_spec *sups = &stap_uprobe_specs [sup->spec_index];"; s.op->newline() << "if (sup->spec_index < 0) continue;"; // free slot |