]> sourceware.org Git - systemtap.git/log
systemtap.git
11 years agoPreliminary regen of po; will run again before release.
Serguei Makarov [Mon, 14 Jan 2013 19:16:47 +0000 (14:16 -0500)]
Preliminary regen of po; will run again before release.

11 years agoMisc copyright year bumps for the docs.
Serguei Makarov [Mon, 14 Jan 2013 19:12:26 +0000 (14:12 -0500)]
Misc copyright year bumps for the docs.

11 years agoPR14708 partial fix: Add dyninst support to the utrace_p4.exp testcase.
David Smith [Mon, 14 Jan 2013 17:57:48 +0000 (11:57 -0600)]
PR14708 partial fix: Add dyninst support to the utrace_p4.exp testcase.

* testsuite/systemtap.base/utrace_p4.exp: Add dyninst support.

11 years agoexamples: tweak deviceseeks.stp
Frank Ch. Eigler [Fri, 11 Jan 2013 21:00:24 +0000 (16:00 -0500)]
examples: tweak deviceseeks.stp

Switch to using the ioblock_trace.request probe point (based on a
kernel tracepoint), which is more reliable than the
kprobe-on-inlined-function ioblock.request one, and makes more
information avilable.  (Unfortunately, this makes the script
incompatible with non-tracepoint kernels.)

Also, as per Jeff Moyer's correction, seeks are calculated as relative
to the end position of the prior transfer, not its origin.

11 years agoPR14774: tweak test case
Frank Ch. Eigler [Fri, 11 Jan 2013 23:04:28 +0000 (18:04 -0500)]
PR14774: tweak test case

Splitting the test case onto separate lines helps ensure separate line
records.  Also, use [utrace_p] instead of CONFIG_UTRACE* tests for
applicability.

11 years agoPR14774 test case
Daniel Tschan [Fri, 11 Jan 2013 20:45:10 +0000 (15:45 -0500)]
PR14774 test case

11 years agoPR14708 partial fix: Add dyninst support for '.thread.{begin,end}' probes.
David Smith [Fri, 11 Jan 2013 22:12:56 +0000 (16:12 -0600)]
PR14708 partial fix: Add dyninst support for '.thread.{begin,end}' probes.

* tapset-dynprobe.cxx: New file.
* tapset-dynprobe.h: New file.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_dyninst_decls):
  Instead of outputting uprobe information directly, call
  dynprobe_add_uprobe().
* tapset-utrace.cxx: Add dyninst-backend support.
* stapdyn/mutator.cxx (g_post_fork_callback): New function.
  (g_exit_callback): Ditto.
  (g_thread_create_callback): Ditto.
  (g_thread_destroy_callback): Ditto.
  (mutator::matching_probes_exist): Ditto.
  (mutator::load): Figure out which callbacks we need enabled.
  (mutator::post_fork_callback): New function.
  (mutator::exit_callback): Ditto.
  (mutator::thread_create_callback): Ditto.
  (mutator::thread_destroy_callback): Ditto.
* stapdyn/mutator.h: Add function declarations.
* stapdyn/mutatee.cxx (mutatee::instrument_utrace_dynprobe): New function.
  (mutatee::instrument_global_dynprobe_target): Ditto.
  (mutatee::instrument_dynprobe_target): Call instrument_utrace_dynprobe()
  to handle utrace probes.
  (mutatee::instrument_global_dynprobes): New function.
  (mutatee::exit_callback): Ditto.
  (mutatee::thread_callback): Ditto.
  (mutatee::instrument_dynprobes): Call instrument_global_dynprobes() to
  handle non path-based utrace probes.
  (mutatee::continue_execution): Only continue if we're stopped.
  (mutatee::stop_execution): New function.
* stapdyn/mutatee.h: Add function declarations.
* stapdyn/dynprobe.h: Added 'flags' member variable to struct
  dynprobe_location.
* stapdyn/dynprobe.cxx (dynprobe_location::dynprobe_location): Initialize
  new 'flags' member variable.
* session.h: Add dynprobe_derived_probe_group variable to systemtap_session.
* session.cxx (systemtap_session::systemtap_session): Initialize new
  dynprobe_derived_probe_group variable.
* runtime/dyninst/uprobes.c: Add stapdu_dummy_uregs definition. Declare
  enter_dyninst_uprobe() "weak", so that the function definition isn't
  necessary.
* runtime/dyninst/stapdyn.h: Added the STAPDYN_PROBE_FLAG_PROC_BEGIN,
  STAPDYN_PROBE_FLAG_PROC_END, STAPDYN_PROBE_FLAG_THREAD_BEGIN, and
  STAPDYN_PROBE_FLAG_THREAD_END defines.
* Makefile.am (stap_SOURCES): Added tapset-dynprobe.cxx.
* Makefile.in: Regenerated.

11 years agoexamples: change eventcount.* demo to report every 10 seconds by default
Frank Ch. Eigler [Fri, 11 Jan 2013 00:26:21 +0000 (19:26 -0500)]
examples: change eventcount.* demo to report every 10 seconds by default

11 years agofix minor leak on a stap error path
Nathan Scott [Wed, 9 Jan 2013 22:07:04 +0000 (17:07 -0500)]
fix minor leak on a stap error path

Attached patch frees up an overlooked NSS/SSL-related SECItem
resource on an obscure (OOM) error handling path.

Reviewed-by: Dave Brolley <brolley@redhat.com>
11 years agoPR14929: add error::dwarf man page
Frank Ch. Eigler [Sat, 5 Jan 2013 13:32:46 +0000 (08:32 -0500)]
PR14929: add error::dwarf man page

... and lots of references to it from dwarfy pass-2 code.

11 years agoNEWS: whitespace tweak
Frank Ch. Eigler [Sat, 5 Jan 2013 04:04:11 +0000 (23:04 -0500)]
NEWS: whitespace tweak

11 years agotranslate: for stap -t reports, identify probe index
Frank Ch. Eigler [Sat, 5 Jan 2013 03:32:12 +0000 (22:32 -0500)]
translate: for stap -t reports, identify probe index

