]> sourceware.org Git - systemtap.git/log
systemtap.git
13 years agoPR11811: warn on missing unwind info with 'stap -d FOO'
Frank Ch. Eigler [Mon, 8 Nov 2010 19:48:01 +0000 (14:48 -0500)]
PR11811: warn on missing unwind info with 'stap -d FOO'

* unwind.c (unwind_frame): Demote common warnings to dbug_unwind messages.
  (unwind): Print a warning for unwind operations foiled by modules that
  did not have pre-uploaded unwind data.
* buildrun.cxx (compile_pass): Check for exported __module_text_address.

13 years agofix accidental prefix '/' in abbreviated module name in backtraces
Frank Ch. Eigler [Mon, 8 Nov 2010 19:47:04 +0000 (14:47 -0500)]
fix accidental prefix '/' in abbreviated module name in backtraces

* runtime/sym.c (_stp_snprint_addr): Use strrchr correctly.

13 years agoPR12168: eliminate duplicate run-time warning messages
Frank Ch. Eigler [Mon, 8 Nov 2010 16:26:19 +0000 (11:26 -0500)]
PR12168: eliminate duplicate run-time warning messages

* runtime/staprun/mainloop.c (stp_main_loop STP_OOB_DATA):
  Rewrite WARNING handling.  Include optional duplicate-elimination
  with size-limited glibc tsearch() tree.
* testsuite/systemtap.base/warnings2.exp: New test.
* NEWS: Mention this.

13 years agoPR12168: extend staprun with -w (suppress warnings) option.
Frank Ch. Eigler [Sun, 7 Nov 2010 22:30:35 +0000 (17:30 -0500)]
PR12168: extend staprun with -w (suppress warnings) option.

* buildrun.cxx: Pass -w to staprun.
* runtime/staprun/common.c: Parse new -w.  Document old -u.
* runtime/staprun/staprun.8: Ditto.

13 years agoPR11811 prep: save full mmpath for found vmas
Frank Ch. Eigler [Sun, 7 Nov 2010 22:09:57 +0000 (17:09 -0500)]
PR11811 prep: save full mmpath for found vmas

Extend the print_*backtrace symbol names with the full path
of the user-space ELF module, not just the basename.  This
requires saving a char[] copy in the __stp_tf_vma_entry
structure instead of a char* pointing into a dentry.d_name.
-DTASK_FINDER_VMA_ENTRY_PATHLEN governs copy length.

* runtime/task_finder_vma.c (__stp_tf_vma_entry): Change
  char*name -> char[]path field.  Update manipulating
  functions accordingly.
* runtime/vma.c (_stp_vma_mmap_cb): Pass mmpath to tf-vma table
  if available.
* testsuite/systemtap.context/usymbols.exp: Update for expected
  full path in output string.
* NEWS: Mention change.
* runtime/sym.h (_STP_SYM_MODULE_BASENAME): New flag.
  (_STP_SYM_SIMPLE): Include it.
* runtime/sym.c (_stp_snprint_addr): Process it.

13 years agofix -DDEBUG_UNWIND compile warning via printf %ld & casting
Frank Ch. Eigler [Sun, 7 Nov 2010 22:09:10 +0000 (17:09 -0500)]
fix -DDEBUG_UNWIND compile warning via printf %ld & casting

13 years agotweak tz_ctime() parametrization to satisfy kerneldoc
Frank Ch. Eigler [Sun, 7 Nov 2010 12:36:16 +0000 (07:36 -0500)]
tweak tz_ctime() parametrization to satisfy kerneldoc

13 years agoAdd build id support for user modules.
Stan Cox [Sat, 6 Nov 2010 03:02:39 +0000 (23:02 -0400)]
Add build id support for user modules.

* sym.c (_stp_build_id_check): New.  Moved the build id check code from
 _stp_module_check and changed...
(_stp_module_check): to use it.
(_stp_usermodule_check): New.  This is called from the
task manager callback stap_uprobe_change_plus for the process found and
mmap found cases.

* translate.cxx (dump_unwindsyms): Don't stop if it isn't a kernel module.
Set build_id_vaddr for user modules.  Output module->build_id_offset as an
absolute address.

* uprobes-common.c (stap_uprobe_change_plus): Call _stp_usermodule_check.

13 years agoPR12195: pass user-space timezone at script startup
Frank Ch. Eigler [Sat, 6 Nov 2010 02:10:26 +0000 (22:10 -0400)]
PR12195: pass user-space timezone at script startup

* runtime/transport/transpot_msgs.h: Declare STP_TZINFO message type.
* runtime/staprun/staprun.c (send_tzinfo): New function to send time zone
  at startup.
* runtime/transport/control.c (_stp_ctl_write_cmd): Allow this message.
* runtime/transport/transport.c (_stp_handle_tzinfo): New function to
  process this message and declare various globals.
* tapset/tzinfo.stp: New tapset to access those globals.
* testsuite/buildok/timestamp-embedded.stp: Extend test.
* NEWS: Mention tz_ctime().
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Extract docs from new tapset.

13 years agoMake pfiles kneel before the frame-size overlord
Josh Stone [Fri, 5 Nov 2010 21:45:59 +0000 (14:45 -0700)]
Make pfiles kneel before the frame-size overlord

In socket_optname, there's an optname_entries mapping array.  On 64-bit,
each item is 24 bytes, so with 14 entries that's 336 bytes.  That
doesn't need to be on the stack -- static const it is.

