]> sourceware.org Git - systemtap.git/log
systemtap.git
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.

14 years agoMake sure that the testsuite can find its server
Josh Stone [Wed, 31 Mar 2010 22:53:25 +0000 (15:53 -0700)]
Make sure that the testsuite can find its server

* testsuite/lib/systemtap.exp (setup_server): Use stap-find-servers to
  check that the firewall is letting us through to the server.

14 years agoUse a different PATH approach for pfiles
Josh Stone [Wed, 31 Mar 2010 22:29:08 +0000 (15:29 -0700)]
Use a different PATH approach for pfiles

    //bin/true && exec stap -g $0 ${1+"$@"}

This keeps it as an entirely valid stap script, so manual stap
invocation still works (as in pfiles.meta).

14 years agoUse a wider cache for simple function lookups
Josh Stone [Tue, 30 Mar 2010 21:54:39 +0000 (14:54 -0700)]
Use a wider cache for simple function lookups

When we have many individual function lookups, like the nearly 1000 with
syscall.*, each one will iterate every CU in the module (M) and then do a
cache lookup in N entries.  That's a thousand MlogN lookups.

We can instead keep the functions in a module-wide map, and then the
complexity is just a thousand logMN lookups.

Before:
  $ ./run-stap -l 'syscall.**' --vp 01 >/dev/null
  Pass 2: analyzed script: 793 probe(s), 11 function(s), 20 embed(s),
  0 global(s) using 245872virt/147304res/78272shr kb,
  in 1390usr/60sys/1448real ms.

After:
  $ ./run-stap -l 'syscall.**' --vp 01 >/dev/null
  Pass 2: analyzed script: 793 probe(s), 11 function(s), 20 embed(s),
  0 global(s) using 246228virt/147616res/78276shr kb,
  in 720usr/60sys/782real ms.

* dwflpp.cxx (dwflpp::iterate_single_function): Do a simple function
  lookup based on a module-wide cache.
  (dwflpp::mod_function_caching_callback): Helper for above.
* tapsets.cxx (dwarf_query::query_module_functions): Query a single
  function from the module-wide cache.
  (dwarf_query::query_module_dwarf): Use above for simple cases.

14 years agoRemove unused code from iterate_over_functions
Josh Stone [Tue, 30 Mar 2010 01:24:04 +0000 (18:24 -0700)]
Remove unused code from iterate_over_functions

* dwflpp.cxx (dwflpp::iterate_over_functions): No caller is using
  has_statement_num anymore (since 6b517475), so kill it.
* tapsets.cxx (query_cu): Let the default call rule the day.

14 years agoPR 9871 (partial) fix. Removed some embedded-C in ioblock.stp/vfs.stp.
David Smith [Tue, 30 Mar 2010 20:53:51 +0000 (15:53 -0500)]
PR 9871 (partial) fix.  Removed some embedded-C in ioblock.stp/vfs.stp.

* tapset/dev.stp: Added a bdevname() script function.
* tapset/ioblock.stp: Rewrote the embedded-C devname function to just use
  bdevname() script function.
* tapset/vfs.stp: Removed embedded-C __bdevname() C function.  Calls
  bdevname() script function instead.
* tapset/string.stp: Added isdigit() function.

14 years agotestsuite: convert pfiles.stp to $PATH-based stap invocation form
Frank Ch. Eigler [Tue, 30 Mar 2010 16:50:55 +0000 (12:50 -0400)]
testsuite: convert pfiles.stp to $PATH-based stap invocation form

14 years agotestsuite: use #! /usr/bin/env stap instead of /usr/bin/stap
Frank Ch. Eigler [Tue, 30 Mar 2010 13:59:10 +0000 (09:59 -0400)]
testsuite: use #! /usr/bin/env stap instead of /usr/bin/stap

14 years agoAdd documentation about Flight Recorder Mode to Beginner's Guide
William Cohen [Tue, 30 Mar 2010 16:01:18 +0000 (12:01 -0400)]
Add documentation about Flight Recorder Mode to Beginner's Guide

14 years agoPR 11338 (partial): Used @defined in ioscheduler.stp and fixed deref hazards.
David Smith [Mon, 29 Mar 2010 21:11:28 +0000 (16:11 -0500)]
PR 11338 (partial): Used @defined in ioscheduler.stp and fixed deref hazards.