For probe points that expand to multiple separate low-level kprobes,
e.g. for multiply-inlined functions, the stap -t report doesn't give
any hint as to which of those separate kprobes was invoked how many
times.  Normally, a user would not care, so that's fine, but sometimes
for debugging it's nice to match up the stap -t output to the stap -p3
stap_probes[] array elements.  So let's extend the -t output with an
undocumented index: NNN ditty.

11 years agoPR14929: add systemtap wiki URL to SEE ALSO
Frank Ch. Eigler [Sat, 5 Jan 2013 03:12:31 +0000 (22:12 -0500)]
PR14929: add systemtap wiki URL to SEE ALSO

11 years agoPR14997: DW_OP_rot mistranslation
Frank Ch. Eigler [Sat, 5 Jan 2013 03:10:56 +0000 (22:10 -0500)]
PR14997: DW_OP_rot mistranslation

* loc2c.c (STACK): Change macro to assert stack slot number >= 0.
  (DW_OP_rot): Implement last assignment against correct stack slot.
* testsuite/buildok/dw_op_rot.stp: New test.

11 years agorhbz#847265 - systemtap emits too-large hexadecimal constants
Frank Ch. Eigler [Fri, 4 Jan 2013 00:13:22 +0000 (19:13 -0500)]
rhbz#847265 - systemtap emits too-large hexadecimal constants

    Emit address constants in loc2c for synthetic addresses always as hex
    in translate_constant (). ... but then explicitly typecast it to
    (uintptr_t), so that a small negative 32-bit value, rendered as a
    64-bit positive hex value is acceptably truncated back down.

11 years agoPR14929: add error::buildid man page
Frank Ch. Eigler [Thu, 3 Jan 2013 22:51:24 +0000 (17:51 -0500)]
PR14929: add error::buildid man page

11 years agoPR14929: add error::fault man page
Frank Ch. Eigler [Thu, 3 Jan 2013 19:32:06 +0000 (14:32 -0500)]
PR14929: add error::fault man page

* translate.cxx: Redirect loc2c 'kernel {read,write} fault...' message to it.

11 years agoAUTHORS bump
Frank Ch. Eigler [Thu, 3 Jan 2013 05:48:34 +0000 (00:48 -0500)]
AUTHORS bump

(but not as in "bump off")

11 years agothe omnibus change act of 2013 for copyright and task_finding excellence
Frank Ch. Eigler [Thu, 3 Jan 2013 05:09:46 +0000 (00:09 -0500)]
the omnibus change act of 2013 for copyright and task_finding excellence

* runtime/linux/task_finder*: Add a 'purpose' filed to the
  task_finder_tgt, so that callback errors -- now becoming warnings --
  can give a little better hint to the user as to what may have gone
  wrong.  Updated tapsets-*.cxx and runtime/vma.c generators/users to
  set a string.
* bump copyright years nearby
* winnow accidentally cargo-culted copyright line (retained in relevant files)

11 years agostap|staprun|stapdyn: copyright year bump
Frank Ch. Eigler [Thu, 3 Jan 2013 04:25:07 +0000 (23:25 -0500)]
stap|staprun|stapdyn: copyright year bump

11 years agoPR11576: tolerate registration failure
Stan Cox [Thu, 3 Jan 2013 03:48:08 +0000 (22:48 -0500)]
PR11576: tolerate registration failure

Previous code didn't check error returns from per-task perfctr
registration calls into the kernel.

11 years agoAdd relavent systemd files for stap-server
Jóhann B. Guðmundsson [Mon, 31 Dec 2012 19:47:23 +0000 (14:47 -0500)]
Add relavent systemd files for stap-server

* stap-server.conf - specify the alternate location of the stap-server
log file
* stap-server.service - systemd configuration file

11 years agoAdd an 'update-docs' script to regenerate and update web documenation
Lukas Berk [Fri, 28 Dec 2012 21:02:05 +0000 (16:02 -0500)]
Add an 'update-docs' script to regenerate and update web documenation

11 years agoPR14883: add combined error message for task_finder_stubs warnings and 'user-space...
Serguei Makarov [Fri, 21 Dec 2012 19:27:35 +0000 (14:27 -0500)]
PR14883: add combined error message for task_finder_stubs warnings and 'user-space facilities not available' error.

The basic idea behind the renaming is that, if one manpage explains both
errors and warnings, we title it error::FOO, 'error' being the somewhat
more general term.

11 years agoCHECK_ERRWARN_MANPAGES.sh: stop trying to return a rc=1 from KO
Frank Ch. Eigler [Fri, 21 Dec 2012 17:55:53 +0000 (12:55 -0500)]
CHECK_ERRWARN_MANPAGES.sh: stop trying to return a rc=1 from KO

(Since rc=1 from the while loop doesn't make it out of the loop.
/me hugs forked subshells.)

11 years agoman/CHECK_ERRWARN_MANPAGES.sh: dumb little script for source [man foo::BAR] auditing
Frank Ch. Eigler [Fri, 21 Dec 2012 17:51:16 +0000 (12:51 -0500)]
man/CHECK_ERRWARN_MANPAGES.sh: dumb little script for source [man foo::BAR] auditing

11 years agoPR14929: Add warning* man pages to spec file
Lukas Berk [Fri, 21 Dec 2012 14:27:59 +0000 (09:27 -0500)]
PR14929: Add warning* man pages to spec file

* systemtap.spec - added warning* man pages

11 years agotranslator: comment upon a privilege question for tapset files
Frank Ch. Eigler [Fri, 21 Dec 2012 12:15:42 +0000 (07:15 -0500)]
translator: comment upon a privilege question for tapset files

* main.cxx (passes_0_4): Explain why existing tapset-privilege
  flagging is valid.

11 years agoPR14929: further tweak manpage reference for pass4.
Serguei Makarov [Thu, 20 Dec 2012 20:24:31 +0000 (15:24 -0500)]
PR14929: further tweak manpage reference for pass4.

11 years agoNEWS: tweak error::* man page invocation wording
Frank Ch. Eigler [Thu, 20 Dec 2012 19:50:29 +0000 (14:50 -0500)]
NEWS: tweak error::* man page invocation wording