13 years agoAdd make targets "uprobes" and "install-uprobes"
Josh Stone [Fri, 5 Nov 2010 19:36:14 +0000 (12:36 -0700)]
Add make targets "uprobes" and "install-uprobes"

This builds uprobes.ko in $srcdir and $DESTDIR, respectively,
because I'm too lazy to type it out all the time.

13 years agoPR10821: Remove large stack variables from the unwinder
Josh Stone [Fri, 5 Nov 2010 19:16:22 +0000 (12:16 -0700)]
PR10821: Remove large stack variables from the unwinder

We tend to use the percpu CONTEXT as a pre-allocated stack, so add the
large unwinder variable there too.

* runtime/unwind.c (unwind, unwind_frame): Use an unwind_context
  parameter for the larger data needed.
* runtime/stack-$arch.c (__stp_stack_print): Add the unwind_context
  parameter, and use it for the x86 versions with a dwarf unwinder.
* runtime/stack.c (_stp_stack_print, _stp_stack_sprint): Add the
  unwind_context parameter and pass it along.
* translate.cxx (c_unparser::emit_common_header): Add unwind_context the
  the global CONTEXT when we NEED_UNWIND_DATA.
* tapset/context-unwind.stp (*backtrace): Use CONTEXT->uwcontext.
* tapset/ucontext-unwind.stp (*backtrace): Use CONTEXT->uwcontext.
* buildrun.cxx (compile_pass): Tighten the frame warning to 256 bytes.

13 years agoUpdated memory.stp, rpc.stp, task.stp, and vfs.stp for 2.6.36.
David Smith [Thu, 4 Nov 2010 21:30:09 +0000 (16:30 -0500)]
Updated memory.stp, rpc.stp, task.stp, and vfs.stp for 2.6.36.

* tapset/memory.stp (vm.oom_kill): Added oom_kill_process().
* tapset/rpc.stp (sunrpc.clnt.call_sync): Updated for 2.6.36.
  (sunrpc.clnt.call_async): Ditto.
* tapset/task.stp (task_gid): Updated for 2.6.36 by defining and using
  task_gid().
  (task_egid): Updated for 2.6.36 by defining and using task_egid().
* tapset/vfs.stp (_vfs.block_prepare_write): Update for 2.6.36 by using
  __block_write_begin() as an alternative to __block_prepare_write().
  (_vfs.block_write_begin): Updated for 2.6.36.

13 years agoTest that uprobes supports "rep ret"
Josh Stone [Thu, 4 Nov 2010 02:27:54 +0000 (19:27 -0700)]
Test that uprobes supports "rep ret"

We've made a special case in uprobes to support this sequence, since it
does occur in normal gcc output, so make sure of that.  At the same
time, test that we reject other prefixes like "repnz ret", even though
we might be able to support them after more analysis.

13 years agouprobes_i386: backport check_legacy_prefix from uprobes2
Josh Stone [Thu, 4 Nov 2010 01:41:09 +0000 (18:41 -0700)]
uprobes_i386: backport check_legacy_prefix from uprobes2

Without this, we can't give "special" prefixed instructions the
treatment they deserve. (e.g. rep-ret)

13 years agobuilding: add placeholder for "make -j<N>" runs to build substuff
Frank Ch. Eigler [Wed, 3 Nov 2010 20:55:52 +0000 (16:55 -0400)]
building: add placeholder for "make -j<N>" runs to build substuff

13 years agouprobes: Fix post_ssout handling of "rep ret" on x86
Josh Stone [Wed, 3 Nov 2010 17:34:39 +0000 (10:34 -0700)]
uprobes: Fix post_ssout handling of "rep ret" on x86

That odd sequence is apparently used to coerce better behavior from the
branch predictor on AMD K8.  GCC does this, so we need to be prepared to
deal with it.

In uprobe_post_ssout, most instructions just need a relative %ip fixup
after single-stepping out-of-line.  A few are special though, either
because their new %ip is not relative, or because their return address
on the stack needs that relative SSOL adjustment, or even both.  This
oddball "rep ret" is such a case, but we were missing the proper fixup
due to the unexpected prefix.

This patch moves that ip-fixup decoding to the validation phase in
setup_uprobe_post_ssout, saving the flags UPFIX_RETURN and UPFIX_ABS_IP
as needed.  In this same step, we reject probing these instructions if
they have a prefix, as we haven't determined the correct behavior for
them.  For "rep ret" we make an explicit exception, since we know that
behaves just like a bare "ret".

13 years agoEdits to the User-space chapter.
William Cohen [Wed, 3 Nov 2010 15:22:45 +0000 (11:22 -0400)]
Edits to the User-space chapter.

13 years agoRestore legacy domain (localhost) in server cert for stap-client.
Dave Brolley [Tue, 2 Nov 2010 21:33:36 +0000 (17:33 -0400)]
Restore legacy domain (localhost) in server cert for stap-client.

13 years agoImprove gettimeofday stability
Josh Stone [Tue, 2 Nov 2010 21:01:23 +0000 (14:01 -0700)]
Improve gettimeofday stability

These are a few tweaks to improve the stability of our gettimeofday
startup and shutdown.  Hopefully this helps with PR10651 and PR12182,
but that's not been confirmed yet.

* runtime/runtime.h: Don't include time.c here.
* translate.cxx (c_unparser::emit_common_header): Include time.c here,
  only if NEEDed (so we also ensure init/kill_time will be called).
  (c_unparser::emit_module_init): Change to STAP_SESSION_STOPPED for the
  final cleanup efforts, especially for time.c to wrap up.
  (c_unparser::emit_module_exit): Ditto.