* tapset/ioscheduler.stp (ioschedule.elv_next_request): Used '@defined'
  instead of a kernel version check.
  (ioscheduler.elv_next_request.return): Ditto.
  (ioscheduler.elv_add_request.kp): Ditto.
  (ioscheduler.elv_completed_request): Ditto.
  (disk_major_from_request): Fixed deref hazards.
  (disk_minor_from_request): Ditto.

14 years agoPR4105 Support up to 9 (up from 5) array indices documentation.
William Cohen [Mon, 29 Mar 2010 15:25:04 +0000 (11:25 -0400)]
PR4105 Support up to 9 (up from 5) array indices documentation.

14 years agoAdd kprobe user probe semaphore handling.
Stan Cox [Fri, 26 Mar 2010 21:14:32 +0000 (17:14 -0400)]
Add kprobe user probe semaphore handling.

Adds stap_kprobe_process_found and stap_kprobe_mmap_found handlers
and then the task_finder uses those to set the semaphore values.
The probe adds user_path and user_lib which are used by the
task_finder to decide what object to sniff.

* sdt.h (STAP_SEMAPHORE): Also define for kprobes.
* tapsets.cxx (dwarf_derived_probe): Add user_path and user_lib.
(dwarf_derived_probe::join_group): Enable task finder for kprobes.
(dwarf_derived_probe::dwarf_derived_probe): Set user_path and
user_lib.
(dwarf_derived_probe_group::emit_module_decls): Emit
stap_kprobe_mmap_found, sdt_sem_offset, sdt_sem_address, pathname,
and finder declarations.  Emit stap_kprobe_process_found and
stap_kprobe_mmap_found.
(dwarf_derived_probe_group::emit_module_init): Setup task finder.
(sdt_query::convert_location): Remove TOK_LIBRARY token.
(dwarf_builder::build): Set user_path and user_lib.
(kprobe_derived_probe): Add path and library.
(kprobe_builder::build): Get process and library params

14 years agoPR 11338 (partial): Used '@defined()' in inet_sock tapsets.
David Smith [Fri, 26 Mar 2010 19:17:48 +0000 (14:17 -0500)]
PR 11338 (partial): Used '@defined()' in inet_sock tapsets.

* tapset/inet_sock.stp (inet_get_local_port): Used '@defined' instead of a
  kernel version check.  Added RHEL4 support.
  (inet_get_ip_source): Now calls __ip_sock_daddr() to get daddr.

14 years agoPR 9871/11338 fix in tcpmib.stp by removing embedded-C and using @defined.
David Smith [Fri, 26 Mar 2010 18:24:38 +0000 (13:24 -0500)]
PR 9871/11338 fix in tcpmib.stp by removing embedded-C and using @defined.

* tapset/tcpmib.stp (tcpmib_get_state): Changed from embedded-C to script
  code.
  (tcpmib_local_addr): Instead of an embedded-C function, now calls
  function from ip.stp/tcp.stp.
  (tcpmib_remote_addr): Ditto.
  (tcpmib_local_port): Ditto.
  (tcpmib_remote_port): Ditto.
  (tcpmib.OutRsts.A): Used '@defined' instead of a kernel version check.
* tapset/ip.stp (__ip_sock_saddr): Used '@defined' instead of a kernel
  version check.  Added RHEL4 support.
  (__ip_sock_daddr): Ditto.
* tapset/tcp.stp (__tcp_sock_dport): Ditto.
  (__tcp_sock_sport): Ditto.

14 years agoRemove probe_point code duplication
Josh Stone [Fri, 26 Mar 2010 02:35:53 +0000 (19:35 -0700)]
Remove probe_point code duplication

* staptree.cxx (probe_point::str): Don't duplicate ::print -- reuse it.

14 years agoPrint probepoint addresses in hex
Josh Stone [Fri, 26 Mar 2010 02:32:46 +0000 (19:32 -0700)]
Print probepoint addresses in hex

* staptree.h (literal_number): Add a bool "print_hex".
* staptree.cxx (literal_number::print): Switch to hex if needed.
* tapsets.cxx (dwarf_derived_probe::dwarf_derived_probe): Write the
  statement number component with a hex literal_number.
  (sdt_query::convert_location): Ditto
  (kprobe_derived_probe::kprobe_derived_probe): Ditto.
  (hwbkpt_derived_probe::hwbkpt_derived_probe): Ditto for data addr.

14 years agoMention ** in NEWS and stapprobes.3stap
Josh Stone [Fri, 26 Mar 2010 01:50:16 +0000 (18:50 -0700)]
Mention ** in NEWS and stapprobes.3stap