11 years agoPR14929: minor tweaks to existing manpages.
Serguei Makarov [Thu, 20 Dec 2012 17:08:37 +0000 (12:08 -0500)]
PR14929: minor tweaks to existing manpages.

11 years agoPR14929 possible tweak: use [man error::FOO] convention for error::pass4 reference.
Serguei Makarov [Thu, 20 Dec 2012 17:01:13 +0000 (12:01 -0500)]
PR14929 possible tweak: use [man error::FOO] convention for error::pass4 reference.

11 years agoPR14929: tweak NEWS blurbage to mention warning::* pages.
Serguei Makarov [Thu, 20 Dec 2012 16:20:10 +0000 (11:20 -0500)]
PR14929: tweak NEWS blurbage to mention warning::* pages.

11 years agoPR14929: revert earlier manpage-reporting mechanism as too clunky.
Serguei Makarov [Thu, 20 Dec 2012 16:17:01 +0000 (11:17 -0500)]
PR14929: revert earlier manpage-reporting mechanism as too clunky.

Instead of having separate semantic_error_manpage() &c classes,
we can just put a compact [man error::...] reference in the error message.
This does not require additional error reporting machinery.

11 years agotestsuite: don't run systemtap.base/suppress-time-limit.exp either unless installchec...
Frank Ch. Eigler [Thu, 20 Dec 2012 15:34:50 +0000 (10:34 -0500)]
testsuite: don't run systemtap.base/suppress-time-limit.exp either unless installcheck'ing

11 years agotestsuite: don't run systemtap.base/perf.exp unless installcheck'ing
Frank Ch. Eigler [Thu, 20 Dec 2012 15:33:36 +0000 (10:33 -0500)]
testsuite: don't run systemtap.base/perf.exp unless installcheck'ing

11 years agoPR12443: NEWS the bad boy
Frank Ch. Eigler [Thu, 20 Dec 2012 15:31:15 +0000 (10:31 -0500)]
PR12443: NEWS the bad boy

11 years agoPR12443: skip duplicate tapset files between XDG_DATA_DIRS and $prefix
Frank Ch. Eigler [Thu, 20 Dec 2012 15:02:15 +0000 (10:02 -0500)]
PR12443: skip duplicate tapset files between XDG_DATA_DIRS and $prefix

For a self-built systemtap installation, with a $prefix other than
/usr, run on a system with $XDG_DATA_DIRS set, the tapset *.stp /
*.stpm files will collide between those in the freshly-build one and
the system one.  This can result in warning messages, duplicate
probes, and cats and dogs living together.

We try to avoid this by duplicate-elimination based upon the tapset
file name.

* session.cxx (systemtap_session ctor): Put compiled-in / -I tapset
  path first.
* main.cxx (passes_0_4): While processing *.stpm and *.stp tapset
  files, skip subsequent ones that share same sub-path-name (part
  after the -I path/ or XDG_DATA_DIRS=path1/:path2/ elements.
  With greater pass-1 verbosity, explain.

11 years agodocumentation: add error::inode-uprobes man page & references
Frank Ch. Eigler [Thu, 20 Dec 2012 13:14:45 +0000 (08:14 -0500)]
documentation: add error::inode-uprobes man page & references

11 years agoPR14883: mention new warning::process-tracking from runtime warning
Frank Ch. Eigler [Thu, 20 Dec 2012 02:46:48 +0000 (21:46 -0500)]
PR14883: mention new warning::process-tracking from runtime warning

11 years agoerror docs: add warning::debuginfo.7stap for missing-debuginfo situation
Frank Ch. Eigler [Thu, 20 Dec 2012 01:28:56 +0000 (20:28 -0500)]
error docs: add warning::debuginfo.7stap for missing-debuginfo situation

11 years agoPR14883: add manpage explaining the new process-tracking warning messages.
Serguei Makarov [Wed, 19 Dec 2012 22:34:56 +0000 (17:34 -0500)]
PR14883: add manpage explaining the new process-tracking warning messages.

11 years agoPR14883: let stuff that demands task_finder, incl. probefunc(), fail gracefully when...
Serguei Makarov [Wed, 19 Dec 2012 21:18:23 +0000 (16:18 -0500)]
PR14883: let stuff that demands task_finder, incl. probefunc(), fail gracefully when such is not available

Now, instead of failing pass-4, code demanding task_finder process tracking
functionality on systems where the facility is unavailable will run with
a warning, then silently ignore any task_finder callbacks that the script
attempts to register.

* runtime/vma.c (_stp_vma_init()): return silently without doing anything if HAVE_TASK_FINDER is not set.
* runtime/linux/task_finder3.c: new file.
* runtime/linux/runtime.h: include task_finder3.c if actual task_finder not available.

11 years agoPR14714: Mention --suppress-time-limits flag in NEWS.
Frank Ch. Eigler [Tue, 18 Dec 2012 22:47:28 +0000 (17:47 -0500)]
PR14714: Mention --suppress-time-limits flag in NEWS.

11 years agoPR14714: Introduce --suppress-time-limits flag
Lukas Berk [Tue, 18 Dec 2012 21:24:09 +0000 (16:24 -0500)]
PR14714: Introduce --suppress-time-limits flag

This flag enables somewhat heavier weight scripts to be run, disabling
-DSTP_NO_OVERLOAD, -DMAXACTION, and -DMAXTRYLOCK mechanisms.  The flag
itself also requires guru mode to be specified.

* cmdline.cxx - add the new long option
* cmdline.h - add the corresponding long option to enum
* hash.cxx - add the option to be hashed
* man/stap.1 - updated man page reflecting new option
* runtime/common_probe_context.h - remove actionremaining declaration if
flag is specified and the variable is no longer needed
* runtime/dyninst/probe_lock.h - remove the check against MAXTRYLOCK if
the flag is specified
* runtime/linux/probe_lock.h - remove the check against MAXTRYLOCK if
the flag is specified
* runtime/runtime_defines.h - remove the declarations of MAXTRYLOCK and
MAXACTION if the flag is specified
* session.cxx - add flag bool for stap proper, stap help message, and
command line option check
* session.h - declare the flag boolean
* tapset-timers.cxx - add conditionals for the module 'actionremaning'
variable if the flag is specified
* tapsets.cxx - add conditionals for the module 'actionremaning'
variable if the flag is specified
* testsuite/systemtap.base/suppress-time-limit.exp - new testcase
* testsuite/systemtap.base/suppress-time-limit.stp - testcase script
* translate.cxx - add conditional based on stap proper boolean to
record_actions function

11 years agoexamples: use ppfunc() instead of probefunc() for nested traces
Frank Ch. Eigler [Tue, 18 Dec 2012 14:08:06 +0000 (09:08 -0500)]
examples: use ppfunc() instead of probefunc() for nested traces

11 years agoruntime: Updated support for uretprobes test kernels
Josh Stone [Mon, 17 Dec 2012 23:44:33 +0000 (15:44 -0800)]
runtime: Updated support for uretprobes test kernels

This updates support for uretprobes kernels from here:
  http://repos.fedorapeople.org/repos/aarapov/kernel-uprobes/
... particularly kernel-3.7.0-99.uretprobes.fc18 built 13-Dec-2012.

The struct uretprobe_consumer is gone, and now both uprobes and
uretprobes use the same struct uprobe_consumer.  The signature of the
handler function has changed to include a long addr for the uretprobes'
true return address.  In the future that parameter will also be set for
plain uprobes to the equivalent of uprobe_get_swbp_addr().

I'm knowingly breaking compatibility with earlier uretprobes test
kernels.  As far as I know, those have never been officially shipped
anywhere, so that should be fine.  This does maintain compatibility with
the version of plain uprobes before the change in the handler signature.

* runtime/linux/uprobes-inode.c (struct stapiu_consumer): Collapse the
  uconsumer and uretconsumer back to a single entry.
  (stapiu_probe_prehandler): Fill in the given IP temporarily, then call
  the true handler from the translator.
  (stapiu_probe_prehandler_noaddr): Compatibility handler to grab the IP
  from uprobe_get_swbp_addr().
* runtime/linux/autoconf-inode-uprobes-noaddr.c: New autoconf to detect
  the former version of uprobes handler, without the addr parameter.
* buildrun.cxx (compile_pass): Use that autoconf.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_inode_decls):
  Yield the IP-munging duties to uprobes-inode.c.