* runtime/time.c (__stp_time_timer_callback): Use the session_state
  instead of stp_timer_reregister, and continue until STOPPED.
  (__stp_init_time): Don't add_timer from the IPI.
  (_stp_init_time): Instead, add_timer_on each cpu here.

13 years agoAdd comment to latencytap.stp on where the translations came from.
William Cohen [Tue, 2 Nov 2010 18:57:36 +0000 (14:57 -0400)]
Add comment to latencytap.stp on where the translations came from.

13 years agoAdd information about uprobe module in beginners guide
William Cohen [Tue, 2 Nov 2010 17:32:10 +0000 (13:32 -0400)]
Add information about uprobe module in beginners guide

13 years agofix memory double-free in module_cache
Frank Ch. Eigler [Tue, 2 Nov 2010 03:05:56 +0000 (23:05 -0400)]
fix memory double-free in module_cache

The kmodule.stp test case could evoke a double-free of module-info
structs, since these were shared pointers, and not managed by GC.
Oh yeah, what GC, in the year 2010.

* dwflpp.cxx (dwflpp dtor): Don't delete shared mod_info ptr.
  (module_cache dtor): New function.
* dwflpp.h: Declare.
* tapsets.cxx (delete_session_module_cache): New function.
  (several::build_no_more): Call it.
  (dwarf_build_no_more): Use delete_map<> template.

13 years agoImproved fork/vfork tests for RHEL5.
David Smith [Mon, 1 Nov 2010 20:37:23 +0000 (15:37 -0500)]
Improved fork/vfork tests for RHEL5.

* testsuite/systemtap.clone/dtrace_fork_exec.exp: Improve output string to
  handle parent/child execution order differences.
* testsuite/systemtap.clone/dtrace_vfork_parent.c: Added include files to
  avoid compile error on RHEL5.
* testsuite/systemtap.clone/dtrace_vfork_parent.c: Ditto.

13 years agoImprove handling of vfork'ed processes for uprobes version 1.
David Smith [Mon, 1 Nov 2010 20:32:57 +0000 (15:32 -0500)]
Improve handling of vfork'ed processes for uprobes version 1.

* runtime/uprobes/uprobes.c (insert_bkpt): Don't log EEXIST errors (since
  systemtap inserts duplicate probes).
  (uprobe_report_exec): Only cleanup if this is the last thread.  Without
  this change, vfork'ed processes doing an exec weren't handled correctly.

13 years agoPR11376: reinforce doc blurbage for process(PID).statement(ADDR).absolute
Frank Ch. Eigler [Mon, 1 Nov 2010 19:09:54 +0000 (15:09 -0400)]
PR11376: reinforce doc blurbage for process(PID).statement(ADDR).absolute

13 years agoPR11376: a quickie test case for process(PID).statement(NUM).absolute
Frank Ch. Eigler [Mon, 1 Nov 2010 18:55:42 +0000 (14:55 -0400)]
PR11376: a quickie test case for process(PID).statement(NUM).absolute

13 years agoPR11376: fix generated probe definition struct for process(PID).statement(ADDR).absolute*
Jim Keniston [Mon, 1 Nov 2010 18:49:54 +0000 (14:49 -0400)]
PR11376: fix generated probe definition struct for process(PID).statement(ADDR).absolute*

13 years agoAdd Chapter about user-space probing to the Beginner's guide.
William Cohen [Mon, 1 Nov 2010 19:08:31 +0000 (15:08 -0400)]
Add Chapter about user-space probing to the Beginner's guide.

13 years agoPR12176 String literal at end of file crashes parser.
Mark Wielaard [Mon, 1 Nov 2010 10:55:35 +0000 (11:55 +0100)]
PR12176 String literal at end of file crashes parser.

* parse.cxx (parser::parse_literal): Only inspect next token if there is one.
* testsuite/parseok/end_string.stp: New testcase.

13 years agoexamples: Print PID of peer for unix sockets
Timo Juhani Lindfors [Fri, 29 Oct 2010 12:44:30 +0000 (15:44 +0300)]
examples: Print PID of peer for unix sockets

This information is very useful for debugging but is not normally
available to userland since /proc/net/unix does not list it.

13 years agoPR12169: fix tokenize()
Frank Ch. Eigler [Thu, 28 Oct 2010 22:42:35 +0000 (18:42 -0400)]
PR12169: fix tokenize()

* tapset/tokenize.stp: New file for tokenize().  Use per-context statics.
* doc/SystemTap_Tapset_Reference/tapsets.tmpl: Pull it into new docs.
* tapset/string.stp: Remove old tokenize() code.
* translate.cxx (emit_common_header): Add STAP_NEED_CONTEXT_TOKENIZE bits.
  (translate_pass): Emit global %{ %} embeds before context definition.

13 years agoPR12169: avoid unprivileged use of tokenize() until fixed
Frank Ch. Eigler [Thu, 28 Oct 2010 22:07:30 +0000 (18:07 -0400)]
PR12169: avoid unprivileged use of tokenize() until fixed

13 years agoRevert "git-version: use git status --porcelain to detect tree dirtiness"
Frank Ch. Eigler [Thu, 28 Oct 2010 18:43:04 +0000 (14:43 -0400)]
Revert "git-version: use git status --porcelain to detect tree dirtiness"

This reverts commit 3c29b815f282a0629b85af1758b256bf790bf371.

