]> sourceware.org Git - systemtap.git/log
systemtap.git
14 years agoPR11573: infer need for uprobes from special embedded-c markup tag
Frank Ch. Eigler [Fri, 7 May 2010 16:57:50 +0000 (12:57 -0400)]
PR11573: infer need for uprobes from special embedded-c markup tag

* tapset/ucontext-unwind.stp: Mark up these babies with /* pragma:uprobes */.
* elaborate.cxx (typeresolution_info::visit_embeddedcode): Look for that
  and activate session.need_uprobes if found.

14 years agotweak: accept -DSTAP_NO_OVERLOAD as an alias of -DSTP_NO_OVERLOAD
Frank Ch. Eigler [Thu, 6 May 2010 23:48:08 +0000 (19:48 -0400)]
tweak: accept -DSTAP_NO_OVERLOAD as an alias of -DSTP_NO_OVERLOAD

14 years agoPR11443: -L --unprivileged
Frank Ch. Eigler [Thu, 6 May 2010 22:11:11 +0000 (18:11 -0400)]
PR11443: -L --unprivileged

* elaborate.cxx (derive_probes): Suppress all semantic_errors during
  listing mode.

14 years agodocs: clean up stapfuncs/stapprobes man pages, deprecate probefunc()
Frank Ch. Eigler [Thu, 6 May 2010 18:53:32 +0000 (14:53 -0400)]
docs: clean up stapfuncs/stapprobes man pages, deprecate probefunc()

* probefuncs.3stap.in: Remove most sections that are redundant with
  automatically extracted documentation in individual function::*(stap)
  man pages.
* probeprobes.3stap.in: Ditto for probes::*(stap).
* tapset/context-symbols.stp (probefunc): Describe as deprecated.

14 years agoPR11575: lengthen TRYLOCKDELAY
Frank Ch. Eigler [Thu, 6 May 2010 17:04:11 +0000 (13:04 -0400)]
PR11575: lengthen TRYLOCKDELAY

Change default timeout for global variable locks to apprx. 1 ms,
in 10us chunks.  TRYLOCKDELAY now measures microseconds.

* translate.cxx (translate_pass): Change TRYLOCKDELAY and
  MAXTRYLOCK default values.
* runtime/probe_lock.h (stp_lock_probe): Use udelay() rather than
  ndelay().
* runtime/time.c (STP_TIMELOCK*): New macros just for time seqlock
  timeout purposes.  Expected contention is negligible here.

14 years agoDefault publican to common brand which should always be available.
Mark Wielaard [Thu, 6 May 2010 13:07:07 +0000 (15:07 +0200)]
Default publican to common brand which should always be available.

* configure.ac (publican-brand): Change default from "fedora" to "common".
* configure: Regenerated.

14 years agoCorrect the comparison of linux version for new nfs error types
Wenji Huang [Thu, 6 May 2010 08:29:21 +0000 (16:29 +0800)]
Correct the comparison of linux version for new nfs error types

The nfs41 error types were added from 2.6.30, not 2.6.19.

14 years agoMark __vm.kmem_cache_alloc_node.kp optional
Wenji Huang [Thu, 6 May 2010 06:08:59 +0000 (14:08 +0800)]
Mark __vm.kmem_cache_alloc_node.kp optional

In FC11, __vm.kmem_cache_alloc_node.kp is not resolved,
neither does __vm.kmem_cache_alloc_node.tp.

14 years agoPR11556: Support array indexing on @cast pointers
Josh Stone [Wed, 5 May 2010 23:47:19 +0000 (16:47 -0700)]
PR11556: Support array indexing on @cast pointers

It's a bit of a special case, because we don't have a pointer DIE for
the named type in @cast expressions.  However, we can read the element
size manually and still simulate an array access.

* loc2c.c (pointer_stride): New, factored out of array_stride.
  (c_translate_array_pointer): New, performs the pointer math based on
  the element size of the pointee type.
* dwflpp.cxx (dwflpp::translate_components): Take a starting component.
  (dwflpp::literal_stmt_for_pointer): If the initial type is not already
  a pointer or array, we can fake an array access on the input pointer.
* testsuite/semok/cast.stp: Add an array access test on a @cast.
* testsuite/systemtap.base/cast.stp: Ditto.
* testsuite/systemtap.base/cast.exp: Ditto.

14 years agoStraighten out die/attr use in dwflpp translation
Josh Stone [Wed, 5 May 2010 22:52:55 +0000 (15:52 -0700)]
Straighten out die/attr use in dwflpp translation

It was confusing (to me) what was the expected state of each die_mem and
attr_mem passed around in dwflpp translation.  I've changed it now so
that we pass just a vardie and typedie, which I think is clearer.  This
is also nicer for @cast where we don't have any attr for the initial
type.

* dwflpp.cxx (dwarf_die_type): Helper to get the type, throw on error.
  (dwflpp::translate_components): Just update a vardie and typedie.
  (dwflpp::translate_final_fetch_or_store): Use a vardie and typedie.
  (dwflpp::resolve_unqualified_inner_typedie): Update dies, not attrs.
  (dwflpp::literal_stmt_for_local): Update calls to above.
  (dwflpp::literal_stmt_for_return): Ditto.
  (dwflpp::literal_stmt_for_pointer): Ditto.

14 years agoPR 11338 (partial): Used @defined in tcp.stp and new test cases.
David Smith [Wed, 5 May 2010 17:32:21 +0000 (12:32 -0500)]
PR 11338 (partial): Used @defined in tcp.stp and new test cases.

* tapset/tcp.stp: Removed kernel version check.  Made other small
  improvements.
* testsuite/buildok/tcp-detailed.stp: New detailed test of all tcp probes
  and convenience variables.
* testsuite/buildok/udp-detailed.stp: New detailed test of all udp probes
  and convenience variables.
* testsuite/buildok/tcp-embedded.stp: Added rest of the tcp embedded-C
  functions.

14 years agoUpdated context tapset (for RHEL4) and updated the context testcase.
David Smith [Tue, 4 May 2010 21:39:52 +0000 (16:39 -0500)]
Updated context tapset (for RHEL4) and updated the context testcase.