11 years agostapdyn: Use shared memory for globals
Josh Stone [Sat, 15 Dec 2012 02:00:32 +0000 (18:00 -0800)]
stapdyn: Use shared memory for globals

All globals are now in shared memory, no matter what type.

* runtime/dyninst/common_session_state.h: Add globals to the session
  struct, and change the timing stats to offptr_t.  Create global()
  macros to abstract the access to various globals.
* runtime/linux/common_session_state.h: Create the simpler kernel
  equivalents of the global() macros.
* runtime/dyninst/map_runtime.h: Use shm for allocating map and pmap.
* runtime/dyninst/stat_runtime.h: Use shm for allocating stats.
* runtime/dyninst/runtime.h (stp_pthread_rwlock_init_shared): New,
  for initializing global locks with PTHREAD_PROCESS_SHARED set.
* translate.cxx: Use global() macros everywhere that did "global.foo".
  (c_unparser::emit_global): Emit stapdyn globals with a union foo_typed
  so that the global() macros can type-check it a little.
  (translate_pass): Globals are only statically-initialized in kernel
  mode, where they might be overridden early by module params.
  (c_unparser::emit_module_init): For stapdyn mode, initialize global
  values during the rest of the module initialization.
* testsuite/buildok/globals.stp: Simple test building all global types.

11 years agoAdd process("NAME") to perf probe.
Stan Cox [Fri, 14 Dec 2012 18:59:42 +0000 (13:59 -0500)]
Add process("NAME") to perf probe.

* NEWS: Added.
* stapprobes.3stap: Added.

* perf.c (_stp_perf_init,_stp_perf_del):  Add support for task.

* perf.h (stap_perf_probe):  Add per_thread, per_thread_event, tgt.

* tapset-perfmon.cxx (TOK_PROCESS): New
  (perf_derived_probe): Add has_process, process_name.
  (join_group): Enable the task finder.
  (emit_module_decls): Add perf_event.h.  perf.h is needed sooner.
  Emit task finder callback: _stp_perf_probe_cb.  Setup task finder.

* perf.exp, towers.c: New.
* unprivileged_probes.exp (restricted_probe_types): Added
  perf.type(number).config(number).process

11 years agodoc: add -a ARCH documentation to stap.1 man page
Frank Ch. Eigler [Fri, 14 Dec 2012 12:36:40 +0000 (07:36 -0500)]
doc: add -a ARCH documentation to stap.1 man page

Reported-By: Björn Arnelid
11 years agopr13306.exp: Match probe hit report more precisely in expected output
Mark Wielaard [Fri, 14 Dec 2012 10:21:03 +0000 (11:21 +0100)]
pr13306.exp: Match probe hit report more precisely in expected output

11 years agoPR14957: Don't force __GFP_ZERO into kmalloc_node
Josh Stone [Thu, 13 Dec 2012 21:31:53 +0000 (13:31 -0800)]
PR14957: Don't force __GFP_ZERO into kmalloc_node

It turns out that rhel5-era kernels have a BUG check in slab cache_grow
that doesn't permit __GFP_ZERO from this path.  Later kernels corrected
this, as the implementation of kzalloc_node is just kmalloc_node with
__GFP_ZERO added, but for compatibility we can't rely on that.

* runtime/linux/alloc.c (_stp_kzalloc_node_gfp): Use a plain
  _stp_kmalloc_node_gfp, then memset-0 manually.

11 years agorhbz#847265 - systemtap emits too-large decimal constants
Mark Wielaard [Thu, 13 Dec 2012 21:08:18 +0000 (22:08 +0100)]
rhbz#847265 - systemtap emits too-large decimal constants

Emit address constants in loc2c for synthetic addresses always as hex
in translate_constant ().

11 years agoTrivial typo fixes in the stap-server README file.
Nathan Scott [Thu, 13 Dec 2012 02:08:20 +0000 (21:08 -0500)]
Trivial typo fixes in the stap-server README file.