Meh, old git 1.5* doesn't support this.

13 years agogit-version: use git status --porcelain to detect tree dirtiness
Frank Ch. Eigler [Thu, 28 Oct 2010 18:39:36 +0000 (14:39 -0400)]
git-version: use git status --porcelain to detect tree dirtiness

The previous "git-diff-files" and "git-diff-index --cached HEAD"
would give false-positive results.

13 years agotracepoints: restore access to include/trace/event/* points w/o debuginfo
Frank Ch. Eigler [Thu, 28 Oct 2010 17:31:26 +0000 (13:31 -0400)]
tracepoints: restore access to include/trace/event/* points w/o debuginfo

An earlier commit impeded access to kernel tracepoints that are
defined in the proper header files, but lacking the debuginfo
for the backup searching widget to work.

* tapsets.cxx (tracepoint_derived_probe_group::emit_module_decls):
  Remove "include/" substring from header files.

13 years agoImprove handling of vfork'ed processes.
David Smith [Thu, 28 Oct 2010 15:36:39 +0000 (10:36 -0500)]
Improve handling of vfork'ed processes.

* runtime/uprobes2/uprobes.c (insert_bkpt): Don't log EEXIST errors (since
  systemtap inserts duplicate probes).
  (uprobe_report_exec): Only cleanup if this is the last thread.  Without
  this change, vfork'ed processes doing an exec weren't handled correctly.

13 years agovalgrind: fix double-free
Frank Ch. Eigler [Wed, 27 Oct 2010 20:53:54 +0000 (16:53 -0400)]
valgrind: fix double-free

* translate.cxx (dump_unwindsyms): Don't free eh_frame_hdr, since
  that comes from elfutils-managed memory.

13 years agoRename hash::add_file to add_path and use it for directories
Josh Stone [Wed, 27 Oct 2010 20:17:56 +0000 (13:17 -0700)]
Rename hash::add_file to add_path and use it for directories

We may get a little better hashing by including stat() info on our
relevant directories too.

13 years agoSplit the hash.log with newlines instead of commas
Josh Stone [Wed, 27 Oct 2010 20:16:57 +0000 (13:16 -0700)]
Split the hash.log with newlines instead of commas

13 years agoDon't treat hashed numbers like strings
Josh Stone [Wed, 27 Oct 2010 20:12:08 +0000 (13:12 -0700)]
Don't treat hashed numbers like strings

Valgrind noted that we were reading uninitialized memory in __GI_strlen,
and I tracked this down to our treating a number value as a char buffer,
leading to "parm_stream << [&number]".  Since it isn't a NULL-terminated
buffer, this runs away on the stack.

* hash.cxx (hash::add): Change all the numeric variants to a template,
  which lets operator<< figure the right thing for parm_stream, and then
  pass the raw value to mdfour.

13 years agoReduce hash.h to just "export" functions
Josh Stone [Wed, 27 Oct 2010 19:24:14 +0000 (12:24 -0700)]
Reduce hash.h to just "export" functions

13 years agovalgrind cleanups: memory leaks, uninit variable warnings
Frank Ch. Eigler [Wed, 27 Oct 2010 19:35:10 +0000 (15:35 -0400)]
valgrind cleanups: memory leaks, uninit variable warnings

* dwflpp.cxx (dwflpp dtor): delete mod_info.
  (express_as_string): Don't preallocate memory for open_memstream.
  (literal_stmt_for_*): Fully free obstack after loc2c work.
* hash.cxx (add_file): Clear out struct stat before hashing.
* translate.cxx (dump_unwindsyms): Free eh/debug_frame_hdr at end.

13 years agoadded Feedback.xml file
Don Domingo [Wed, 27 Oct 2010 02:38:52 +0000 (12:38 +1000)]
added Feedback.xml file

13 years agoMerge branch 'master' of ssh://sources.redhat.com/git/systemtap
William Cohen [Mon, 25 Oct 2010 22:23:04 +0000 (18:23 -0400)]
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap

13 years agoFix thread_ident typos.
William Cohen [Mon, 25 Oct 2010 22:19:37 +0000 (18:19 -0400)]
Fix thread_ident typos.

13 years agoInclude module containing sdt probes in list that dump_unwindsyms will handle.
Stan Cox [Mon, 25 Oct 2010 20:57:22 +0000 (16:57 -0400)]
Include module containing sdt probes in list that dump_unwindsyms will handle.

* tapsets.cxx (handle_probe_entry): Add module to sess.unwindsym_modules.

13 years agodocs: slightly separate utrace vs uprobes based user-space probes
Frank Ch. Eigler [Thu, 21 Oct 2010 21:59:48 +0000 (17:59 -0400)]
docs: slightly separate utrace vs uprobes based user-space probes

13 years agoPR6456: NEWS blurb tweak
Frank Ch. Eigler [Thu, 21 Oct 2010 21:52:27 +0000 (17:52 -0400)]
PR6456: NEWS blurb tweak

13 years agoPR6456: use an "any" interpretation for process-wildcard probe matches
Frank Ch. Eigler [Thu, 21 Oct 2010 21:46:50 +0000 (17:46 -0400)]
PR6456: use an "any" interpretation for process-wildcard probe matches

* tapsets.cxx (dwarf_builder::build): Canonicalize & optionalize glob-matched
  filenames.
* staptree.cxx (probe::probe): New copy constructor for unusual derivation.
* staptree.h: Corresponding changes.
* main.cxx (printscript): Print full derivation chain for high verbosity.
* testsuite/systemtap.base/prcwildcard.exp: New test.

13 years agoPR6456: documentation
Frank Ch. Eigler [Thu, 21 Oct 2010 21:46:12 +0000 (17:46 -0400)]
PR6456: documentation

13 years agoNEWS: mention process("*") wildcards; tighten up other text
Frank Ch. Eigler [Tue, 28 Sep 2010 23:22:02 +0000 (19:22 -0400)]
NEWS: mention process("*") wildcards; tighten up other text

13 years agoPR6456: support wildcards in process("/bin/*") probes
Frank Ch. Eigler [Tue, 28 Sep 2010 20:05:34 +0000 (16:05 -0400)]
PR6456: support wildcards in process("/bin/*") probes

* tapsets.cxx (dwarf_builder::build): For process probes, detect
  and expand glob patterns via synthetic aliases.
* util.* (contains_glob_chars): New function.

* tapsets.cxx (tracepoint_builder::init_dw): Throw error if glob(3) failed.

13 years agoadd blurb explaining limited mode of isglob()/isdoubleglob()
Frank Ch. Eigler [Tue, 28 Sep 2010 20:04:59 +0000 (16:04 -0400)]
add blurb explaining limited mode of isglob()/isdoubleglob()

13 years agorpm-finder: produce suppressible WARNINGs instead of direct cerr messages.
Frank Ch. Eigler [Tue, 28 Sep 2010 20:04:08 +0000 (16:04 -0400)]
rpm-finder: produce suppressible WARNINGs instead of direct cerr messages.

13 years agoAUTHORS bump
Josh Stone [Thu, 21 Oct 2010 02:47:25 +0000 (19:47 -0700)]
AUTHORS bump

13 years agoBuild test for task_dentry_path
Josh Stone [Thu, 21 Oct 2010 02:45:40 +0000 (19:45 -0700)]
Build test for task_dentry_path

13 years agoA few further pfiles tweaks
Josh Stone [Thu, 21 Oct 2010 02:37:30 +0000 (19:37 -0700)]
A few further pfiles tweaks

- Handle device numbers that are (0,0).
- Add kreads on a few __retvalue assignments.
- Add kreads for getting sock->ops.
- Remove kreads from socket functions that are using the stack.

13 years ago__dentry_prepend should not always add trailing '/'
Erick Tryzelaar [Wed, 20 Oct 2010 17:46:26 +0000 (10:46 -0700)]
__dentry_prepend should not always add trailing '/'

13 years agoFactor out d_path printing for any dentry.
Erick Tryzelaar [Wed, 20 Oct 2010 17:46:25 +0000 (10:46 -0700)]
Factor out d_path printing for any dentry.

13 years agoRewrite pfiles to check return values
Erick Tryzelaar [Wed, 20 Oct 2010 00:09:07 +0000 (17:09 -0700)]
Rewrite pfiles to check return values

13 years agoBuild SDT's derived_loc more precisely
Josh Stone [Wed, 20 Oct 2010 23:47:55 +0000 (16:47 -0700)]
Build SDT's derived_loc more precisely

This refactors how the derived_loc is created, in a way that I think
will get better results.  For example, the kprobe variant doesn't have
to try and delete components that don't apply.  Also, the provider
component is now wildcard-expanded for probe listing.

* tapsets.cxx (sdt_query::convert_location): Build up components for
  derived_loc from scratch, rather than trying to rewrite a copy.

13 years agoPR12137: Separate the .stapsdt.base logic from probe asm
Josh Stone [Wed, 20 Oct 2010 22:03:49 +0000 (15:03 -0700)]
PR12137: Separate the .stapsdt.base logic from probe asm

This splits the SDT probes into two __asm__ statements, one for the
probe itself, and the other for logic to prepare the .stapsdt.base
section.  This avoids having a string literal that is too long for
-pedantic compilation (max length 509).

* includes/sys/sdt.h: Define _SDT_ASM_BASE for .stapsdt.base logic,
  separate from _SDT_ASM_BODY, and add to _SDT_PROBE and STAP_PROBE_ASM.

13 years agoAdd a 0-arg test to sdt.exp
Josh Stone [Wed, 20 Oct 2010 22:03:14 +0000 (15:03 -0700)]
Add a 0-arg test to sdt.exp

13 years agoPR10745 NEWS blurbage
Frank Ch. Eigler [Wed, 20 Oct 2010 17:26:16 +0000 (13:26 -0400)]
PR10745 NEWS blurbage

13 years agoPR10745: automate kernel source_tree finding with stap -r /PATH/
Frank Ch. Eigler [Wed, 20 Oct 2010 17:13:20 +0000 (13:13 -0400)]
PR10745: automate kernel source_tree finding with stap -r /PATH/

* tapsets.cxx (init_dw): Provide diagnostics when figuring out source_tree.
* session.cxx (main): Ditto.  For stap -r /PATH/, heuristically infer
  source_tree too.

13 years agoPR10745: access hidden kernel tracepoints
Frank Ch. Eigler [Wed, 20 Oct 2010 15:51:34 +0000 (11:51 -0400)]
PR10745: access hidden kernel tracepoints

Including xfs_types.h unconditionally on installations with no
kernel debuginfo would cause normal tracepoint processing to fail too.

* tapsets.cxx (tracepoint_extra_decls): Include xfs_types.h
  only if we know the kernel source tree.

13 years agoPR10745: access hidden kernel tracepoints
Frank Ch. Eigler [Wed, 20 Oct 2010 15:27:59 +0000 (11:27 -0400)]
PR10745: access hidden kernel tracepoints

A bunch of kernel tracepoints have been declared outside the conventional
include/linux/trace/* hierarchy, and left in the source tree only.  By
searching the source tree with some additional glob patterns, we can find
them and generate debuginfo the usual way.  On Fedora/RHEL, this means
looking through debuginfo to find the DW_AT_comp_dir (compilation source
directory), which is something like /usr/src/debug/kernels/FOO/BAR/.

Nearly all tracepoints appear now accessible under RHEL6/F13 era kernels:

% ls -1 /sys/kernel/debug/tracing/events/*/*/id |
  cut -f8 -d/ | egrep -v 'sys_(enter|exit)' |
  while read tp