* tapset/context.stp: Added RHEL4 fixes.
* tapset/context-embedded.stp: Added rest of the context embedded-C
  functions and renamed from context-test.stp.

14 years agoCast negative values to smaller type.
Stan Cox [Tue, 4 May 2010 20:14:25 +0000 (16:14 -0400)]
Cast negative values to smaller type.

sdt_types.stp (short,int): New.
(const_short_int_var,volatile_short_int_var,const_int_var,volatile_int_var): Use it.

14 years agoPR11566: "is too"
Frank Ch. Eigler [Tue, 4 May 2010 19:21:22 +0000 (15:21 -0400)]
PR11566: "is too"

14 years agoPR11566: embedded-c expressions
Frank Ch. Eigler [Tue, 4 May 2010 19:05:24 +0000 (15:05 -0400)]
PR11566: embedded-c expressions

* staptree.h: embedded_expr: New type.
* parse.cxx (parse_statement, parse_value): Parse it.
* staptree.cxx: Update visitors, provide basic code.
* elaborate.cxx (typeresolution_info::visit_embedded_expr): Select
  type based upon internal markup.
* translate.cxx: Emit it.
* elaborate.h: Corresponding changes.
* NEWS, stap.1.in: Document it.
* testsuite/buildko/three.stp, buildok/thirtyfour.stp, parseok/twentyone.stp:
  Test it.

14 years agoPR 11338 (partial): Used @defined in signal.stp and general update.
David Smith [Tue, 4 May 2010 17:01:01 +0000 (12:01 -0500)]
PR 11338 (partial): Used @defined in signal.stp and general update.

* tapset/signal.stp: Large update to get working on RHEL4, RHEL5,
  RHEL6(beta), f12, and rawhide. Removed some kernel version checks.
* testsuite/buildok/signal-all-probes.stp: No longer tests "internal"
  probes.
* testsuite/buildok/signal-detailed.stp: New detailed test of all signal
  probes and convenience variables.
* testsuite/buildok/signal-check_ignored.stp: New detailed test which can
  fail on some platforms because we can't find inline function arguments.
* testsuite/buildok/signal-handle.stp: Ditto.
* testsuite/systemtap.pass1-4/buildok.exp: Kfail signal-check_ignored.stp
  and signal-handle.stp

14 years agoPR 11441: Preparation for client/server merge into stap.
Dave Brolley [Fri, 30 Apr 2010 14:56:30 +0000 (10:56 -0400)]
PR 11441: Preparation for client/server merge into stap.

- Factor out main into initialization, argument parsing, argument checking
  pass 0-4, pass 5, cleanup.
- Move systemtap_session methods into their own file (session.cxx)

14 years agoPotentialloy confusing typo
Dave Brolley [Mon, 29 Mar 2010 15:44:11 +0000 (11:44 -0400)]
Potentialloy confusing typo

If it does not already exit -> If it does not already exist.

14 years agoFix typo in conditionalizing uprobe_get_pc extension
Wenji Huang [Tue, 4 May 2010 02:58:23 +0000 (10:58 +0800)]
Fix typo in conditionalizing uprobe_get_pc extension

* runtime/stack-i386.c: Use ifdef.
* runtime/stack.c: Correct CONFIG_UPROBE_GET_PC.

14 years agoPR11504 part: remove synthetic probe_NNNN name from error messages and most diagnostics
Frank Ch. Eigler [Mon, 3 May 2010 19:24:46 +0000 (15:24 -0400)]
PR11504 part: remove synthetic probe_NNNN name from error messages and most diagnostics

* elaborate.cxx (typeresolution_info::visit_target_symbol): Use
  sole_location as opposed to derived_probe name.
  (unresolved, invalid, mismatch): Remove the name/etc. prefix, as token
  context is available.
* translate.cxx (emit_lock_decls): Print sole_location here too.

14 years agouprobes: autoconf conditionalize uprobe_get_pc extension
Frank Ch. Eigler [Mon, 3 May 2010 17:45:03 +0000 (13:45 -0400)]
uprobes: autoconf conditionalize uprobe_get_pc extension