11 years agostapdyn: Move contexts into shm
Josh Stone [Wed, 12 Dec 2012 23:34:39 +0000 (15:34 -0800)]
stapdyn: Move contexts into shm

David already abstracted different allocation schemes for runtime
contexts, so this time the kernel runtime needs no change.  The dyninst
runtime now has the per-cpu contexts included in shared memory.

* translate.cxx (c_unparser::emit_common_header): Move runtime_context.h
  and common_session_state.h right after the struct context definition.
* runtime/dyninst/common_session_state.h: Add struct context[] to shm.
  (stp_session_context): New function to access a specific context.
* runtime/dyninst/runtime_context.h (_stp_runtime_contexts_alloc/free):
  Don't manage memory anymore, just initialize the locks and be done.
  Use stp_session_context throughout to retrieve contexts.
* runtime/dyninst/runtime.h (stp_pthread_mutex_init_shared): New, set
  the PTHREAD_PROCESS_SHARED attribute while initializing a mutex.
* runtime/dyninst/shm.c (_stp_shm_finalize): dbug the final mmap addr.

11 years agostapdyn: Move alibi and timing stats to shm
Josh Stone [Wed, 12 Dec 2012 22:02:00 +0000 (14:02 -0800)]
stapdyn: Move alibi and timing stats to shm

In dyninst mode, the alibi and timing parts are now part of the main
session struct that lives in shared memory.  In kernel mode the same
parts are their own global arrays, but otherwise unchanged.

Also, the global stap_probes[] that used to hold these has no more
mutable members, so it is now const.

* runtime/dyninst/common_session_state.h: Add alibi and timing data to
  the session, and define functions to access them.
* runtime/linux/common_session_state.h: Move alibi and timing data to
  global arrays, and define the same access functions.
* tapsets.cxx (common_probe_entryfn_prologue): Use probe_alias() and
  probe_timing() to get the relevant data in runtime-neutral ways.
* translate.cxx (c_unparser::emit_module_exit): Ditto.
  (translate_pass): Define STP_PROBE_COUNT for sizing related arrays.
  Update the stap_probes[] initialization with a fixed index to access
  the relocated alias/timing data, and make the whole thing const.
* [everything else]: Always use const struct stap_probe pointers.

11 years agoFix a couple more missed atomic changes
Josh Stone [Wed, 12 Dec 2012 21:12:12 +0000 (13:12 -0800)]
Fix a couple more missed atomic changes

More fallout from commit 065d5567...

11 years agoPR14949: Fix the way exit() accesses the session_state
Josh Stone [Wed, 12 Dec 2012 18:21:52 +0000 (10:21 -0800)]
PR14949: Fix the way exit() accesses the session_state

Commit 065d5567 abstracted this, but I missed a spot...

11 years agostapdyn: Move global session counters into shm
Josh Stone [Tue, 11 Dec 2012 23:09:54 +0000 (15:09 -0800)]
stapdyn: Move global session counters into shm

In dyninst mode, the atomic_t session_state, error_count, and various
skipped_counts are now lumped into a common structure which is allocated
first thing in shared memory.  Kernel mode is effectively unchanged.

* runtime/common_session_state.h: Split into runtime specifics.
* runtime/dyninst/common_session_state.h: Define a session struct,
  access functions, and an initialization function using shm.
* runtime/linux/common_session_state.h: Leave the former atomics as
  globals, but provide the same function abstractions as in /dyninst/.
* translate.cxx (c_unparser::emit_module_init): Call stp_session_init.
* [everything else]: Update how those global variables are accessed,
  essentially just s/&foo/foo()/g.

11 years agostapdyn: Guard against unfound return probes
Josh Stone [Tue, 11 Dec 2012 19:49:58 +0000 (11:49 -0800)]
stapdyn: Guard against unfound return probes

Sometimes dyninst will identify an instrumentation point, but be unable
to find its corresponding return.  The reason for this is not yet known,
but we should be defensive against NULL from findPoint(BPatch_locExit).

* stapdyn/mutatee.cxx (mutatee::instrument_dynprobe_target): Check the
  return value of findPoint(BPatch_locExit), and warn if not found.

11 years agotapset: Add ppfunc() to parse the function name from pp()
Josh Stone [Tue, 11 Dec 2012 19:48:07 +0000 (11:48 -0800)]
tapset: Add ppfunc() to parse the function name from pp()

This performs similarly to the pre-2.0 probefunc(), but without the
fallback to addr->symbol lookups.  That is, if pp() doesn't have a
function name, then an empty string is returned without further ado.

11 years agoruntime/dyninst/shm: Add debug statements
Josh Stone [Tue, 11 Dec 2012 02:56:02 +0000 (18:56 -0800)]
runtime/dyninst/shm: Add debug statements

11 years agoruntime: offptr_t: Fix NULL, and add a global implementation
Josh Stone [Tue, 11 Dec 2012 01:11:45 +0000 (17:11 -0800)]
runtime: offptr_t: Fix NULL, and add a global implementation

NULL can't be treated as a relative pointer, because it's always
absolute.  Good thing we weren't using offptr_t in relocatable memory
yet.  Now this is treated as the special case it must be.

I've also added another offptr_t implementation, based on a fixing
offsets from the global shared-memory base.  This means it's only good
for pointers within that memory, but math should be simpler.

11 years agostapdyn: Add a shared-memory allocator
Josh Stone [Tue, 11 Dec 2012 00:26:11 +0000 (16:26 -0800)]
stapdyn: Add a shared-memory allocator

* runtime/dyninst/stapdyn.h (stp_dyninst_shm_init): Called to
  initialize the shared memory and return its name for mutatees.
  (stp_dyninst_shm_connect): Called connect a mutatee to shm.
* runtime/dyninst/runtime.h (stp_dyninst_session_init): Make sure that
  stp_dyninst_shm_init is called, in case of old stapdyn.
* runtime/dyninst/shm.c: All new functions to create, map, and allocate
  from shared memory.  Allocation must only be done from the main
  process before anyone else connects, so we don't have to worry about
  signalling other processes about the growth.