do
  stap -L 'kernel.trace("'$tp'")' || echo no $tp
done

reports no "no"s.  Note that syscall tracepoints are treated specially
in the kernel; stap sees only a single sys_enter / sys_exit pair, thus
the egrep -v above.

* session.h (kernel_source_tree): New field.
* buildrun.cxx (compile_pass, make_tracequery): Add EXTRA_CFLAGS += -I....
  (make_tracequery): Squish repeated TRACE_INCLUDE_PATH defines.
* tapsets.cxx (tracepoint_derived_probe ctor): Relax conventions
  on tracepoint header file name.
  (tracepoint_extra_headers): Renamed to ...
  (tracepoint_extra_decls): New function.  Include struct/type forward
  decls as needed.
  (emit_module_decls): Use new decl list style.
  (tracepoint_builder::init_dw): Search kernel source tree also for
  tracepoint headers.

13 years agoDefine srcdir as global in start_server systemtap.exp testsuite helper.
Mark Wielaard [Wed, 20 Oct 2010 12:39:58 +0000 (14:39 +0200)]
Define srcdir as global in start_server systemtap.exp testsuite helper.

* testsuite/lib/systemtap.exp (start_server): Define srcdir as global
  before usage.

13 years agoDon't unnecessarily add extra $test.exe files to /tmp.
Mark Wielaard [Wed, 20 Oct 2010 10:59:20 +0000 (12:59 +0200)]
Don't unnecessarily add extra $test.exe files to /tmp.