* runtime/autoconf-uprobe-get-pc.c: New file.
* buildrun.cxx: Build it, conditionally define STAPCONF_UPROBE_GET_PC.
* runtime/stack*.c, runtime/uprobes*/*.[ch]: Use it.  Forget GET_PC_URETPROBE_NONE.
* tapsets.cxx: Ditto.

14 years agoMake sure testsuite/buildok/memory-write_shared_copy.stp compiles.
David Smith [Mon, 3 May 2010 19:04:51 +0000 (14:04 -0500)]
Make sure testsuite/buildok/memory-write_shared_copy.stp compiles.

* testsuite/buildok/memory-write_shared_copy.stp: Fix compilation on
  systems where vm.write_shared_copy doesn't exist.

14 years agoMove failing nfs test to its own testcase.
David Smith [Mon, 3 May 2010 18:52:54 +0000 (13:52 -0500)]
Move failing nfs test to its own testcase.

* testsuite/buildok/nfs-detailed.stp: Move nfs.fop.check_flags test to
  nfs-fop.check_flags.stp (since it fails on RHEL5 and would mask other
  nfs test failures).
* testsuite/buildok/nfs-fop.check_flags.stp: New test.
* testsuite/systemtap.pass1-4/buildok.exp: Kfail nfs-fop.check_flags.stp.

14 years agoPR 11338 (partial): Used @defined in memory.stp and general update.
David Smith [Mon, 3 May 2010 18:18:53 +0000 (13:18 -0500)]
PR 11338 (partial): Used @defined in memory.stp and general update.

* tapset/memory.stp: Large update to get working on RHEL4, RHEL5,
  RHEL6(beta), f12, and rawhide. Removed all kernel version checks.
* testsuite/buildok/memory-detailed.stp: New detailed test of all memory
  probes and convenience variables.
* testsuite/buildok/vm.tracepoints.kmalloc.stp: Moved into
  memory-detailed.stp.
* testsuite/buildok/vm.tracepoints.stp: Ditto.
* testsuite/buildok/memory-mmap.stp: New detailed test which can fail on
  some platforms because we can't find inline function arguments.
* testsuite/buildok/memory-write_shared_copy.stp: Ditto.
* testsuite/systemtap.pass1-4/buildok.exp: Kfail memory-mmap.stp and
  memory-write_shared_copy.stp.

14 years agoMake sure prelink is available during tests.
Mark Wielaard [Mon, 3 May 2010 11:11:16 +0000 (13:11 +0200)]
Make sure prelink is available during tests.

* systemtap.spec: Explicitly require prelink for systemtap-testsuite.
* testsuite/systemtap.exelib/exelib.exp: Fail if prelinking fails.

14 years agoGet memory.stp embedded-C functions working on 2.6.9 kernels (RHEL4).
David Smith [Thu, 29 Apr 2010 17:58:01 +0000 (12:58 -0500)]
Get memory.stp embedded-C functions working on 2.6.9 kernels (RHEL4).

* tapset/memory.stp: Define __GFP_DMA32, GFP_DMA32, __GFP_ZERO,
  __GFP_NOMEMALLOC, and __GFP_HARDWALL if not defined.
* testsuite/buildok/memory-embedded.stp: New testcase.

14 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Stan Cox [Wed, 28 Apr 2010 16:59:56 +0000 (12:59 -0400)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

14 years agoAdd probe performance script.
Stan Cox [Wed, 28 Apr 2010 16:57:45 +0000 (12:57 -0400)]
Add probe performance script.

scripts/probe_perf:  New.

14 years agoSmall typo in NEWS
Wenji Huang [Wed, 28 Apr 2010 09:30:39 +0000 (17:30 +0800)]
Small typo in NEWS

14 years agoAUTHORS bump
Josh Stone [Tue, 27 Apr 2010 23:36:33 +0000 (16:36 -0700)]
AUTHORS bump

14 years agoRegenerate example indexes
Josh Stone [Tue, 27 Apr 2010 23:32:23 +0000 (16:32 -0700)]
Regenerate example indexes

14 years agoPR4396: Tweak the dumpstack example and add meta
Josh Stone [Tue, 27 Apr 2010 23:29:16 +0000 (16:29 -0700)]
PR4396: Tweak the dumpstack example and add meta

14 years agoPR4396: script to dump hung task's kernel stack
Wenji Huang [Tue, 27 Apr 2010 22:49:01 +0000 (15:49 -0700)]
PR4396: script to dump hung task's kernel stack

14 years agoPR 11338 (partial): Used @defined in nfs.stp and general update.
David Smith [Tue, 27 Apr 2010 16:18:58 +0000 (11:18 -0500)]
PR 11338 (partial): Used @defined in nfs.stp and general update.

* tapset/nfs.stp: Large update to get working on RHEL4, f12, and
  rawhide.  RHEL5 fails because of PR 1155 (can't find inline function
  arguments). with probe nfs.fop.check_flags.  Removed all kernel version
  checks.
* testsuite/buildok/nfs-detailed.stp: New detailed test of all nfs probes
  and convenience variables.

14 years agoFix small typo in README.security
Wenji Huang [Tue, 27 Apr 2010 07:02:26 +0000 (15:02 +0800)]
Fix small typo in README.security

14 years agoPR11340: Use local vardecls for tracepoint/marker args
Josh Stone [Tue, 27 Apr 2010 01:16:51 +0000 (18:16 -0700)]
PR11340: Use local vardecls for tracepoint/marker args

This gets rid of the "probe_context_var" field of target_symbols, which
was a hacky way to resolve args into a special local variable.  Now we
create a real local vardecl and mark it with "skip_init" so we know that
it will be filled in by derived_probe-specific code.

* staptree.h (target_symbol): Remove probe_context_var.
  (vardecl): Add skip_init.
* elaborate.h (derived_probe::emit_probe_context_vars): Remove, as such
  vars are now emitted along with all the other locals.
* elaborate.cxx (semantic_pass_opt2): Make skip_init locals immune to
  read/write analysis.
  (const_folder::visit_defined_op): No more probe_context_var.
  (typeresolution_info::visit_symbol): Ditto.
* tapset-mark.cxx (mark_var_expanding_visitor::visit_target_symbol_arg):
  Refer to the local name as a normal symbol reference.
  (mark_derived_probe::mark_derived_probe): If target_symbols were used,
  add vardecls to the probe locals.
  (mark_derived_probe::emit_probe_context_vars): Remove.
* tapsets.cxx (var_expanding_visitor::visit_defined_op): For @defined,
  there's no longer a "success" via probe_context_var.
  (tracepoint_var_expanding_visitor::visit_target_symbol_arg): Refer to
  the local name as a normal symbol reference.
  (tracepoint_derived_probe::tracepoint_derived_probe): For each used
  arg, add a vardecl to the probe locals.
  (tracepoint_derived_probe::emit_probe_context_vars): Remove.
* translate.cxx (c_unparser::emit_common_header): No probe_context_vars.
  (c_unparser::emit_probe): Don't init the skip_init locals.
  (c_unparser_assignment::visit_symbol): No more probe_context_var.

14 years agoloc2c: Do not barf on multiple values left on stack.
Roland McGrath [Mon, 26 Apr 2010 18:38:02 +0000 (11:38 -0700)]
loc2c: Do not barf on multiple values left on stack.

* loc2c.c (translate): Do not barf on multiple values left on stack.

14 years agoPR 11338 (partial): Used @defined in nfsd.stp and general update.
David Smith [Mon, 26 Apr 2010 16:56:29 +0000 (11:56 -0500)]
PR 11338 (partial): Used @defined in nfsd.stp and general update.

* tapset/nfsd.stp: Large update to get working on RHEL4, RHEL5, f12, and
  rawhide.  Removed some embedded-C and kernel version checks.
* testsuite/buildok/nfsd-embedded.stp: Added the rest of the nfsd embedded
  functions.
* testsuite/buildok/nfsd-detailed.stp: New detailed test of all nfsd
  probes and convenience variables.

14 years agoLocal arrays are now a semantic failure, instead of a translation failure.
Mark Wielaard [Fri, 23 Apr 2010 15:26:45 +0000 (17:26 +0200)]
Local arrays are now a semantic failure, instead of a translation failure.

Commit 5abd36 Block local stats and arrays in pass 2 changed when a
local array is detected as failure.

* testsuite/transko/three.stp: Moved to...
* testsuite/semko/array02.stp: ...here.

14 years agoWe also need SYSTEMTAP_INCLUDES for CFLAGS since mf_keycache.c has probes.
Stan Cox [Fri, 23 Apr 2010 15:25:28 +0000 (11:25 -0400)]
We also need SYSTEMTAP_INCLUDES for CFLAGS since mf_keycache.c has probes.

* systemtap.apps/mysql.exp (CFLAGS):  Add SYSTEMTAP_INCLUDES.

14 years agoPR11222: Also search ABRTD debuginfo cache
Frank Ch. Eigler [Fri, 23 Apr 2010 00:16:09 +0000 (20:16 -0400)]
PR11222: Also search ABRTD debuginfo cache

* setupdwfl.cxx (debuginfo*arr): Add /var/cache/abrt-di/usr/lib/debug.

14 years agomention yum-builddep and apt-get build-dep in README build instructions
Frank Ch. Eigler [Thu, 22 Apr 2010 23:45:45 +0000 (19:45 -0400)]
mention yum-builddep and apt-get build-dep in README build instructions

14 years agoConsolidate load_aggregate logic
Josh Stone [Thu, 22 Apr 2010 01:53:03 +0000 (18:53 -0700)]
Consolidate load_aggregate logic

* translate.cxx (c_unparser::load_aggregate): Every caller needed to
  figure out pre_agg and var vs. mapvar, so let's do it for them.
  (c_unparser::visit_foreach_loop): Defer more to load_aggregate.
  (c_unparser::visit_arrayindex): Ditto.
  (c_unparser::visit_print_format): Ditto.
  (c_unparser::visit_stat_op): Ditto.
  (c_tmpcounter::load_aggregate): New, determine all the tmps needed to
  mirror c_unparser::load_aggregate.
  (c_tmpcounter::visit_foreach_loop): Call load_aggregate.
  (c_tmpcounter::visit_arrayindex): Ditto.
  (c_tmpcounter::visit_print_format): Ditto.
  (c_tmpcounter::visit_stat_op): Ditto.

14 years agoLet hist buckets be printed with other arguments
Josh Stone [Thu, 22 Apr 2010 00:46:38 +0000 (17:46 -0700)]
Let hist buckets be printed with other arguments

We already have quite a kludge to fall back from the print(@hist(...))
special case if the @hist happens to have a bucket arrayindex on it.  In
that case we're printing scalars, so we can allow the print to contain
other scalar values too.

As noted in a comment, this still fails if the arrayindex is the start
of a larger expression. :(

* parse.cxx (parser::parse_symbol): Parse other print args after @hist.
* testsuite/buildok/print_histogram_entry.stp: Add a few prints to
  exercise this (and one that still doesn't work).

14 years agoPR2168: Support foreach over pmap histograms
Josh Stone [Thu, 22 Apr 2010 00:24:08 +0000 (17:24 -0700)]
PR2168: Support foreach over pmap histograms

* translate.cxx (c_tmpcounter::visit_foreach_loop): Add tmps for hist
  indexes, only if it's not already cached from an outer foreach.
  (c_unparser::visit_foreach_loop): Allow the possibility that the hist
  var might need to be a mapvar.
* testsuite/buildok/pmap_foreach.stp: Add a nested foreach loop.
* testsuite/systemtap.base/foreach_value.stp: Add a nested foreach loop.
* testsuite/systemtap.base/foreach_value.exp: Add expected output.

14 years agoPR2168: Support break/continue in histogram bucket foreach
Josh Stone [Wed, 21 Apr 2010 22:35:01 +0000 (15:35 -0700)]
PR2168: Support break/continue in histogram bucket foreach

* translate.cxx (c_unparser::visit_foreach_loop): Output break and
  continue labels for histogram bucket foreach.
* testsuite/buildok/iterate_histogram_buckets.stp: Enable test.

14 years agoSimplify c_unparser's break/continue a little
Josh Stone [Wed, 21 Apr 2010 22:31:00 +0000 (15:31 -0700)]
Simplify c_unparser's break/continue a little

14 years agoBlock local stats and arrays in pass 2
Josh Stone [Wed, 21 Apr 2010 22:11:28 +0000 (15:11 -0700)]
Block local stats and arrays in pass 2

Parts of the translator get confused if stats or arrays are allowed
through as locals.  It's easier to block it in pass 2 as soon as we can
detect this issue.

* elaborate.cxx (typeresolution_info::check_local): Make sure that probe
  and function locals are scalar longs or strings.
  (semantic_pass_types): Call check_local for functions and probes.
  (symresolution_info::visit_symbol): Make auto-locals scalar.
* testsuite/semko/local_array.stp: Test that local arrays are rejected.
* testsuite/semko/local_stat.stp: Test that local stats are rejected.
* testsuite/transko/array01.stp: Move to semko.

14 years agoFixed nfsderrno.stp for RHEL4 (and added a test).
David Smith [Thu, 22 Apr 2010 18:40:09 +0000 (13:40 -0500)]
Fixed nfsderrno.stp for RHEL4 (and added a test).

* tapset/nfsderrno.stp: Switched from using cpu_to_be32() to
  __constant_htonl() to add RHEL4 support.
* testsuite/buildok/nfsderrno-embedded.stp: New test of nfsderrno.stp.

14 years agoFix make distclean. Put manpages in EXTRA_DIST, not man in SUBDIRS.
Mark Wielaard [Thu, 22 Apr 2010 18:11:46 +0000 (20:11 +0200)]
Fix make distclean. Put manpages in EXTRA_DIST, not man in SUBDIRS.

Since there is no Makefile in the man subdir, make distclean breaks.
Fixed by explicitly listing man pages in EXTRA_DIST.

* Makefile.am (DIST_SUBDIRS): Remove man.
  (EXTRA_DIST): List man/tapset*.3stap.
* Makefile.in: Regenerate.

14 years agoSkip stapio tracing in pr10854.stp.
Mark Wielaard [Thu, 22 Apr 2010 13:07:49 +0000 (15:07 +0200)]
Skip stapio tracing in pr10854.stp.

As pointed out by dsmith and jistone in PR11525, this cleans up the test.

* testsuite/systemtap.base/pr10854.stp: Use pid() == stp_pid()) next
  to skip tracing our own helper process.

14 years agoPR11514 Disable kallsyms_on_each_symbol optimization on ppc64.
Mark Wielaard [Thu, 22 Apr 2010 09:42:27 +0000 (11:42 +0200)]
PR11514 Disable kallsyms_on_each_symbol optimization on ppc64.

* runtime/autoconf-kallsyms-on-each-symbol.c: #error on #ifdef CONFIG_PPC64.

14 years agoAdd cycle_thief.stp to the examples.
William Cohen [Wed, 21 Apr 2010 22:32:21 +0000 (18:32 -0400)]
Add cycle_thief.stp to the examples.

14 years agoPR11506 Systemtap Flight Recorder Crash Support
William Cohen [Wed, 21 Apr 2010 21:09:32 +0000 (17:09 -0400)]
PR11506 Systemtap Flight Recorder Crash Support

Move the staplog.so into the systemtap-runtime rpm to allow it to be used
on machines without the translator.

14 years agoAdd some kallsyms_on_each_symbol micro-optimisations.
Mark Wielaard [Wed, 21 Apr 2010 09:58:09 +0000 (11:58 +0200)]
Add some kallsyms_on_each_symbol micro-optimisations.

These only help when your kprobe group consists of a list of symbols
that can all be resolved.

* tapsets.cxx (kprobe_derived_probe_group::emit_module_init): Calculate
  how many probe symbols need to be resolved. Pass to kprobe_resolve.
  (kprobe_derived_probe_group::emit_module_decls): In kprobe_resolve
  keep track of how many kprobe symbols haven't resolved yet. Return
  -1 when all done.

14 years agoPR11514 Only use kallsyms_on_each_symbol speedup when available.
Mark Wielaard [Wed, 21 Apr 2010 09:21:07 +0000 (11:21 +0200)]
PR11514 Only use kallsyms_on_each_symbol speedup when available.

* runtime/autoconf-kallsyms-on-each-symbol.c: New check.
* buildrun.cxx (compile_pass): Add new check to output_autoconf.
* tapsets.cxx (kprobe_derived_probe_group::emit_module_decls): Only declare
  kprobe_resolve when STAPCONF_KALLSYMS_ON_EACH_SYMBOL defined.
  (kprobe_derived_probe_group::emit_module_init): Check whether to invoke
  kallsyms_on_each_symbol optimization.

14 years agoEXIT_SUCCESS when interrupting pass 5
Josh Stone [Tue, 20 Apr 2010 23:41:10 +0000 (16:41 -0700)]
EXIT_SUCCESS when interrupting pass 5

It is expected behavior for users to shutdown the running script with
control-C -- we should not penalize them with an error exit code.

* main.cxx (main): Reset pending_interrupts after a clean pass 5.

14 years agoWarn if kprobe symbol name not found on non-optional probe.
Mark Wielaard [Tue, 20 Apr 2010 21:03:30 +0000 (23:03 +0200)]
Warn if kprobe symbol name not found on non-optional probe.

* tapsets.cxx (kprobe_derived_probe_group::emit_module_init): Call
  _stp_warn when symbol name couldn't be resolved to an address and
  the probe isn't optional like badkprobe.exp expects.

14 years agoPR11514 Only expand kallsyms once for kprobe_derived_probe_group.
Mark Wielaard [Tue, 20 Apr 2010 20:06:15 +0000 (22:06 +0200)]
PR11514 Only expand kallsyms once for kprobe_derived_probe_group.

kprobe_register is really expensive when used for multiple symbol
based probes since it will call kallsyms_expand_symbol over and over
to uncompress the kernel symbol table. So flip the comparison loop
inside out by looping once over the kernel symbol table.

* tapsets.cxx (kprobe_derived_probe_group::emit_module_decls): Declare
  kprobe_resolve helper function.
  (kprobe_derived_probe_group::emit_module_init): Call kprobe_resolve
  through kallsyms_on_each_symbol. Never register through symbol name,
  just check that address has been filled in by kprobe_resolve.

14 years agoFixed PR 3833 by updating nfs_proc.stp (and removing kernel version checks).
David Smith [Tue, 20 Apr 2010 18:10:46 +0000 (13:10 -0500)]
Fixed PR 3833 by updating nfs_proc.stp (and removing kernel version checks).

* tapset/nfs_proc.stp: Large update to get working on RHEL4, RHEL5, f12,
  and rawhide.
* testsuite/buildok/nfs_proc-detailed.stp: New detailed test of all
  nfs_proc probes and convenience variables.

14 years agoAdd dummy flags_str to fix systemtap.syscall net1 nd_syscall test.
Mark Wielaard [Tue, 20 Apr 2010 10:23:43 +0000 (12:23 +0200)]
Add dummy flags_str to fix systemtap.syscall net1 nd_syscall test.

This doesn't fix the 32-on-64 failure, since that is gated through
socket_call -> accept4, which nd_syscall doesn't intercept yet.

* tapset/nd_syscalls.stp (nd_syscall.accept): Add dummy "0" flag to argstr.

14 years agoPR11473: Document and test foreach "VALUE ="
Josh Stone [Tue, 20 Apr 2010 02:55:40 +0000 (19:55 -0700)]
PR11473: Document and test foreach "VALUE ="

* NEWS: Blurb it.
* stap.1.in: Describe it.
* testsuite/semko/foreachstmt03.stp: Test that stats die in pass-2.
* testsuite/systemtap.base/foreach_value.stp: Test with various types.
* testsuite/systemtap.base/foreach_value.exp: Driver for above.
* testsuite/systemtap.base/optim_arridx.exp: Include value in output.

14 years agoPR11473: Add explicit iteration values with "VALUE ="
Josh Stone [Tue, 20 Apr 2010 00:42:04 +0000 (17:42 -0700)]
PR11473: Add explicit iteration values with "VALUE ="

The foreach loops now have an optional "VALUE =" which assigns the
current iteration value to the named VALUE in each pass of the loop.

* staptree.h (foreach_loop::value): New field with the name to save.
* parse.cxx (parser::parse_foreach_loop): Parse "VALUE =", which
  requires a lookahead to distinguish from an unbracketed "KEY in".
* staptree.cxx (foreach_loop::print): Display the value if present.
  (*::visit_foreach_loop): Traverse the value too.
* elaborate.cxx (*::visit_foreach_loop): Ditto.
  (add_global_var_display): Use "VALUE =" in generated code.
* translate.cxx (c_unparser::visit_foreach_loop): Assign the value in
  the beginning of every foreach iteration.

14 years agoPR11473: Optimize references to iteration values
Josh Stone [Tue, 20 Apr 2010 00:12:43 +0000 (17:12 -0700)]
PR11473: Optimize references to iteration values

When iterating with "foreach", we keep a map_node* which tells us our
current place in the map (and there's a similar marker for @hist).  Most
of the time when users index a map within a foreach, it is to get the
current value using the keys given by foreach.  When we know this is the
case, we can grab the value from the iterator instead of again searching
the map.

In the example given in PR11472, with two stat-map accesses within a
foreach, I recorded 12-15% improvement in runtime.

* translate.cxx (aggvar::get_hist): New accessor for indexing a @hist.
  (mapvar::get_value): New accessor for reading a map iterator.
  (mapvar::get_key): Simplify string NULL-check as done in get_value.
  (c_unparser::visit_foreach_loop_value): New function to see if the
  keys of a foreach are constant in the loop, and thus whether
  references with those keys can be optimized.
  (c_unparser::get_foreach_loop_value): Check for an active iteration
  value which matches the given arrayindex.
  (c_tmpcounter::visit_foreach_loop): Call visit_foreach_loop_value.
  (c_unparser::visit_foreach_loop): Ditto.
  (c_unparser::load_aggregate): Try to use a foreach value.
  (c_unparser::visit_arrayindex): Ditto.
  (c_tmpcounter::visit_arrayindex): Skip some tmps when foreach has it.
  (c_tmpcounter::visit_print_format): Ditto.
  (c_tmpcounter::visit_stat_op): Ditto.

14 years agoDifferentiate syscall and nd_syscall test results.
Mark Wielaard [Mon, 19 Apr 2010 10:53:03 +0000 (12:53 +0200)]
Differentiate syscall and nd_syscall test results.

The systemtap.sum and .log files would use the same names for tests
run by the different nd_syscall.exp and syscall.exp testsuites. Make
sure they can be easily distinquished from each other.

* testsuite/systemtap.syscall/test.tcl (run_one_test): Take and use
  extra suite parameter for test result reporting.
* testsuite/systemtap.syscall/syscall.exp (test_procedure): Provide
  test suite name to run_one_test.
* testsuite/systemtap.syscall/nd_syscall.exp (test_procedure): Likewise.

14 years agoUse new --ldd stap support in usymbol.exp test.
Mark Wielaard [Mon, 19 Apr 2010 10:31:35 +0000 (12:31 +0200)]
Use new --ldd stap support in usymbol.exp test.

* testsuite/systemtap.context/usymbols.exp: Remove -d exe/lib clutches,
  just use --ldd.

14 years agominor typo corrections
Don Domingo [Mon, 19 Apr 2010 05:34:53 +0000 (15:34 +1000)]
minor typo corrections

14 years agoDisallow --ldd in client options
Josh Stone [Fri, 16 Apr 2010 23:16:07 +0000 (16:16 -0700)]
Disallow --ldd in client options

Since --ldd invokes /usr/bin/ldd, it could be exploited by non-standard
PT_INTERP.  By restricting it in client-options, we prevent stap-servers
from vulnerability.

14 years agoPR11508: stap --ldd option for automagic shared library scanning
Frank Ch. Eigler [Fri, 16 Apr 2010 20:38:41 +0000 (16:38 -0400)]
PR11508: stap --ldd option for automagic shared library scanning

* session.h, main.cxx (unwindsym_ldd): New flag.
* translate.cxx (add_unwindsym_ldd): New function to perform ldd scan.
* NEWS, stap.1.in: Document it.
* testsuite/buildok/thirtythree.stp: Lightly test it.

14 years agoFixed PR 11480 by updating rpc.stp and its tests.
David Smith [Fri, 16 Apr 2010 14:12:06 +0000 (09:12 -0500)]
Fixed PR 11480 by updating rpc.stp and its tests.

* tapset/rpc.stp: Large update to get working on RHEL4, RHEL5, f12, and
  rawhide.
* testsuite/buildok/rpc-detailed.stp: New detailed test of all rpc probes.
* testsuite/buildok/rpc-embedded.stp: Updated.
* testsuite/systemtap.pass1-4/buildok.exp: Removed kfail for
  rpc-all-probes.stp.

14 years agoTo avoid zombies while testsuite is running, be sure to call wait after spawn.
David Smith [Thu, 15 Apr 2010 15:45:09 +0000 (10:45 -0500)]
To avoid zombies while testsuite is running, be sure to call wait after spawn.

* testsuite/systemtap.apps/mysql.exp: Calls close/wait after spawn.
* testsuite/systemtap.apps/postgres.exp: Ditto.
* testsuite/systemtap.apps/xulrunner.exp: Ditto.
* testsuite/systemtap.base/control_limits.exp: Ditto.
* testsuite/systemtap.base/dtrace.exp: Ditto.
* testsuite/systemtap.base/global_end.exp: Ditto.
* testsuite/systemtap.base/itrace.exp: Ditto.
* testsuite/systemtap.base/optionalprobe.exp: Ditto.
* testsuite/systemtap.base/probe_list.exp: Ditto.
* testsuite/systemtap.base/sdt_misc.exp: Ditto.
* testsuite/systemtap.base/stmt_rel.exp: Ditto.
* testsuite/systemtap.base/utrace_p5.exp: Ditto.
* testsuite/systemtap.base/x86_gs.exp: Ditto.

14 years agoGuard uprobes using tests with uprobes_p.
Mark Wielaard [Thu, 15 Apr 2010 13:55:34 +0000 (15:55 +0200)]
Guard uprobes using tests with uprobes_p.

14 years agoFix [set_]kernel_pointer for 32-bit
Josh Stone [Wed, 14 Apr 2010 03:07:16 +0000 (20:07 -0700)]
Fix [set_]kernel_pointer for 32-bit

* tapset/conversions.stp (kernel_pointer): Use uintptr_t casts.
* tapset/conversions-guru.stp (set_kernel_pointer): Ditto.

14 years agoPR11498: hang loose, don't freak, if facing giganormous debug_frame's.
Frank Ch. Eigler [Tue, 13 Apr 2010 19:11:15 +0000 (15:11 -0400)]
PR11498: hang loose, don't freak, if facing giganormous debug_frame's.

* translate.cxx (MAX_UNWIND_TABLE_SIZE): Double to 6MB.
  (dump_unwindsyms): Handle excess .eh_frame, .eh_frame_hdr,
  .debug_frame sizes as suppressible warnings instead of
  semantic_errors.

14 years agoFixed uninitialized variable error in task_finder.c.
David Smith [Tue, 13 Apr 2010 16:35:37 +0000 (11:35 -0500)]
Fixed uninitialized variable error in task_finder.c.

* runtime/task_finder.c (__stp_call_mmap_callbacks_with_addr): Avoided
  uninitialized variable error.

14 years agoruntime: switch to deferred STP_EXIT signalling
Frank Ch. Eigler [Sat, 10 Apr 2010 01:12:56 +0000 (21:12 -0400)]
runtime: switch to deferred STP_EXIT signalling

The former code allowed stapio to have two concurrent commands sent
toward the runtime at the same time: one from the main loop and
another one from the signal handling thread.  This is suspected to
have caused occasional lockups.  This new code switches to a deferred
signal handling model, where the signal handling thread merely
increments a counter, and the main loop monitors that count.
Unfortunately, this currently involves switching the main loop's
blocking /.ctl read into a nonblocking poll.

* runtime/staprun/mainloop.c (pending_interrupts): New variable.
  (signal_thread): Increment it.
  (stp_main_loop): Check it.

14 years agoBZ580943: add more patterns to kprobe blacklist
Frank Ch. Eigler [Fri, 9 Apr 2010 23:10:56 +0000 (19:10 -0400)]
BZ580943: add more patterns to kprobe blacklist

* dwflpp.cxx (build_blacklist): Add a few more entries.

14 years agoPR11343: backward compatibility option/conditional
Frank Ch. Eigler [Thu, 8 Apr 2010 21:15:49 +0000 (17:15 -0400)]
PR11343: backward compatibility option/conditional

* main.cxx: Add "--compatible=VERSION" option.
* session.h (compatible): Store it.
* parse.cxx (eval_pp_conditional): Look at it as %( systemtap_v CMP VALUE ... %)
* stap.1.in: Document it.
* testsuite/parseko/preprocess17.stp, parseok/twenty.stp: Test it.

14 years agodocs: normalize tapset::nfsd man header/aliases
Frank Ch. Eigler [Thu, 8 Apr 2010 19:28:19 +0000 (15:28 -0400)]
docs: normalize tapset::nfsd man header/aliases

14 years agodocumentation: shorten morehelp
Frank Ch. Eigler [Thu, 8 Apr 2010 18:21:46 +0000 (14:21 -0400)]
documentation: shorten morehelp

14 years agoruntime: more diagnostics for build-id checking
Frank Ch. Eigler [Wed, 7 Apr 2010 20:59:34 +0000 (16:59 -0400)]
runtime: more diagnostics for build-id checking

* runtime/sym.c: Store individual rc's for build-id comparisons.

14 years agoTitle for kernel_pointer needs to be all on one line.
William Cohen [Thu, 8 Apr 2010 14:49:09 +0000 (10:49 -0400)]
Title for kernel_pointer needs to be all on one line.

14 years agoClean up and clarify semantic_error chaining
Josh Stone [Wed, 7 Apr 2010 23:41:41 +0000 (16:41 -0700)]
Clean up and clarify semantic_error chaining

I consolidated the copy-construction that every target_symbol::chain
caller was doing.  I also removed the comments that target_symbol errors
might be chained due to function wildcards, because it's not true --
each derived instance gets a deep_copy of the probe body.  However,
@cast can still chain since it may try multiple modules to resolve the
casting dereference.

14 years agoPR11474: Don't manually iterate over CUs for @cast
Josh Stone [Wed, 7 Apr 2010 21:33:24 +0000 (14:33 -0700)]
PR11474: Don't manually iterate over CUs for @cast

Since commit 063906a9, we can just let dwflpp look everywhere for the
type on our behalf.  Thanks dwflpp!

* tapsets.cxx (dwarf_cast_query::handle_query_module): Call dwflpp's
  declaration_resolve_other_cus, focus on the CU, and expand.
  (dwarf_cast_query::handle_query_cu): Remove.
  (dwarf_cast_query::cast_query_cu): Remove.

14 years agoPR 9871 (partial) fix. Removed embedded-C in ioblock.stp and ipmib.stp.
David Smith [Wed, 7 Apr 2010 21:12:10 +0000 (16:12 -0500)]
PR 9871 (partial) fix.  Removed embedded-C in ioblock.stp and ipmib.stp.

* tapset/ioblock.stp(__bio_start_sect): Converted from embedded-C to
  script language.
* tapset/ipmib.stp: Replaced all _tcphdr_get_dport()/_tcphdr_get_sport()
  calls with _tcp_skb_dport()/_tcp_skb_sport() calls.  Removed embedded-C
  functions _tcphdr_get_dport()/_tcphdr_get_sport().
  (ipmib.OutRequests): Fixed for RHEL4.
  (_trn_unspec): New function.
  (_input_route_type): Originally called
  __input_route_type_old()/__input_route_type_new(), which were embedded-C
  functions.  Now just does everything in script language.
  (__input_route_type_old): Deleted.
  (__input_route_type_new): Ditto.
  (_output_route_type): Originally called
  __output_route_type_old()/__output_route_type_new(), which were
  embedded-C functions.  Now just does everything in script language.
  (__output_route_type_old): Deleted.
  (__output_route_type_new): Ditto.

14 years agoAdded kernel_pointer()/set_kernel_pointer() tapset functions.
David Smith [Wed, 7 Apr 2010 21:02:24 +0000 (16:02 -0500)]
Added kernel_pointer()/set_kernel_pointer() tapset functions.

* tapset/conversions.stp (kernel_pointer): New function.
* tapset/conversions-guru.stp (set_kernel_pointer): Ditto.
* testsuite/buildok/conversions-embedded.stp: Added kernel_pointer() test.
* testsuite/buildok/conversions.stp: Ditto.
* testsuite/buildok/set_kernel.stp: Added set_kernel_pointer() test.
* tapset/nfs.stp: Removed __d_loff_t() function.  Uses new
  kernel_pointer() function instead.
* testsuite/buildok/nfs-embedded.stp: Removed __d_loff_t() test.

14 years agoPR 9871 (partial) fix. Removed all embedded-C in rpc.stp.
David Smith [Wed, 7 Apr 2010 14:42:44 +0000 (09:42 -0500)]
PR 9871 (partial) fix.  Removed all embedded-C in rpc.stp.

* tapset/rpc.stp: Replaced all embedded-C functions with script language.

14 years agoAdded atomic_read() embedded-C function and tests.
David Smith [Tue, 6 Apr 2010 18:17:15 +0000 (13:17 -0500)]
Added atomic_read() embedded-C function and tests.

* tapset/atomic.stp: Added atomic_read().
* testsuite/buildok/atomic.stp: Added atomic_read() compile test.
* testsuite/systemtap.base/atomic.exp: Added atomic_read() tests.
* testsuite/lib/stap_run_error.exp (stap_run_error): Logs stap command and
  tries to ensure inferior process is killed.

14 years agoPR 9871 (partial) fix. Removed some embedded-C in scsi.stp.
David Smith [Tue, 6 Apr 2010 16:36:29 +0000 (11:36 -0500)]
PR 9871 (partial) fix.  Removed some embedded-C in scsi.stp.

* tapset/scsi.stp: Added script function timer_pending().  Rewrote
  embedded-C function scsi_timer_pending() in script language.

14 years agoPR 9871 (partial) fix. Removed more embedded-C in nfs_proc.stp and nfs.stp.
David Smith [Tue, 6 Apr 2010 15:04:30 +0000 (10:04 -0500)]
PR 9871 (partial) fix.  Removed more embedded-C in nfs_proc.stp and nfs.stp.

* tapset/nfs_proc.stp: Added script functions NFS_I(), NFS_FH(),
  NFS_SERVER, NFS_PROTO.  Rewrote embedded-C functions __nfsv4_bitmask()
  and __getfh_inode() in script language.
* tapset/nfs.stp: Rewrote embedded-C functions __nfsi_cache_valid(),
  __nfsi_rcache_time(), __nfsi_attr_time(), __nfsi_ndirty(),
  __nfs_server_rsize(), __nfs_version(), __nfs_server_wsize(),
  __nfs_rpages(), and __nfs_wpages() in script language.

14 years agoPR 9871 (partial) fix. Removed more embedded-C in nfs_proc.stp.
David Smith [Mon, 5 Apr 2010 19:54:45 +0000 (14:54 -0500)]
PR 9871 (partial) fix.  Removed more embedded-C in nfs_proc.stp.

* tapset/nfs_proc.stp: Rewrote embedded-C functions stap_NFS_CLIENT(),
  get_ip_from_client(), get_prot_from_client(), get_ip(), and get_prot()
  in script language.  Simplified __i2n_ip_proto() by just calling
  get_ip_from_client() or get_prot_from_client().

14 years agoPR 9871 (partial) fix. Removed some embedded-C in nfs_proc.stp.
David Smith [Mon, 5 Apr 2010 17:29:28 +0000 (12:29 -0500)]
PR 9871 (partial) fix.  Removed some embedded-C in nfs_proc.stp.

* tapset/nfs_proc.stp: To avoid a deref hazard, rewrote embedded-C
  __i2n_ip_proto() in script language.

14 years agoFixed BZ 557165 by adding better error handling.
David Smith [Mon, 5 Apr 2010 15:55:57 +0000 (10:55 -0500)]
Fixed BZ 557165 by adding better error handling.

* runtime/staprun/mainloop.c (stp_main_loop): When a read error happens,
  quit instead of retrying (which can end up in an infinite loop).

14 years agodocumentation: don't panic
Frank Ch. Eigler [Fri, 2 Apr 2010 01:12:25 +0000 (21:12 -0400)]
documentation: don't panic

14 years agoAdd NEWS for set_kernel_*
Josh Stone [Fri, 2 Apr 2010 00:38:31 +0000 (17:38 -0700)]
Add NEWS for set_kernel_*

14 years agoAdd set_kernel_* bad-address tests
Josh Stone [Fri, 2 Apr 2010 00:31:32 +0000 (17:31 -0700)]
Add set_kernel_* bad-address tests

* testsuite/systemtap.base/set_kernel.stp: try/catch addresses of -1.

14 years agoTest that all of the set_kernel_* functions work
Josh Stone [Fri, 2 Apr 2010 00:16:27 +0000 (17:16 -0700)]
Test that all of the set_kernel_* functions work

* testsuite/buildok/set_kernel.stp: Test that all can build.
* testsuite/systemtap.base/set_kernel.stp: Test that values are all set.

14 years agoPR9958: Test that the guru notation is working
Josh Stone [Thu, 1 Apr 2010 23:30:16 +0000 (16:30 -0700)]
PR9958: Test that the guru notation is working

* testsuite/semko/gurufunc.stp: Test rejection without -g.
* testsuite/semok/gurufunc.stp: Test acceptance with -g.

14 years agoAdd kernel-writing functions for guru only
Josh Stone [Thu, 1 Apr 2010 22:18:01 +0000 (15:18 -0700)]
Add kernel-writing functions for guru only

* runtime/loc2c-runtime.h (store_deref_string): New.
* tapset/conversions-guru.stp (set_kernel_*): New guru functions.

14 years agoPR9958: Let embedded-C assert guru mode
Josh Stone [Thu, 1 Apr 2010 22:15:45 +0000 (15:15 -0700)]
PR9958: Let embedded-C assert guru mode

* staptree.cxx (varuse_collecting_visitor::visit_embeddedcode): Don't
  allow calling /* guru */ functions unless guru mode is active.

This page took 0.060611 seconds and 5 git commands to generate.