11 years agorhbz#884951 nfs_proc.stp fetch inode from nfs_pgio_header in linux 3.4.
Mark Wielaard [Mon, 10 Dec 2012 22:45:19 +0000 (23:45 +0100)]
rhbz#884951 nfs_proc.stp fetch inode from nfs_pgio_header in linux 3.4.

linux commit cd841605f7a721878d8a2d1362484723d8abf569

    NFS: create common nfs_pgio_header for both read and write

moved inode field into common header structure.

11 years agoAdjust nfs_proc.stp to account for separate nfsv2/3/4 kernel modules.
Mark Wielaard [Mon, 10 Dec 2012 22:13:03 +0000 (23:13 +0100)]
Adjust nfs_proc.stp to account for separate nfsv2/3/4 kernel modules.

Since linux 3.6 the nfs_proc functions are put in separate nfsv2/3/4
modules. Add alternatives that match the functions in the separate
nfs modules.

11 years agoPR14929 introduced new man pages, including them in systemtap.spec
Lukas Berk [Mon, 10 Dec 2012 15:05:59 +0000 (10:05 -0500)]
PR14929 introduced new man pages, including them in systemtap.spec

systemtap.spec - adding new man pages

11 years agoruntime: Use single allocation for stapdyn maps again
Josh Stone [Sat, 8 Dec 2012 01:06:40 +0000 (17:06 -0800)]
runtime: Use single allocation for stapdyn maps again

The kernel maps are left as-is, but I remembered a good reason why I
wanted large allocations for stapdyn.  As explained in _stp_pmap_new:

    The reason for this is that we're allocating in the shared memory
    mmap, which may have to move locations in order to grow.  If some
    smaller unit of the pmap allocation were to cause the whole thing to
    move, then we'd lose track of the prior allocations.

    Once returned from here, we'll always access the pmap via the global
    shared memory base.  So if other map/pmap/stat/etc. allocations
    cause it to move later, that's ok.

We're not *actually* using a shared memory mmap quite yet, but we're
almost there, I promise...

11 years agoPR14929: add a reference from stap.1 to error::reporting.7stap
Frank Ch. Eigler [Sat, 8 Dec 2012 07:35:14 +0000 (02:35 -0500)]
PR14929: add a reference from stap.1 to error::reporting.7stap

11 years agoNEWS: add some blurbage
Frank Ch. Eigler [Sat, 8 Dec 2012 07:31:33 +0000 (02:31 -0500)]
NEWS: add some blurbage

11 years agoPR14929: tweak error->man page reference blurb, add a few starters
Frank Ch. Eigler [Sat, 8 Dec 2012 07:21:33 +0000 (02:21 -0500)]
PR14929: tweak error->man page reference blurb, add a few starters

* man/error::*: new man pages.
* man/Makefile.am: Install them.
* main.cxx, parse.cxx, session.cxx: Tweak message wording.  Add message
  for pass-4 (build) failure.

11 years agostap-report: add dyninst & avahi to RPM version query
Frank Ch. Eigler [Sat, 8 Dec 2012 07:21:00 +0000 (02:21 -0500)]
stap-report: add dyninst & avahi to RPM version query

11 years agoPR12443/testsuite: unset XDG_DATA_DIRS before invoking testsuite
Frank Ch. Eigler [Sat, 8 Dec 2012 06:25:05 +0000 (01:25 -0500)]
PR12443/testsuite: unset XDG_DATA_DIRS before invoking testsuite

11 years agoruntime: clean up obsolete map declarations
Josh Stone [Sat, 8 Dec 2012 00:00:17 +0000 (16:00 -0800)]
runtime: clean up obsolete map declarations

11 years agoruntime: Make a pointer-free Stat for stapdyn
Josh Stone [Fri, 7 Dec 2012 23:27:40 +0000 (15:27 -0800)]
runtime: Make a pointer-free Stat for stapdyn

Similar to what was done for maps, add offptr_t indirection in
struct _Stat to make these suitable for shared memory.

11 years agoPR14929: move man pages under man/
Frank Ch. Eigler [Fri, 7 Dec 2012 19:48:58 +0000 (14:48 -0500)]
PR14929: move man pages under man/

Just a plain file move, plus necessary configury changes.
Plus a bonus mini-canonicalization of some stappaths.7 items.

11 years agoPR14929: groundwork for letting stap refer the user to man staperrors.
Serguei Makarov [Fri, 7 Dec 2012 18:00:47 +0000 (13:00 -0500)]
PR14929: groundwork for letting stap refer the user to man staperrors.

To tag an error with a specific manpage, replace
semantic_error (...)
--> semantic_error_manpage ("name_of_manpage", ...)
or
parse_error (...)
--> parse_error_manpage ("name_of_manpage", ...)

Then both errors will output messages instructing the user to refer
to man 3stap error::name_of_manpage.

11 years agoruntime: remove the map_node data_offset
Josh Stone [Fri, 7 Dec 2012 02:29:32 +0000 (18:29 -0800)]
runtime: remove the map_node data_offset

The value in the map_node is now an honest member of the struct.  Here
are your papers, congratulations, now get to work!

* runtime/map-gen.c (KEYSYM(map_node)): Add the value.
  (MAP_COPY_VAL): New macro to assist in pmap aggregation.
* runtime/pmap-gen.c (KEYSYM(pmap_update_node)): New callback for
  aggregation node updates, copying the keys and values as needed.
* runtime/map-stat.c (_stp_map_new_hstat, _stp_pmap_new_hstat): New
  constructors to take responsibility for setting HIST_NONE.
  (_stp_[p]map_new_hstat_{log,linear}): Only need to augment the size
  with the histogram buckets now; the stat_data is already there.
* runtime/map.c (_stp_map_new, _stp_pmap_new): No longer need the value
  type, not the separate key/data sizes; a simple node_size is enough.

11 years agoruntime: remove the 'type' metadata from map_node
Josh Stone [Thu, 6 Dec 2012 22:53:52 +0000 (14:53 -0800)]
runtime: remove the 'type' metadata from map_node