14 years agoPR11399: Allow '**' to match tapsets across '.'
Josh Stone [Thu, 25 Mar 2010 21:31:45 +0000 (14:31 -0700)]
PR11399: Allow '**' to match tapsets across '.'

Normally wildcards are constrained to matching a single probe point
component between the '.' separator.  This patch enables '**' to match
across the separator.

Probe point parameters are still absolute separators though, as there's
not really a meaningful semantic we could use to cross them with '**'.

* elaborate.cxx (isdoubleglob): Check for '**'.
  (match_node::find_and_build): Recurse '**' to cross separators.
* testsuite/semok/doubleglob.stp: New test of broad wildcards.
* testsuite/semko/doubleglob.stp: New negative test.

14 years agoPR11427: port sdt.h to sparc
Tom Callaway [Wed, 24 Mar 2010 16:06:22 +0000 (12:06 -0400)]
PR11427: port sdt.h to sparc

* includes/sys/sdt.h (STAP_NOP): Add __sparc__ to list of "nop" users.

14 years agoSmall cleanup of context.exp.
David Smith [Wed, 24 Mar 2010 16:04:16 +0000 (11:04 -0500)]
Small cleanup of context.exp.

* testsuite/systemtap.context/context.exp: Used "make -C $build_dir" to
  avoid using 'cd'.  Added error handling.

14 years agoImproved atomic.exp testcase by removing the need for an external module.
David Smith [Wed, 24 Mar 2010 15:57:01 +0000 (10:57 -0500)]
Improved atomic.exp testcase by removing the need for an external module.

* testsuite/systemtap.base/atomic.exp: Removed the need for the external
  module by putting the atomic_long_t inside the stap module.
* testsuite/systemtap.base/atomic_module.c: Removed.
* testsuite/systemtap.base/atomic_module.makefile: Ditto.
* testsuite/lib/stap_run_error.exp (stap_run_error): Better error handling.

14 years agoFix pipe syscall name in return probe.
Mark Wielaard [Wed, 24 Mar 2010 08:24:06 +0000 (09:24 +0100)]
Fix pipe syscall name in return probe.

* tapset/syscalls2.stp (syscall.pipe.return): If @defined($flags) then use
  it to determine correct name.

14 years agoRemoved unneeded convenience variables in syscall.pipe.return.
David Smith [Tue, 23 Mar 2010 22:34:33 +0000 (17:34 -0500)]
Removed unneeded convenience variables in syscall.pipe.return.

* tapset/syscalls2.stp: Removed unneeded 'flags' and 'flag_str'
  convenience variables in syscall.pipe.return probe.

14 years agoFixed PR 11425 by fixing probefunc() when used with kprobe.function.
David Smith [Tue, 23 Mar 2010 21:37:59 +0000 (16:37 -0500)]
Fixed PR 11425 by fixing probefunc() when used with kprobe.function.

* tapset/context-symbols.stp: Fixed probefunc() by looking for '"' as the
  end of the function name along with '@'.

14 years agoPartial fix for pr 11414. Fixed several 32-bit probe points.
David Smith [Tue, 23 Mar 2010 19:40:43 +0000 (14:40 -0500)]
Partial fix for pr 11414.  Fixed several 32-bit probe points.

* tapset/nd_syscalls2.stp: Updated/fixed rt_sigaction32, compat_select,
  and sigaction32 probes.

14 years agoPR10913: Fix error messages when unable to close certain tokens
Charley Wang [Tue, 23 Mar 2010 15:55:56 +0000 (11:55 -0400)]
PR10913: Fix error messages when unable to close certain tokens

14 years agoreleng: bump to version 1.2 release-1.2
Frank Ch. Eigler [Mon, 22 Mar 2010 21:35:02 +0000 (17:35 -0400)]
releng: bump to version 1.2

14 years agoFixed nd_syscalls 'sys32_mmap2' problem on newer kernels.
David Smith [Mon, 22 Mar 2010 21:49:03 +0000 (16:49 -0500)]
Fixed nd_syscalls 'sys32_mmap2' problem on newer kernels.

* tapset/x86_64/nd_syscalls.stp: Made 'sys32_mmap2' probe point optional,
  since it doesn't exist on newer kernels.

14 years agoFixed cut-and-paste error for sys_ia64_pipe.
David Smith [Mon, 22 Mar 2010 21:37:15 +0000 (16:37 -0500)]
Fixed cut-and-paste error for sys_ia64_pipe.