* testsuite/systemtap.base/implicitptr.exp: Don't cp $test.exe to /tmp.

13 years agoPR12121: distinguish struct/typedef homonyms
Josh Stone [Tue, 19 Oct 2010 19:20:24 +0000 (12:20 -0700)]
PR12121: distinguish struct/typedef homonyms

For example:
  typedef struct foo foo;
  foo x;

This kind of "repeated" typedef used to cause bad things for us if the
struct definition is not in the current CU.  When resolving $x->bar, we
start at the typedef-foo and dereference to the struct-foo.  That's just
a declaration, so we use declaration_resolve to look for the struct
definition.  But since we were looking by the name "foo" only, we would
find the typedef again, getting us nowhere.

The fixed code does declaration_resolve on "struct foo" in the global cache,
so in this case we won't find anything locally, and thus we continue looking
in other CUs.  If the definition isn't found elsewhere, we're stuck anyway.

* dwflpp.cxx (dwflpp::global_alias_caching_callback): Cache type names
  with a relevant prefix: struct, union, etc.  Classes are normalized to
  be "struct" too, as that's a very blurry line.
  (dwflpp::declaration_resolve(die)): New variant to resolve a specific
  die -- used so we know what exact prefix we should look for.
* parse.cxx (parser::parse_target_symbol): Don't strip the prefix from
  @cast types anymore, so the user can be precise about what they want.
* tapsets.cxx (dwarf_cast_query::handle_query_module): Normalize "class"
  to "struct".  If the user provides a bare name that fails to resolve,
  then try it again with the various prefixes.
* testsuite/systemtap.base/unresolved-struct-typedef.*: New test.

13 years agoTwo documentation fixes from previous commits
Lukas Berk [Mon, 18 Oct 2010 20:23:11 +0000 (16:23 -0400)]
Two documentation fixes from previous commits

13 years agoPR 11442: Tests for adding/revoking trust as a module signer.
Dave Brolley [Mon, 18 Oct 2010 16:17:55 +0000 (12:17 -0400)]
PR 11442: Tests for adding/revoking trust as a module signer.

These tests alter the state of the trusted signer database which is
in the install tree, and thus should not be run when the test suite
is invoked as root. The related tests which depend on these tests
are still run, but are marked as XFAIL in this situation.

13 years agoMention TASK_FINDER_VMA_ENTRY_ITEMS if stap_add_vma_map_info returns -ENOMEM.
Mark Wielaard [Sun, 17 Oct 2010 21:22:04 +0000 (23:22 +0200)]
Mention TASK_FINDER_VMA_ENTRY_ITEMS if stap_add_vma_map_info returns -ENOMEM.

Suggested by jan.kratochvil@redhat.com, rhbz#643109.

* runtime/vma.c (_stp_vma_mmap_cb): Add -DTASK_FINDER_VMA_ENTRY_ITEMS to
  warning message.

13 years agoDocument TASK_FINDER_VMA_ENTRY_ITEMS in stap man page.
Mark Wielaard [Sun, 17 Oct 2010 21:06:15 +0000 (23:06 +0200)]
Document TASK_FINDER_VMA_ENTRY_ITEMS in stap man page.

Suggested by fche@redhat.com. rhbz#643109.