We always know what the type should be, so pass that info around.

* runtime/map-gen.c (map_get_key): This returns value "keys" now too,
  for simpler use by _stp_map_sort[n] and _stp_cmp.
  (MAP_GET_VAL): Use more direct access to the value.
  (_stp_map_get_VALNAME): New, provide a single typed value getter.
* runtime/map.c (_stp_get_TYPE): Remove these type-generic getters.
  (_stp_cmp): Let get_key sort out the type and where to get it.
  (_stp_map_sort[n]): This needs no type knowledge now.
  (_stp_new_agg, _stp_add_agg, _stp_pmap_agg, _new_map_clear_node): Pass
  the type as a parameter from map-gen code that knows it statically.
* translate.cxx (itervar::get_value): Use _stp_map_get_VALNAME.

11 years agoArm doesn't have support for dyninst at the moment, so disable it for arm.
William Cohen [Thu, 6 Dec 2012 21:52:30 +0000 (16:52 -0500)]
Arm doesn't have support for dyninst at the moment, so disable it for arm.

11 years agoruntime: Remove dupes between map-gen and pmap-gen
Josh Stone [Thu, 6 Dec 2012 19:21:47 +0000 (11:21 -0800)]
runtime: Remove dupes between map-gen and pmap-gen

Most of pmap-gen was a rehash of map-gen, just named pmap instead.  Only
a few of the pmap functions were actually unique to that situation, so
the rest have been terminated with extreme prejudice.

This also addresses a FIXME note I added in commit 57eedf945 about the
way map-gen and pmap-gen are included.  Made it in before the seventh
anniversary of that FIXME -- whew!

* translate.cxx (c_unparser::emit_map_type_instantiations): Set
  MAP_DO_PMAP to trigger the pmap-gen from within map-gen.
* runtime/map-gen.c (KEY_EQ_P): New, consolidate testing of all keys.
  (MAP_DO_PMAP): Use to include pmap-gen while the #defines are hot.
* runtime/pmap-gen.c: I love the smell of napalm in the morning...

11 years agoAvoid using probefunc() in the syscall tapsets
William Cohen [Wed, 5 Dec 2012 22:43:28 +0000 (17:43 -0500)]
Avoid using probefunc() in the syscall tapsets

Some of the tapsets still used probefunc(). Unfortunately probefunc
may trigger the use of taskfinder support on machines that do not yet
support taskfinder.  To work around issue kernel-space tapset probes
can use symname(addr()).

11 years agoruntime: Break up map allocs again
Josh Stone [Wed, 5 Dec 2012 21:31:56 +0000 (13:31 -0800)]
runtime: Break up map allocs again

I ran into trouble with a few tests inconsistently failing to allocate
their maps.  I believe this is because the new allocation scheme I made
in commit db45dfde was just to big for fragmented memory.  This commit
goes back to allocating each node separately, but keeps the rest of the
cleanups made before.

* runtime/map.c (_stp_map_new): Allocate the map_root on its own.
  (_stp_map_init): Then allocate each map_node separately too.
  (_stp_map_del): Delete the map_nodes too.

11 years agoruntime: Remove the map_node pointer to its root
Josh Stone [Wed, 5 Dec 2012 01:27:44 +0000 (17:27 -0800)]
runtime: Remove the map_node pointer to its root

The only thing this helped anymore was getting the type and data_offset,
which we can embed directly instead.  Those might actually be better in
the future as KEYSYM-specialized functions anyway.  With this change,
all map stuctures are now pointer-free!

11 years agoruntime: Remove function pointers from struct map_root
Josh Stone [Wed, 5 Dec 2012 00:27:51 +0000 (16:27 -0800)]
runtime: Remove function pointers from struct map_root

More work on the way to shared-memory stapdyn, this patch removes the
function pointers from struct map_root.  The functions which used those
pointers now take them as parameters, and the translator calls through
[p]map-gen intermediaries to figure those out.

* runtime/map.h (struct map_root): Remove the function pointers, as well
  as ancient unused fields "list" and "key".  Declare typedefs for those
  function pointers, and add them as parameters to needed functions.
* runtime/map-gen.c: No more initializing those function pointers, and
  add new KEYSYM wrapper functions to pass those as parameters.
* runtime/pmap-gen.c: Ditto.
* runtime/map.c: Use the parameterized function pointers as needed.
* translate.cxx (mapvar::function_keysym): New generic name-generator
  for KEYSYM-wrapped functions.  Use it as-needed.

11 years agoruntime: Allocate maps in fewer chunks
Josh Stone [Tue, 27 Nov 2012 21:44:26 +0000 (13:44 -0800)]
runtime: Allocate maps in fewer chunks

This makes map allocations as more unified chunks, basically just one
big allocation for each map_root.  For pmaps, there's one base
allocation, then the separate map_roots for each cpu and the aggregate.
Fewer chunks means fewer pointers to keep track of, which contributes to
the pointer-free goals of shared-memory stapdyn.

* runtime/*/alloc.c: Add kzalloc_node variants.
* runtime/*/map_runtime.h (struct pmap): Abstract the map_roots with
  plain pointers in kernel or offptr_t in stapdyn.
* runtime/map.h (struct map_root): Make "hashes" a fixed array.
* runtime/map.c (_stp_map_init): No more allocation, just initialize
  fields and insert the nodes into the free pool.
  (_stp_map_normalize_key_size, _stp_map_normalize_data_size): Setup the
  key and data sizes in a uniform way.
  (_stp_map_new): Allocate the map_nodes along with the map_root.
  (_stp_pmap_new): Allocate the base pmap, then _stp_map_new the bits.
  (_stp_map_del, _stp_pmap_del): Deletion is now simpler to match.
* runtime/map-gen.c: Update callers to new abstractions.
* runtime/map-stat.c: Ditto.
* runtime/pmap-gen.c: Ditto.

11 years agoAdjust output checks for arm stat.c syscall.exp test
William Cohen [Mon, 3 Dec 2012 22:33:03 +0000 (17:33 -0500)]
Adjust output checks for arm stat.c syscall.exp test