* tapset/nd_syscalls2.stp: Removed '.call' from
  'kprobe.function("sys_ia64_pipe")'.

14 years agoIfdef out atomic_long_read() body on older kernels where the type doesn't exist.
David Smith [Mon, 22 Mar 2010 18:41:02 +0000 (13:41 -0500)]
Ifdef out atomic_long_read() body on older kernels where the type doesn't exist.

* tapset/atomic.stp: If we don't have ATOMIC_LOGN_INIT(), ifdef out the
  function.

14 years agoPartial fix for pr 11388 by adding 'sys_mmap_pgoff' support.
David Smith [Mon, 22 Mar 2010 18:14:18 +0000 (13:14 -0500)]
Partial fix for pr 11388 by adding 'sys_mmap_pgoff' support.

* tapset/i386/nd_syscalls.stp: Add support for 'sys_mmap_pgoff' (which is
  what the mmap syscall uses).
* tapset/x86_64/nd_syscalls.stp: Ditto.

14 years agoPartial fix for pr 11388 by adding 'sys_mmap_pgoff' support.
David Smith [Mon, 22 Mar 2010 15:43:20 +0000 (10:43 -0500)]
Partial fix for pr 11388 by adding 'sys_mmap_pgoff' support.

* tapset/i386/syscalls.stp: Add support for 'sys_mmap_pgoff' (which is
  what the mmap syscall uses).
* tapset/x86_64/syscalls.stp: Ditto.

14 years agoFix syscall tapset on older kernels (RHEL4).
David Smith [Mon, 22 Mar 2010 15:34:34 +0000 (10:34 -0500)]
Fix syscall tapset on older kernels (RHEL4).

* tapset/aux_syscalls.stp: On systems where inotify isn't supported, don't
  include inotify.h.

14 years agoImprove handling of O_NONBLOCK and O_CLOEXEC.
David Smith [Mon, 22 Mar 2010 15:05:14 +0000 (10:05 -0500)]
Improve handling of O_NONBLOCK and O_CLOEXEC.

* tapset/aux_syscalls.stp (_sys_pipe2_flag_str): Separate O_NONBLOCK and
  O_CLOEXEC support.
  (_sys_open_flag_str): Added O_CLOEXEC support.

14 years agoSupport signalfd4 in syscalls2.stp tapset.
Mark Wielaard [Sun, 21 Mar 2010 16:23:17 +0000 (17:23 +0100)]
Support signalfd4 in syscalls2.stp tapset.

* tapset/aux_syscalls.stp (_signalfd4_flags_str): New utility function.
* tapset/syscalls2.stp (syscall.signalfd[.return]): Handle signalfd4 variant
  when available.
* testsuite/systemtap.syscall/signalfd.c: New test.

14 years agoAdd inotify_init1() and inotify_add_watch() mask string support.
Mark Wielaard [Sun, 21 Mar 2010 08:55:10 +0000 (09:55 +0100)]
Add inotify_init1() and inotify_add_watch() mask string support.

* tapset/aux_syscalls.stp (_inotify_watch_mask_str): New helper function.
  (_inotify_init1_flag_str): Likewise.
* tapset/syscalls.stp (inotify_add_watch): Stringify watch mask.
  (syscall.inotify_init[.return]): Add inotify_init1() support.
* testsuite/systemtap.syscall/inotify.c: New test.

14 years agoAdd support for eventfd2 to syscall.stp tapset.
Mark Wielaard [Sat, 20 Mar 2010 21:43:51 +0000 (22:43 +0100)]
Add support for eventfd2 to syscall.stp tapset.

* tapset/aux_syscalls.stp (_eventfd2_flag_str): New utility function.
* tapset/syscalls.stp (syscall.eventfd[.return]): Add alternatives to
  handle eventfd2.
* testsuite/systemtap.syscall/eventfd.c: New test.

14 years agoExplicitly test first kernel version in utimensat syscall test.
Mark Wielaard [Sat, 20 Mar 2010 19:53:18 +0000 (20:53 +0100)]
Explicitly test first kernel version in utimensat syscall test.

* testsuite/systemtap.syscall/futimes.c: utimensat was only available since
  2.6.22, but libc headers might already define __NR_utimensat.

14 years agoMatch syscall.pipe32 with regular syscall.pipe[2] output.
Mark Wielaard [Sat, 20 Mar 2010 19:20:39 +0000 (20:20 +0100)]
Match syscall.pipe32 with regular syscall.pipe[2] output.