* stap.1 (SAFETY AND SECURITY): Document TASK_FINDER_VMA_ENTRY_ITEMS.

13 years agoPR12124 Emit warnings for bad unwind data encountered at runtime.
Mark Wielaard [Sun, 17 Oct 2010 20:51:28 +0000 (22:51 +0200)]
PR12124 Emit warnings for bad unwind data encountered at runtime.

* runtime/unwind.c: Turn dbug_unwind into _stp_warn when they indicate
  bad unwind data in binary.

13 years agoAdd note to ubacktrace* context functions about -d and --ldd stap switches.
Mark Wielaard [Sun, 17 Oct 2010 18:59:12 +0000 (20:59 +0200)]
Add note to ubacktrace* context functions about -d and --ldd stap switches.

rhbz#643109 Suggested by jan.kratochvil@redhat.com.

* tapset/ucontext-unwind.stp (print_ubacktrace, sprint_ubacktrace,
  print_ubacktrace_brief, ubacktrace): Add comment note about -d and --ldd.

13 years agopr11564 use the --with-rpm flag to detect a missing or wrong version kernel-devel...
Lukas Berk [Thu, 14 Oct 2010 21:17:09 +0000 (17:17 -0400)]
pr11564 use the --with-rpm flag to detect a missing or wrong version kernel-devel package in addition to the kernel-debuginfo.

13 years agopr 11554 further documentation to the SYSTEMTAP_DEBUGINFO_PATH; where it looks for...
Lukas Berk [Thu, 14 Oct 2010 21:07:28 +0000 (17:07 -0400)]
pr 11554 further documentation to the SYSTEMTAP_DEBUGINFO_PATH; where it looks for vmlinux, how to set it, and more information about debuginfo for user-space applications.

13 years agoPR 11922: Still need to resolve host names discovered using avahi.
Dave Brolley [Wed, 13 Oct 2010 20:17:00 +0000 (16:17 -0400)]
PR 11922: Still need to resolve host names discovered using avahi.

SSL requires that the client's connection be set up with an expected DNS name
which must match one of the names on the server's certificate. This is
the only protection from 'man in the middle' attacks. The server generates
it certificate to contain its own host name. <name>.local as returned by
avahi must be resolved in attaempt to match what's on the certificate.

13 years agoTranslate transmission/reception of the expected package size to/from network byte...
Dave Brolley [Wed, 13 Oct 2010 20:15:58 +0000 (16:15 -0400)]
Translate transmission/reception of the expected package size to/from network byte order.

13 years agoPR 11922: Allow specification of alternate DNS names on the generated certificate.
Dave Brolley [Wed, 13 Oct 2010 20:14:40 +0000 (16:14 -0400)]
PR 11922: Allow specification of alternate DNS names on the generated certificate.

13 years agoMake sure the 'module_name' variable is instantiated in all paths.
Dave Brolley [Wed, 13 Oct 2010 20:13:03 +0000 (16:13 -0400)]
Make sure the 'module_name' variable is instantiated in all paths.

13 years agoimprove error message for startup-time global-var allocation failure
Adrien Kunysz [Wed, 13 Oct 2010 15:27:02 +0000 (11:27 -0400)]
improve error message for startup-time global-var allocation failure

13 years agoEnsure that stap compiles when NSS is not available.
Dave Brolley [Wed, 13 Oct 2010 15:22:17 +0000 (11:22 -0400)]
Ensure that stap compiles when NSS is not available.

13 years agoPR 11898: complete CFI expression support
Roland McGrath [Thu, 7 Oct 2010 23:35:08 +0000 (16:35 -0700)]
PR 11898: complete CFI expression support

Finish support for DWARF expressions in CFI.

13 years agoPR 11898 (partial): skeleton CFI expression support
Roland McGrath [Thu, 7 Oct 2010 20:26:52 +0000 (13:26 -0700)]
PR 11898 (partial): skeleton CFI expression support

Basic decoding and storage of DW_CFA_*expression rules.
The actual expression evaluation support is still missing.

13 years agobuild fix: gcc 3.4 on ia64 vs gcc PR21838
Frank Ch. Eigler [Thu, 7 Oct 2010 20:09:12 +0000 (16:09 -0400)]
build fix: gcc 3.4 on ia64 vs gcc PR21838

* runtime/runtime.h (__ia64_save_stack_nonlocal): New dummy fn.

13 years agoDocument sdt asm operand syntax.
Stan Cox [Thu, 7 Oct 2010 20:07:40 +0000 (16:07 -0400)]
Document sdt asm operand syntax.

* tapsets.cxx (sdt_uprobe_var_expanding_visitor::visit_target_symbol):

13 years agoSupport s390 sdt asm arguments.
Stan Cox [Thu, 7 Oct 2010 02:44:55 +0000 (22:44 -0400)]
Support s390 sdt asm arguments.

* tapsets.cxx (sdt_uprobe_var_expanding_visitor): Add EM_S390 registers.

13 years agoNew test suite for the integrated compile-server client.
Dave Brolley [Tue, 5 Oct 2010 18:28:05 +0000 (14:28 -0400)]
New test suite for the integrated compile-server client.

13 years agoMiscellaneous improvements.
Dave Brolley [Tue, 5 Oct 2010 18:25:20 +0000 (14:25 -0400)]
Miscellaneous improvements.

- break out starting of a server into start_server to be used by
  setup_server and elsewhere.
- call cleanup before exiting if smoke tests fail.
- cleanup *.sgn files.