The output check for the arm tests needs to be adjusted to match the
syscalls being used on the arm.  Arm has output that looks like the
ia64 process and needs a similar conditional check.

11 years agoCorrect the syscall test alarm.c to properly match for arm.
William Cohen [Mon, 3 Dec 2012 22:16:08 +0000 (17:16 -0500)]
Correct the syscall test alarm.c to properly match for arm.

The output of syscalls is slightly different for arm machines.  This caused
the alarm test to fail.  The conditionals tests for arm allow this test to
properly pass on the arm.

11 years agoPR14900: fix collisions between context tapset locals and user globals
Frank Ch. Eigler [Fri, 30 Nov 2012 20:34:51 +0000 (15:34 -0500)]
PR14900: fix collisions between context tapset locals and user globals

* tapset/linux/*context*.stp: Prefix script locals with __.
* testsuite/semok/context-globals: New test.

11 years agotestsuite: fix buildok/oldlocals02.stp permissions
Frank Ch. Eigler [Fri, 30 Nov 2012 20:02:05 +0000 (15:02 -0500)]
testsuite: fix buildok/oldlocals02.stp permissions

11 years agoPR14804: tolerate !STAPCONF_KALLSYMS without an early _stp_error
Frank Ch. Eigler [Fri, 30 Nov 2012 03:24:32 +0000 (22:24 -0500)]
PR14804: tolerate !STAPCONF_KALLSYMS without an early _stp_error

A _stp_error call from that early in initialization leads to
badness.

* runtime/sym.c (kallsyms_lookup_name): In the !STAPCONF_KALLSYMS
  case, return NULL quietly, not tickling the error dragons.
* runtime/mempool.c (_stp_mempool_alloc): As a belt & suspenders
  kind of thing, if invoked so early that the incoming pool is not
  even initialized yet (= NULL), return NULL instead of crashing.

11 years agoHold System.map failures until both attempts fail
Josh Stone [Wed, 28 Nov 2012 21:59:35 +0000 (13:59 -0800)]
Hold System.map failures until both attempts fail

On RHEL4, System.map only exists in /boot/, so the first attempt under
/lib/modules/ was always spamming about its failure.  Now that error
message is delayed and printed iff /boot/ fails too.

Reported-by: William Cohen <wcohen@redhat.com>
11 years agoMake pthreadprobes.exp test script readable.
David Smith [Tue, 27 Nov 2012 22:27:07 +0000 (16:27 -0600)]
Make pthreadprobes.exp test script readable.

11 years agotracepoints: with -vvv, match kernel tracepoint headers with tracequery kmods
Frank Ch. Eigler [Tue, 27 Nov 2012 20:03:28 +0000 (15:03 -0500)]
tracepoints: with -vvv, match kernel tracepoint headers with tracequery kmods

11 years agokernel tracepoints: locate xfs's under $src/fs/xfs/xfs_trace.h
Frank Ch. Eigler [Tue, 27 Nov 2012 20:03:05 +0000 (15:03 -0500)]
kernel tracepoints: locate xfs's under $src/fs/xfs/xfs_trace.h

11 years agoPR12642: Update comments and remove unused labels.
David Smith [Tue, 27 Nov 2012 16:30:52 +0000 (10:30 -0600)]
PR12642: Update comments and remove unused labels.

* runtime/linux/task_finder2.c (stap_start_task_finder): Clarified comment.
  (stap_task_finder_post_init):  Clarified comment and removed unused label.
* runtime/linux/task_finder.c (stap_task_finder_post_init): Clarified
  comment and removed unused label.

11 years agoPR12642: tweak a comment to clarify behavior without stap -c/-x
Frank Ch. Eigler [Tue, 27 Nov 2012 15:55:54 +0000 (10:55 -0500)]
PR12642: tweak a comment to clarify behavior without stap -c/-x

11 years agoFixed PR12642 by interrupting the target task.
David Smith [Tue, 27 Nov 2012 15:29:02 +0000 (09:29 -0600)]
Fixed PR12642 by interrupting the target task.

* runtime/stp_utrace.c (utrace_init): If 'signal_wake_up' and/or
  '__lock_task_sighand' aren't exported, look up their addresses.
  (utrace_control): Add UTRACE_INTERRUPT functionality, which involves
  setting up a task_work handler, then sending the target a signal.
* runtime/linux/task_finder.c (__stp_utrace_attach_flags): Use the
  caller's specified action instead of hardcoding UTRACE_STOP, to allow
  UTRACE_INTERRUPT to go through.
  (stap_task_finder_post_init): New function.
* runtime/linux/task_finder2.c: Ditto.
* runtime/stp_utrace.h: Added UTRACE_INTERRUPT.
* runtime/utrace_compatibility.h: Ditto.
* runtime/linux/runtime.h: Add kallsyms variables for 'signal_wake_up' and
  '__lock_task_sighand'.
* translate.cxx (c_unparser::emit_module_init): Runs all
  emit_module_post_init() functions.
* task_finder.cxx (task_finder_derived_probe_group::emit_module_post_init):
  Emit call to 'stap_task_finder_post_init()'.
* elaborate.h (struct derived_probe_group): Add virtual function
  'emit_module_post_init' which gets called once session_state is set to
  running.
* buildrun.cxx (compile_pass): Added 'exportconf' tests for
  "signal_wake_up" and "__lock_task_sighand".
* testsuite/systemtap.clone/main_quiesce.exp: New test.
* testsuite/systemtap.clone/main_quiesce.c: New test C source.

11 years agoAlways report System.map failures, not just verbosely
Josh Stone [Mon, 26 Nov 2012 23:38:39 +0000 (15:38 -0800)]
Always report System.map failures, not just verbosely

Since we are treating System.map as mandatory (also debatable), we need
to inform the user about the failure, instead of a silent exit.

Reported-by: Yichun Zhang <agentzh@gmail.com>
11 years agoruntime: More static, fewer exported symbols
Josh Stone [Wed, 21 Nov 2012 21:55:04 +0000 (13:55 -0800)]
runtime: More static, fewer exported symbols

Does it hurt to have unnecessarily exported symbols?  Probably not, but
making them static may give the compiler more chances to optimize.

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