* tapset/x86_64/syscalls.stp (syscall.pipe32[.return]): Define same
  variables and match argstr with regular syscall.pipe.

14 years agoAdd support for dup3 to syscall.stp tapset.
Mark Wielaard [Sat, 20 Mar 2010 18:58:29 +0000 (19:58 +0100)]
Add support for dup3 to syscall.stp tapset.

* tapset/aux_syscalls.stp (_dup3_flag_str): New helper function.
* tapset/syscalls.stp (syscall.dup2): Add alternatives to handle dup3 also.
* testsuite/systemtap.syscall/dup.c: New testcase.

14 years agoAdd F_DUPFD_CLOEXEC to _fcntl_cmd_str().
Mark Wielaard [Sat, 20 Mar 2010 13:59:11 +0000 (14:59 +0100)]
Add F_DUPFD_CLOEXEC to _fcntl_cmd_str().

14 years agoAdd MSG_CMSG_CLOEXEC to _recvflags_str.
Mark Wielaard [Sat, 20 Mar 2010 13:49:05 +0000 (14:49 +0100)]
Add MSG_CMSG_CLOEXEC to _recvflags_str.

14 years agoSupport epoll_create1 syscall.
Mark Wielaard [Fri, 19 Mar 2010 22:19:19 +0000 (23:19 +0100)]
Support epoll_create1 syscall.

* tapset/aux_syscalls.stp (_epoll_create1_flag_str): New helper function.
* tapset/syscalls.stp (syscall.epoll_create[.return]): Match epoll_creat1
  if available.

14 years agorobustness: add special_mapping_* to blacklist for 2.6.32ish
Frank Ch. Eigler [Sat, 20 Mar 2010 23:25:27 +0000 (19:25 -0400)]
robustness: add special_mapping_* to blacklist for 2.6.32ish

* dwflpp.cxx (build_blacklist): Add special_mapping_*

14 years agoPR11405: Warn and continue for parsing errors in tapsets
Josh Stone [Sat, 20 Mar 2010 19:29:37 +0000 (12:29 -0700)]
PR11405: Warn and continue for parsing errors in tapsets

When we start seeing tapsets provided by third parties, any errors in
their files should not be fatal to us.  Since we don't really know which
tapsets are our own, this leniency applies to all.

* main.cxx (main): Warn on tapset errors, but continue unless -W.
* testsuite/parseko/bad_tapset/foo.stp: New bogus tapset.
* testsuite/parseko/bad_tapset.stp: Check that "-W -I bad_tapset" fails.
* testsuite/parseok/bad_tapset.stp: Check that "-I bad_tapset" succeeds.
* testsuite/parseok/all_tapsets.stp: Check -W with the default tapsets.

14 years agoBump the sample indexes
Josh Stone [Sat, 20 Mar 2010 02:00:49 +0000 (19:00 -0700)]
Bump the sample indexes

14 years agoAdd ia64 pipe result support. Relax pipe syscall test a little.
Mark Wielaard [Fri, 19 Mar 2010 19:57:01 +0000 (20:57 +0100)]
Add ia64 pipe result support. Relax pipe syscall test a little.

* tapset/syscalls2.stp (syscall.pipe.return): ia64 provides pipe0, pipe1
  results through (user) registers.
* testsuite/systemtap.syscall/pipe.c: Only expect zero as input fildes.

14 years agoLet try_block contain any statement
Josh Stone [Fri, 19 Mar 2010 19:04:39 +0000 (12:04 -0700)]
Let try_block contain any statement

We still require the block for parsing, but the optimizer likes to fold
singleton blocks away, so any statement is possible.  PR11341 masks such
issues at compile time, but I'm a little surprised that we've gotten
away with this at runtime...

14 years agoPR909: add a baby test case
Frank Ch. Eigler [Fri, 19 Mar 2010 18:58:16 +0000 (14:58 -0400)]
PR909: add a baby test case

* testsuite/systemtap.examples/profiling/thread-times.stp: Prefer
  perf.sw.cpu_clock to timer.profile.  Prettify output by including
  comm string.

14 years agotapset: port addr_to_node() to rhel4
Frank Ch. Eigler [Fri, 19 Mar 2010 18:57:45 +0000 (14:57 -0400)]
tapset: port addr_to_node() to rhel4

14 years agoAdd testcase for syscall.pipe.
Mark Wielaard [Fri, 19 Mar 2010 15:55:10 +0000 (16:55 +0100)]
Add testcase for syscall.pipe.

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