13 years agoAdd 'no-prompt' to the --trust-servers option to bypass prompting the user for confir...
Dave Brolley [Tue, 5 Oct 2010 18:24:13 +0000 (14:24 -0400)]
Add 'no-prompt' to the --trust-servers option to bypass prompting the user for confirmation.

13 years agoCorrect use of setup_kfail vs setup_xfail.
Dave Brolley [Tue, 5 Oct 2010 18:19:43 +0000 (14:19 -0400)]
Correct use of setup_kfail vs setup_xfail.

13 years agoPR 11922: Restrict compile-server client attempts to resolve server hosts.
Dave Brolley [Mon, 27 Sep 2010 16:03:39 +0000 (12:03 -0400)]
PR 11922: Restrict compile-server client attempts to resolve server hosts.

Most times we can get the proper host name/ip address from avahi or from
certificates in our databases. Only attempt to resolve hosts for servers
specified directly using --use-server.

13 years agoAdd guard for unsupported sdt architectures.
Stan Cox [Wed, 6 Oct 2010 14:27:34 +0000 (10:27 -0400)]
Add guard for unsupported sdt architectures.

* tapsets.cxx (sdt_uprobe_var_expanding_visitor::visit_target_symbol):
Guard against parsing asm probe arguments for unsupported architectures.

13 years agoRun clone/fork/vfork tests with and without semaphores.
David Smith [Tue, 5 Oct 2010 21:52:30 +0000 (16:52 -0500)]
Run clone/fork/vfork tests with and without semaphores.

* testsuite/systemtap.clone/dtrace_clone.exp: Run the test twice - once
  without semaphores, once with semaphores.
* testsuite/systemtap.clone/dtrace_fork_exec.exp: Ditto.
* testsuite/systemtap.clone/dtrace_vfork_exec.exp: Ditto.
* testsuite/systemtap.clone/test_progs.tcl: Automatically run "make clean"
  when needed.  Allow callers to specify extra CFLAGS values.
* testsuite/systemtap.clone/dtrace_child.c: Allow semaphores to be
  ifdef'ed out.
* testsuite/systemtap.clone/dtrace_clone.c: Ditto.
* testsuite/systemtap.clone/dtrace_fork_parent.c: Ditto.
* testsuite/systemtap.clone/dtrace_vfork_parent.c: Ditto.
* testsuite/systemtap.clone/Makefile.fork_exec: Removed unused define.
* testsuite/systemtap.clone/Makefile.vfork_exec: Ditto.

13 years agoIn the syscall.*utime probes, get values directly.
David Smith [Tue, 5 Oct 2010 21:07:31 +0000 (16:07 -0500)]
In the syscall.*utime probes, get values directly.

* tapset/syscalls2.stp (syscall.utime): Instead of calling a function to
  get actime/modtime, use user_long() to get the value.
  (syscall.compat_utime): Ditto.

13 years agoPR11739: Add an STP_ALIBI flag
Josh Stone [Tue, 5 Oct 2010 00:56:26 +0000 (17:56 -0700)]
PR11739: Add an STP_ALIBI flag

Primarily just for testing purposes, define STP_ALIBI to shortcut all
probe handlers, so they're nothing but an atomic_inc.  It prints a hit
report similar to STP_TIMING at the end.

Note that any logic that would have called exit() will also be blocked,
so you need other ways to end the script: SIGINT, finished -c, etc.

* tapsets.cxx (common_probe_entryfn_prologue): #ifdef STP_ALIBI, reduce
  the probe handler to just an atomic_inc().
  (common_probe_entryfn_epilogue): Close the #ifdef from above.
* translate.cxx (translate_pass): Add an atomic_t to stap_probe for
  STP_ALIBI to track probe hits.
  (c_unparser::emit_module_exit): Print alibi hit-report.

13 years agoAdded dtrace testcases for clone, fork/exec, and vfork/exec.
David Smith [Mon, 4 Oct 2010 20:48:18 +0000 (15:48 -0500)]
Added dtrace testcases for clone, fork/exec, and vfork/exec.

* testsuite/systemtap.clone/Makefile.clone: New file.
* testsuite/systemtap.clone/Makefile.fork_exec: Ditto.
* testsuite/systemtap.clone/Makefile.vfork_exec: Ditto.
* testsuite/systemtap.clone/dtrace_child.c: Ditto.
* testsuite/systemtap.clone/dtrace_child_probes.d: Ditto.
* testsuite/systemtap.clone/dtrace_clone.c: Ditto.
* testsuite/systemtap.clone/dtrace_clone.exp: Ditto.
* testsuite/systemtap.clone/dtrace_clone.stp: Ditto.
* testsuite/systemtap.clone/dtrace_clone_probes.d: Ditto.
* testsuite/systemtap.clone/dtrace_fork_exec.exp: Ditto.
* testsuite/systemtap.clone/dtrace_fork_exec.stp: Ditto.
* testsuite/systemtap.clone/dtrace_fork_parent.c: Ditto.
* testsuite/systemtap.clone/dtrace_fork_parent_probes.d: Ditto.
* testsuite/systemtap.clone/dtrace_vfork_exec.exp: Ditto.
* testsuite/systemtap.clone/dtrace_vfork_exec.stp: Ditto.
* testsuite/systemtap.clone/dtrace_vfork_parent.c: Ditto.
* testsuite/systemtap.clone/dtrace_vfork_parent_probes.d: Ditto.
* testsuite/systemtap.clone/test_progs.tcl: Ditto.

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