]> sourceware.org Git - systemtap.git/log
systemtap.git
7 years agoImprove python probe listing.
David Smith [Fri, 2 Dec 2016 16:45:45 +0000 (10:45 -0600)]
Improve python probe listing.

* python/stap-resolve-module-function.py (_find_wildcarded_modules): Just
  ignore C builtin modules and C extensions instead of raising errors.
  (resolve_patterns): Don't clear the returned list of matches between
  wildcards.

7 years agoFix listing python probes.
David Smith [Thu, 1 Dec 2016 18:55:25 +0000 (12:55 -0600)]
Fix listing python probes.

* tapset-python.cxx (python_builder::build): Fix listing python probes by
  marking the new location as well formed and using it in all the correct
  places.

7 years agoAdd support for python target variable numeric array indexing.
David Smith [Wed, 30 Nov 2016 16:53:38 +0000 (10:53 -0600)]
Add support for python target variable numeric array indexing.

* tapset-python.cxx (python_var_expanding_visitor::visit_target_symbol):
  Add support for numeric array indexing.
* tapset/python2.stp (Py2Dict_GetItem_FromLong): New function.
  (Py2Object_Repr): Add variant of Py2Object_Repr() that takes a numeric
  index.
  (python2_get_variable): Add variant of python2_get_variable() that takes
  a numeric index.
* tapset/python3.stp (Py3Dict_GetItem_FromLong): New function.
  (Py3Object_Repr): Add variant of Py3Object_Repr() that takes a numeric
  index.
  (python3_get_variable): Add variant of python3_get_variable() that takes
  a numeric index.

7 years agoFixed typo in tapset/python3.stp.
David Smith [Tue, 29 Nov 2016 22:07:31 +0000 (16:07 -0600)]
Fixed typo in tapset/python3.stp.

7 years agoMerge remote-tracking branch 'origin/master' into dsmith/python
David Smith [Tue, 29 Nov 2016 21:29:53 +0000 (15:29 -0600)]
Merge remote-tracking branch 'origin/master' into dsmith/python

7 years agoAdd support for getting simple python target variables in probes.
David Smith [Tue, 29 Nov 2016 21:29:09 +0000 (15:29 -0600)]
Add support for getting simple python target variables in probes.

* tapset-python.cxx (python_var_expanding_visitor::visit_target_symbol):
  Add support for getting simple python target variables.
  (python_builder::build): Add small compile fix for RHEL7 and update
  comments.
* tapset/python2.stp (python2_get_variable): New function.
* tapset/python3.stp (Py3Dict_GetItem): Add support for python 3
  dictionaries.
  (Py3Dict_Repr): Ditto.
  (Py3Object_Repr): Simplify and add support for dictionaries.
  (python3_get_variable): New function.
* session.cxx (systemtap_session::version): Report python2 and python3
  probe support.
* tapset/linux/syscalls.stpm (__pointer): On 32-bit platforms, return a
  32-bit value.

7 years agoAdd small fix to python 3 configure support.
David Smith [Tue, 29 Nov 2016 21:20:31 +0000 (15:20 -0600)]
Add small fix to python 3 configure support.

* configure.ac: If python3 can't be found, default to searching for
  'python3-config' (instead of '-config').
* configure: Regenerated.

7 years agoFix PR20820 by making optim_stats.exp smaller.
Martin Cermak [Tue, 29 Nov 2016 13:33:05 +0000 (14:33 +0100)]
Fix PR20820 by making optim_stats.exp smaller.

Avoid "soft lockups" generated by optim_stats.exp by lowering
its cpu load down.  Avoid division by zero caused by rounding
errors by numerical scaling.  Introduce per-arch tresholds.
Move the testcase description from optim_stats1.stp to
optim_stats.exp.

7 years agoAutoreconf following previous commit b8d6168f1f8d8a303b0d.
Martin Cermak [Wed, 23 Nov 2016 19:06:37 +0000 (20:06 +0100)]
Autoreconf following previous commit b8d6168f1f8d8a303b0d.

7 years agoFix the boot time probing feature for RHEL6 and Fedora19+ systems.
Martin Cermak [Wed, 23 Nov 2016 18:45:10 +0000 (19:45 +0100)]
Fix the boot time probing feature for RHEL6 and Fedora19+ systems.

Before this fix, the boot time probing feature was proved working
on RHEL7.  This patch adds a few little fixes making the feature
work on RHEL6 and Fedora19+ systems.  Changes:

configure.ac: Make the dracut bin dir configurable at the configure
  time.  This is because of Fedora systems that have the dracut binary
  located in /usr/bin rather than /sbin which is the typical location
  for RHEL.  Also mark initscript/99stap/{install,check} as AC config
  files.
initscript/99stap/{install,check}.in: These files are bodies of the
  install() and check() functions defined in module-setup.sh extracted
  into standalone executable shell scripts. The older dracut shipped
  with RHEL6 expects these bits right there.
initscript/99stap/start-staprun.sh: Don't create the pid file at this
  stage.  This script runs very early at the "cmdline" dracut hoo time.
  At this time, RHEL7 systems offer writable /run directory, so that
  the pid file can be stored there, but RHEL6 systems do not have a
  writable place like that.  Rhel6 only has /dev writable at that
  stage, but misusing /dev for the pid file purposes wouldn't be clean.
  So we use a mechanism based on /proc cescribed below instead.
initscript/systemtap.in:  Don't move over any pid files from
  /var/run/systemtap, because we stopped creating pid files at the
  boot time per above.  Instead we use stap -E to add a probe
  advertising the running service in /proc/systemtap.
systemtap.spec:  A few simple changes making the boot time probing
  feature work on RHEL6 and Fedora19 systems.

7 years agoNEWS: mention that .return { $var } should be replaced with @entry($var)
Frank Ch. Eigler [Wed, 23 Nov 2016 18:11:04 +0000 (13:11 -0500)]
NEWS: mention that .return { $var } should be replaced with @entry($var)

7 years agoAdded support for python 2 'long' int objects (from python3.stp).
David Smith [Mon, 21 Nov 2016 18:32:01 +0000 (12:32 -0600)]
Added support for python 2 'long' int objects (from python3.stp).

* tapset/python2.stp (Py2Long_AsLongLongAndOverflow_Small): New function,
  ported over from python3.stp.
  (Py2Long_AsLongLongAndOverflow_Big): Ditto.
  (Py2Long_AsLongLong): Ditto.
  (Py2Dict_GetItem): Add python 'long' support.
  (Py2Object_Repr): Ditto.

7 years agoAdded support for python dictionaries to tapset/python2.stp.
David Smith [Mon, 21 Nov 2016 18:11:10 +0000 (12:11 -0600)]
Added support for python dictionaries to tapset/python2.stp.

* tapset/python2.stp (Py2Dict_GetItem): New function.
  (Py2DictEntry_Repr): Ditto.
  (Py2Dict_Repr): Ditto.
  (Py2Object_Repr): Added dict support and simplified a bit.

7 years agoAdd support for '$$parms', '$$locals', and '$$vars' in python 3 probes.
David Smith [Fri, 18 Nov 2016 18:54:25 +0000 (12:54 -0600)]
Add support for '$$parms', '$$locals', and '$$vars' in python 3 probes.

* tapset/python3.stp: Add support for printing local variables.
* tapset/python2.stp: Corrected warning message.
* tapset-python.cxx (python_var_expanding_visitor::visit_target_symbol):
  Removed debug print.

7 years agoPR20821/PR14924: further gradual deprecation of .return { $var } use
Frank Ch. Eigler [Thu, 17 Nov 2016 16:52:33 +0000 (11:52 -0500)]
PR20821/PR14924: further gradual deprecation of .return { $var } use

* tapsets.cxx (var_expanding_visitor::visit_defined_op): Don't crash
  if something weird is nested beneath @defined(...) that throws a
  semantic error.
  (visit_target_symbol_saved_return): Use save_and_restore<> object
  instead of manual save/restore steps.
  (dwarf_derived_probe ctor): Ditto.
  (visit_entry_op): Ditto.  Also, detect nestedness in @defined()
  to trigger operand expansion attempt.  This is tricky.
* main.cxx (passes_0_4): If -vvv, then pretty-print the script even
  if erroneous, to see aftereffects of optimization, $var expansion
  etc.
* staptree.cxx (vardecl::printsig): Some synthetic globals don't have
  unmangled names, so print their normal name as a fallback.
* elaborate.cxx (visit_perf_op): note that @defined(@perf("junk"))
  returns the literal 1.  (Recently, it merely crashed the translator
  in a .return probe.)
* testsuite/buildok/fortyfour.stp: New test case.

7 years agorpm_finder: colorize "missing kernel-devel" or "-debuginfo" messages
Frank Ch. Eigler [Fri, 18 Nov 2016 16:27:42 +0000 (11:27 -0500)]
rpm_finder: colorize "missing kernel-devel" or "-debuginfo" messages

7 years agoFix PR14924 by warning when not using @entry($var) in a return probe.
Martin Cermak [Fri, 18 Nov 2016 15:12:36 +0000 (16:12 +0100)]
Fix PR14924 by warning when not using @entry($var) in a return probe.

tapsets.cxx: Show warning when a $var gets used in a return probe
    instead of @return($var).  Allow the @defined(@entry()) construct.
tapset/linux/*: Use @entry() in return probes.
testsuite/systemtap.base/at_var.exp: Use -w to suppress the newly added
    warning in tests that basically check that $var == @entry($var) in a
    return probe.

7 years agotranslator pass-3: close auxiliary_outputs[] after we're done with them
Frank Ch. Eigler [Thu, 17 Nov 2016 11:12:59 +0000 (06:12 -0500)]
translator pass-3: close auxiliary_outputs[] after we're done with them

Otherwise we hang onto potentially dozens of unnecessary fds into
pass4.  It is messy that a translator_output doesn't necessarily take
an fstream, and can write to a generic ostream, so we can only close
in the former case.

7 years agoFix typo.
David Smith [Wed, 16 Nov 2016 21:02:25 +0000 (15:02 -0600)]
Fix typo.

7 years agoAdd support for '$$parms', '$$locals', and '$$vars' in python 2 probes.
David Smith [Wed, 16 Nov 2016 20:54:43 +0000 (14:54 -0600)]
Add support for '$$parms', '$$locals', and '$$vars' in python 2 probes.

* tapset-python.cxx (python_var_expanding_visitor): New function.
  (python_builder::build): Use python_var_expanding_visitor to expand
  python variable requests in the probe body.
* tapset/python2.stp (Py2Int_AsLong): New function.
  (Py2Tuple_GetItem): Ditto.
  (Py2Tuple_Repr): Ditto.
  (Py2List_GetItem): Ditto.
  (Py2List_Repr): Ditto.
  (Py2Object_Repr): Ditto.
  (python2_get_typename): Ditto.
  (python2_get_locals): Ditto.

7 years agoUpdate sample command to take multiple keywords
Cody Santing [Wed, 16 Nov 2016 18:40:16 +0000 (13:40 -0500)]
Update sample command to take multiple keywords

* NEWS: Added a small mention of the new sample command.
* interactive.cxx: Sample now accepts FTS full-text index query statements rather than just one keyword.
* testsuite/systemtap.examples/examples-index-gen.pl: Update to now use the new virtual table.
* testsuite/systemtap.examples/metadatabase.db: New virtual table created that uses FTS3.

7 years agotestsuite: fix the `tail systemtap.sum` invocation
Martin Cermak [Mon, 14 Nov 2016 10:23:37 +0000 (11:23 +0100)]
testsuite: fix the `tail systemtap.sum` invocation

7 years agoRename 'python' probes to 'python2' probes.
David Smith [Fri, 11 Nov 2016 20:18:22 +0000 (14:18 -0600)]
Rename 'python' probes to 'python2' probes.

7 years agoAdd support for getting python 2 and python 3 backtraces.
David Smith [Fri, 11 Nov 2016 19:37:59 +0000 (13:37 -0600)]
Add support for getting python 2 and python 3 backtraces.

* tapset-python.cxx
  (python_functioncall_expanding_visitor::visit_functioncall): New function.
  (python_builder::build): Use the new
  python_functioncall_expanding_visitor class to expand/replace python
  backtrace requests in the probe body.
* tapset/python2.stp: New file.
* tapset/python3.stp: New file.

7 years agoNew example script socket-events.stp
Cody Santing [Fri, 11 Nov 2016 16:47:49 +0000 (11:47 -0500)]
New example script socket-events.stp

* general/socket-events.meta: Associated meta file
* general/socket-events.stp: Tracks life cycle and syscall events of all sockets of a specified PID.
* index.html: Automatically updated using perl script to include information on new example.
* index.txt: Same
* keyword-index.html: Same
* keyword-index.txt: Same
* metadatabase.db: Same

7 years agoRemoved debug prints from python/HelperSDT/__init__.py.
David Smith [Fri, 11 Nov 2016 14:47:05 +0000 (08:47 -0600)]
Removed debug prints from python/HelperSDT/__init__.py.

7 years agoFix PR20735 by updating kprobes.c to avoid a soft lockup.
David Smith [Thu, 10 Nov 2016 15:59:16 +0000 (09:59 -0600)]
Fix PR20735 by updating kprobes.c to avoid a soft lockup.

* runtime/linux/kprobes.c: Instead of grabbing the module mutex around
  calling kallsyms_on_each_symbol(), just disable/enable preemption
  instead to avoid a soft lockup.

7 years agonew sample: tcp_retransmission
Bingwu Yang [Tue, 8 Nov 2016 20:08:43 +0000 (15:08 -0500)]
new sample: tcp_retransmission

7 years agoHACKING: discourage posting of patches for machine-generated files
Frank Ch. Eigler [Mon, 7 Nov 2016 14:39:34 +0000 (09:39 -0500)]
HACKING: discourage posting of patches for machine-generated files

7 years agoman stap.1: give example of global% in MAXMAPENTRIES description
Frank Ch. Eigler [Mon, 7 Nov 2016 13:53:04 +0000 (08:53 -0500)]
man stap.1: give example of global% in MAXMAPENTRIES description

7 years agoREADME: mention needing dejagnu for running testsuite
Frank Ch. Eigler [Fri, 4 Nov 2016 13:51:50 +0000 (09:51 -0400)]
README: mention needing dejagnu for running testsuite

8 years agorework unused $n/@n warning
Frank Ch. Eigler [Fri, 4 Nov 2016 03:03:40 +0000 (23:03 -0400)]
rework unused $n/@n warning

Regressions in the testsuite indicated the first approach was not
sufficient.  user_scripts include testsuite-supplied -E fragments,
which of course don't look at $*, and thus aren't appropriate for
end-of-file-parse judgement.

Switch instead to a session-stored used_args[] vector, and include a
special hack to account for tapset/argv.stp, which is the only
tapset-resident user of command line arguments.  (An end-user script
that happens to require the argv.stp tapset should get credit for
using all $* parameters, even if it doesn't mention them literally.)

8 years agoGet python 2 and python 3 probes hooked up to their handlers.
David Smith [Wed, 2 Nov 2016 18:41:04 +0000 (13:41 -0500)]
Get python 2 and python 3 probes hooked up to their handlers.

* tapset-python.cxx (build): Combine a good bit of the python2 vs. python3
  logic. Add code to the synthetic probe to reject probe hits that aren't
  for this actual probe. Link in the user's probe to the synthetic probe.
* python/HelperSDT/_HelperSDT.c (trace_callback): Pass the module name in
  the marker.
  (PyInit__HelperSDT): Fix the init function name for python 3.
* python/HelperSDT/__init__.py: Fix importing the C module for python
  3. Save the module name and pass it to the C extension module.
* python/Makefile.am: Fix python 3 building.
* python/Makefile.in: Regenerated.
* configure.ac: Fix variable names.
* configure: Regenerated.

8 years agoexamples README: elaborate testing
Frank Ch. Eigler [Wed, 2 Nov 2016 13:32:37 +0000 (09:32 -0400)]
examples README: elaborate testing

8 years agoerror::pass2 man page: mention missing debuginfo as likely cause
Frank Ch. Eigler [Mon, 31 Oct 2016 19:11:30 +0000 (15:11 -0400)]
error::pass2 man page: mention missing debuginfo as likely cause

8 years agoparser: warn if script arguments from command line are unused
Frank Ch. Eigler [Fri, 28 Oct 2016 14:32:06 +0000 (10:32 -0400)]
parser: warn if script arguments from command line are unused

8 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Thu, 27 Oct 2016 20:20:52 +0000 (15:20 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

8 years agoFix BZ1377792 by disabling crash on mips.
Michal Toman [Thu, 27 Oct 2016 20:20:27 +0000 (15:20 -0500)]
Fix BZ1377792 by disabling crash on mips.

8 years agoExport a value with every python breakpoint which gets returned.
David Smith [Thu, 27 Oct 2016 18:11:14 +0000 (13:11 -0500)]
Export a value with every python breakpoint which gets returned.

* python/HelperSDT/__init__.py: Expect a 'key' value for every breakpoint and
  return that value when a breakpoint is hit.
* python/HelperSDT/_HelperSDT.c (trace_callback): Expect an index value
  and put that value in the marker.
* tapset-python.cxx (python_derived_probe_group::emit_module_decls):
  Output an index value with each breakpoint.

8 years agoAdd constants to the python C extension module.
David Smith [Thu, 27 Oct 2016 17:56:58 +0000 (12:56 -0500)]
Add constants to the python C extension module.

* python/HelperSDT/_HelperSDT.c (init_HelperSDT): Export PyTrace_*
  constants.
* python/HelperSDT/__init__.py (Dispatcher.pytrace_dispatch): Use
  PyTrace_* constants.

8 years agodeviceseeks.stp example: support regexp matching on devname, make periodic
Frank Ch. Eigler [Wed, 26 Oct 2016 23:54:13 +0000 (19:54 -0400)]
deviceseeks.stp example: support regexp matching on devname, make periodic

8 years agoHandle negative values properly in randint() (from tapset/random.stp).
David Smith [Wed, 26 Oct 2016 18:52:19 +0000 (13:52 -0500)]
Handle negative values properly in randint() (from tapset/random.stp).

8 years agoman warning::debuginfo - mention CFLAGS -g right at the top
Frank Ch. Eigler [Wed, 26 Oct 2016 13:43:28 +0000 (09:43 -0400)]
man warning::debuginfo - mention CFLAGS -g right at the top

8 years agoHandle multiple python probes at the same location.
David Smith [Tue, 25 Oct 2016 17:32:36 +0000 (12:32 -0500)]
Handle multiple python probes at the same location.

* python/HelperSDT/__init__.py (Dispatcher.pytrace_dispatch): Handle
  multiple breakpoints at the same breakpoint location.
  (Dispatcher.do_b): Make sure the line number field is numeric. Clear the
  line number field if we've got a return break.
* tapset-python.cxx (python_builder::build): Add newlines to debug prints.

8 years agoRead the list of python breakpoints from the systemtap module's procfs file.
David Smith [Mon, 24 Oct 2016 20:59:00 +0000 (15:59 -0500)]
Read the list of python breakpoints from the systemtap module's procfs file.

* python/HelperSDT/__init__.py (Dispatcher.__init__): Read the list of
  breakpoint commands from the procfs file exported by systemtap.
  (do_b): New function
* staprun/staprun_funcs.c (insert_module): Export an environment variable
  called 'SYSTEMTAP_MODULE' with the name of the inserted module.
* tapset-python.cxx (python_builder::resolve): Fix syntax.

8 years agoNEWS: mention specialized/sped-up <<< operators
Frank Ch. Eigler [Sat, 22 Oct 2016 23:55:49 +0000 (19:55 -0400)]
NEWS: mention specialized/sped-up <<< operators

8 years agocorrecting last patch with .return probe
Tetsuo Handa [Sat, 22 Oct 2016 23:26:56 +0000 (19:26 -0400)]
correcting last patch with .return probe

https://bugzilla.redhat.com/show_bug.cgi?id=1384344#c32

8 years agoupdate CVE-2016-5195 workaround with -EIO rc for /proc/self/mem write
Tetsuo Handa [Sat, 22 Oct 2016 23:23:22 +0000 (19:23 -0400)]
update CVE-2016-5195 workaround with -EIO rc for /proc/self/mem write

8 years agointeractive mode: don't crash if sample subdialog terminated with EOF
Frank Ch. Eigler [Fri, 21 Oct 2016 23:29:52 +0000 (19:29 -0400)]
interactive mode: don't crash if sample subdialog terminated with EOF

8 years agobumping tested-kernel-version to 4.9-rc1, looking good
Frank Ch. Eigler [Fri, 21 Oct 2016 17:52:14 +0000 (13:52 -0400)]
bumping tested-kernel-version to 4.9-rc1, looking good

8 years agoDifferentiate between python line number probes and function call probes.
David Smith [Fri, 21 Oct 2016 17:51:01 +0000 (12:51 -0500)]
Differentiate between python line number probes and function call probes.

* python/stap-resolve-module-function.py (resolve_patterns): Differentiate
  between line number probes and function call probes.
* tapset-python.cxx (python_builder::resolve): Handle the 'call' flag
  coming back from stap-resolve-module-function.py.
  (python_builder::build): If needed, synthesize a new 'call' component.

8 years agoFix stap-resolve-module-function.py to handle relative paths with wildcards.
David Smith [Fri, 21 Oct 2016 15:50:34 +0000 (10:50 -0500)]
Fix stap-resolve-module-function.py to handle relative paths with wildcards.

* python/stap-resolve-module-function.py (resolve_patterns): Fix searching
  for wildcarded paths by appending the result of glob() onto the list
  (instead of replacing the list with the result of glob()).

8 years agoexamples: add cve-2016-5195 security band-aid
Petr Matousek [Thu, 20 Oct 2016 21:20:24 +0000 (17:20 -0400)]
examples: add cve-2016-5195 security band-aid

8 years agoFix stap-resolve-module-function.py to handle relative paths.
David Smith [Thu, 20 Oct 2016 18:44:56 +0000 (13:44 -0500)]
Fix stap-resolve-module-function.py to handle relative paths.

* python/stap-resolve-module-function.py (_get_default_search_path): New
  function.
  (_find_wildcarded_modules): Use _get_default_search_path() instead of
  sys.path, which doesn't include the current working directory.
  (_find_wildcarded_modules): Ditto.

8 years agoAdd missing pure virtual function definitions to tapset-python.cxx.
David Smith [Thu, 20 Oct 2016 17:49:05 +0000 (12:49 -0500)]
Add missing pure virtual function definitions to tapset-python.cxx.

8 years agoChange python probe generation to derive synthetic procfs probes.
David Smith [Thu, 20 Oct 2016 17:20:15 +0000 (12:20 -0500)]
Change python probe generation to derive synthetic procfs probes.

* tapset-python.cxx (python_builder::build): Derive synthetic procfs
  probes that contain probe information.
  (python_derived_probe_group::emit_module_decls): No longer reuse procfs
  probe buffer machinery.
  (python_derived_probe_group::emit_kernel_module_init):
  Removed unneeded function.
  (python_derived_probe_group::emit_kernel_module_exit): Ditto.
  (python_derived_probe_group::emit_module_init): Ditto.
  (python_derived_probe_group::emit_module_exit): Ditto.
* elaborate.h (derived_probe): Add use_internal_buffer() virtual
  function.
* tapset-procfs.cxx (procfs_derived_probe::use_internal_buffer): New
  function.
  (procfs_derived_probe_group::emit_module_decls): If we're using an
  internal buffer instead of user-generated content, output code
  accordingly.
  (procfs_derived_probe_group::emit_module_init): Ditto.
* tapsets.cxx (all_session_groups): Set up python probes before procfs
  probes.

8 years agoUse the python executable names found by configure when running a script.
David Smith [Wed, 19 Oct 2016 18:44:17 +0000 (13:44 -0500)]
Use the python executable names found by configure when running a script.

* tapset-python.cxx (python_builder::resolve): Use the python executable
  names found by configure when running the stap-resolve-module-function.py
  script.

8 years agoBump kernel version to 4.8 in the 'tested kernel versions' list.
David Smith [Wed, 19 Oct 2016 15:29:53 +0000 (10:29 -0500)]
Bump kernel version to 4.8 in the 'tested kernel versions' list.

8 years agoImprove PR20600 by adding might_sleep() calls in the runtime.
David Smith [Wed, 19 Oct 2016 15:23:53 +0000 (10:23 -0500)]
Improve PR20600 by adding might_sleep() calls in the runtime.

* runtime/linux/runtime_context.h (_stp_runtime_entryfn_get_context): Add
  comment about not re-enabling preemption.
* runtime/linux/kprobes.c: Add a few might_sleep() calls.
* runtime/linux/stp_tracepoint.c: Ditto.
* runtime/linux/uprobes-common.c: Ditto.
* runtime/linux/uprobes-inode.c (stapiu_target_lock): Ditto.
* runtime/transport/control.c (_stp_ctl_write_cmd): Ditto.
* runtime/transport/transport.c: Ditto.
* translate.cxx (emit_module_init): Ditto.
* runtime/time.c (_stp_init_time): Ditto.

8 years agoStart hooking up probes to the markers in the python extension module.
David Smith [Tue, 18 Oct 2016 21:06:46 +0000 (16:06 -0500)]
Start hooking up probes to the markers in the python extension module.

* tapset-python.cxx (python_builder::build): Sythesize uprobe probes to
  attach to the markers in _HelperSDT.so.
* configure.ac: Add PYTHON_BASENAME and PYTHON3_BASENAME to config.h
* Makefile.am: Define PYEXECDIR and PY3EXECDIR.
* Makefile.in: Regenerated.
* config.in: Ditto.
* configure: Ditto.
* python/HelperSDT/_HelperSDT.c (trace_callback): Corrected the markers'
  provider name.
* python/HelperSDT/__init__.py (Dispatcher.pytrace_dispatch): Fixed debug
  print.

8 years agoRework code to add python procfs files that report probe breakpoint details.
David Smith [Thu, 13 Oct 2016 21:19:36 +0000 (16:19 -0500)]
Rework code to add python procfs files that report probe breakpoint details.

* tapset-python.cxx (python_derived_probe_group::emit_kernel_module_init):
  New function.
  (python_derived_probe_group::emit_kernel_module_exit): Ditto.
  (python_derived_probe_group::emit_module_decls): Output procfs probe
  buffer code.
  (python_derived_probe_group::emit_module_init): Emit procfs file init
  code.
  (python_derived_probe_group::emit_module_exit): Emit procfs file exit
  code.
  (python_builder::build): Remove synthetic procfs probes.
* runtime/procfs-probes.c: Add copyright header. Move _stp_procfs_data
  structure definition to procfs-probes.h.
  (_stp_proc_open_file): Only reset the buffer if we've got a read_probe
  function.
  (_stp_proc_read_file): Don't exit if we don't have a read_probe
  function.
* tapset-procfs.cxx (procfs_derived_probe::join_group): Move
  _stp_procfs_data structure definition to procfs-probes.h.
* runtime/procfs-probes.h: New file.
* runtime/python.c: Removed unneeded file.

8 years agoRemove unneeded parameter in _stp_create_procfs() from runtime/procfs.c
David Smith [Wed, 12 Oct 2016 18:14:26 +0000 (13:14 -0500)]
Remove unneeded parameter in _stp_create_procfs() from runtime/procfs.c

* runtime/procfs.c (_stp_create_procfs): Remove unneeded 'num' parameter.
* tapset-procfs.cxx (procfs_derived_probe_group::emit_module_init): Update
  _stp_create_procfs() function call.

8 years agoAdd python procfs files that report probe breakpoint details.
David Smith [Wed, 12 Oct 2016 17:14:00 +0000 (12:14 -0500)]
Add python procfs files that report probe breakpoint details.

* tapset-python.cxx (python_derived_probe_group): Split 'probes' vector
  into 'python2_probes' and 'python3_probes' vectors.
  (python_derived_probe_group::enroll): Ditto.
  (python_derived_probe_group::emit_module_decls): Output probe bread
  definitions.
  (python_builder::build): Derive synthetic procfs probes.
* runtime/python.c: New file.

8 years agomips: add runtime support
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:28 +0000 (10:14 +0200)]
mips: add runtime support

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agomips: add support in tapset
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:27 +0000 (10:14 +0200)]
mips: add support in tapset

This change adds
* return value extraction
* __is_user_regs() method
* basic support for ptrace

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agoCreate debug_frame_hdr in target byte order
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:26 +0000 (10:14 +0200)]
Create debug_frame_hdr in target byte order

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agomips: add basic unwind support
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:25 +0000 (10:14 +0200)]
mips: add basic unwind support

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agomips: tapset: fix mips oddities in syscalls
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:24 +0000 (10:14 +0200)]
mips: tapset: fix mips oddities in syscalls

Some mips syscalls have different prototypes to standard ones and
require special handling

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agotapset: fix build if arch does not define SA_RESTORER
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:23 +0000 (10:14 +0200)]
tapset: fix build if arch does not define SA_RESTORER

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agomips: add a stub for stack unwind
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:22 +0000 (10:14 +0200)]
mips: add a stub for stack unwind

This change adds a stub for processing stack unwind - this does not do
proper stack printing, but is enough to let the generated code compile
and run

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agomips: add tapset register definitions
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:21 +0000 (10:14 +0200)]
mips: add tapset register definitions

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agomips: tapsets.cxx: add dwarf register definitions for SDT uprobes
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:20 +0000 (10:14 +0200)]
mips: tapsets.cxx: add dwarf register definitions for SDT uprobes

Depending on the optimisations used, the compiler may generate either
numeric register definitions or typical aliases, so define both.
Since MIPS register names start with a dollar '$', add an escape
sequence to the register names when creating regname regular
expressions.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agomips: add TIF_32BIT definition
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:19 +0000 (10:14 +0200)]
mips: add TIF_32BIT definition

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agotestsuite: add support for mips64 build flags
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:18 +0000 (10:14 +0200)]
testsuite: add support for mips64 build flags

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agotapset syscall-number database: add MIPS syscalls
Marcin Nowakowski [Tue, 11 Oct 2016 08:14:17 +0000 (10:14 +0200)]
tapset syscall-number database: add MIPS syscalls

This patch provides MIPS-specific syscall tables and extends
scripts/dump-syscall.sh to handle MIPS tables generation.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
8 years agoAdd python 3 support to python/HelperSDT.
David Smith [Mon, 10 Oct 2016 18:16:40 +0000 (13:16 -0500)]
Add python 3 support to python/HelperSDT.

* python/HelperSDT/_HelperSDT.c: Add python 3 support.
* python/Makefile.am: Add python 3 support.
* python/Makefile.in: Regenerated.
* aclocal.m4: Ditto.
* configure: Ditto.

8 years agoMerge remote-tracking branch 'origin/master' into dsmith/python
David Smith [Mon, 10 Oct 2016 16:33:31 +0000 (11:33 -0500)]
Merge remote-tracking branch 'origin/master' into dsmith/python

8 years agoAdd initial version of the python helper module.
David Smith [Mon, 10 Oct 2016 16:27:33 +0000 (11:27 -0500)]
Add initial version of the python helper module.

* python/Makefile.am: Builds and installs python2 HelperSDT package.
* python/Makefile.in: Regenerated.
* python/setup.py: New file.
* HelperSDT/README.txt: Ditto.
* HelperSDT/_HelperSDT.c: Ditto.
* HelperSDT/__init__.py: Ditto.
* HelperSDT/__main__.py: Ditto.

8 years agoAdded comment about the source of some of the python2/python3 configure code.
David Smith [Mon, 10 Oct 2016 14:45:41 +0000 (09:45 -0500)]
Added comment about the source of some of the python2/python3 configure code.

* configure.ac: Added comment about where some of the ideas for the
  python2/python3 discovery code came from.
* configure: Regenerated.

8 years agoFixed 1382422 by making stap refer to 'dnf' or 'yum'.
David Smith [Thu, 6 Oct 2016 16:29:26 +0000 (11:29 -0500)]
Fixed 1382422 by making stap refer to 'dnf' or 'yum'.

* rpm_finder.cxx (missing_rpm_list_print): Ask the user to use the correct
  package manager for his system, either 'dnf' or 'yum'.

8 years agoIntroduce runtime optimizations for statistical computations per PR10234.
Martin Cermak [Wed, 5 Oct 2016 06:59:42 +0000 (08:59 +0200)]
Introduce runtime optimizations for statistical computations per PR10234.

This update improves the performance of systemtap runtime statistical
computations by optimizing out unneeded parts of the __stp_stat_add()
function.  It is based on parametrizing and inlining it.  The stap
translator now generates _stp_stat_add(), or _stp_pmap_add_*() calls
that have additional "optimization" parameters respective to stats
in use for given global.  GCC uses this for optimizing the inlined
__stp_stat_add() calls.

The optimization effect significantly depends on compiler version,
platform architecture, and the stat operators being used for given
global.  At the moment, the available stat operators are @count,
@sum, @min, @max, @avg, and @variance. The most computionally
expensive is @variance.  The effect of optimizing @variance is
significant.  Other stat operators are computionally chap and so
the effect of their optimizations is relatively low.

Using gcc-6.2.1-1.fc26.x86_64, the @count, @sum, @min, and @max
optimizations brings approximately 8% run time shrinkage. The
@variance optimization shrinkage is up to 70% using this compiler.
For other architectures, namely for power, the optimization is less
effective.

runtime/map-gen.c: Pass the additional optimization parameters through
the map API generator macros.
runtime/map.c: Modify _new_map_set_stat() to accept optimization
        additional parameters.
runtime/map.h: Ditto.
runtime/pmap-gen.c: Pass the additional optimization parameters to
__stp_map_set*() and to _stp_pmap_add*().
runtime/stat-common.c: Add optimization params to __stp_stat_add().
runtime/stat.c: Add optimization params to _stp_stat_add().
tapsets.cxx: Generate parametrized calls to the runtime.
translate.cxx: Ditto.
testsuite/systemtap.base/optim_stats*: New testcase.

8 years agoconfigury: regen configure
Frank Ch. Eigler [Tue, 4 Oct 2016 20:27:36 +0000 (16:27 -0400)]
configury: regen configure

8 years agoDon't use obsolete autoconf macro AC_PROG_CC_STDC
Ross Burton [Tue, 4 Oct 2016 16:12:26 +0000 (17:12 +0100)]
Don't use obsolete autoconf macro AC_PROG_CC_STDC

This has been obsolete since automake 1.8 as it's now part of AC_PROG_CC.

8 years agoAdd "sample" command to interactive mode
Cody Santing [Wed, 28 Sep 2016 16:29:53 +0000 (12:29 -0400)]
Add "sample" command to interactive mode

* Makefile.am: Updated using autoreconf in order to make DOCDIR available for interactive.cxx.
* Makefile.in: same
* doc/beginners/Makefile.in: same
* interactive.cxx: Added sample command, uses sqlite3.h.
* java/Makefile.in:: Updated using autoreconf in order to make DOCDIR available.
* testsuite/systemtap.examples/README: Added a small note about needing perl DBI to rerun perl script.
* testsuite/systemtap.examples/examples-index-gen.pl: As documentation files are generated, SQLite table is now populated with meta data.
* testsuite/systemtap.examples/index.html: Automatically updated documentation for new example after running perl script.
* testsuite/systemtap.examples/index.txt: same
* testsuite/systemtap.examples/keywords-index.html: same
* testsuite/systemtap.examples/keywords-index.txt: same
* testsuite/systemtap.examples/metadatabase.db: New database file that stores meta table.

8 years agoman stap: note that need for --poison-cache option is likely a bug
Frank Ch. Eigler [Fri, 16 Sep 2016 13:36:03 +0000 (09:36 -0400)]
man stap: note that need for --poison-cache option is likely a bug

8 years agoFix rhbz1378462 by updating the path to stap-gen-cert in stap-server.
Martin Cermak [Thu, 22 Sep 2016 13:10:29 +0000 (15:10 +0200)]
Fix rhbz1378462 by updating the path to stap-gen-cert in stap-server.

8 years agoAnother PR20589 fix by updating user_buffer_quoted[_error]().
David Smith [Mon, 19 Sep 2016 19:58:46 +0000 (14:58 -0500)]
Another PR20589 fix by updating user_buffer_quoted[_error]().

* tapset/uconversions.stp (user_buffer_quoted): Validate the
  'outlen' parameter, ensuring it is between 0 and MAXSTRINGLEN.
  (user_buffer_quoted_error): Ditto.
* tapset/linux/conversions.stp (kernel_buffer_quoted): Fix use of outlen.
* testsuite/buildok/conversions.stp: Move uconversion tests to
  uconversions.stp and update list of functions tested.
* testsuite/buildok/uconversions.stp: New file.

8 years agoRenamed/added '--with-python2-probes' and '--with-python3-probes' options.
David Smith [Fri, 16 Sep 2016 18:54:23 +0000 (13:54 -0500)]
Renamed/added '--with-python2-probes' and '--with-python3-probes' options.

* configure.ac: Rename the '--with-python2' option to
  '--with-python2-probes'. Added the '--with-python3-probes' option. Uses
  the 'python-config' and 'python3-config' programs to find the
  corresponding Python.h header file.
* tapset-python.cxx (register_tapset_python): Renamed 'HAVE_PYTHON[23]' to
  'HAVE_PYTHON[23]_PROBES'.
* python/Makefile.am: Added HAVE_PYTHON_PROBES check.
* Makefile.in: Regenerated.
* config.in: Ditto.
* configure: Ditto.
* doc/Makefile.in: Ditto.
* doc/SystemTap_Tapset_Reference/Makefile.in: Ditto.
* doc/beginners/Makefile.in: Ditto.
* java/Makefile.in: Ditto.
* man/Makefile.in: Ditto.
* man/cs/Makefile.in: Ditto.
* python/Makefile.in: Ditto.
* stapdyn/Makefile.in: Ditto.
* staprun/Makefile.in: Ditto.

8 years agoLet the @variance pretty printer show the bit_shift if specified.
Martin Cermak [Fri, 16 Sep 2016 13:40:49 +0000 (15:40 +0200)]
Let the @variance pretty printer show the bit_shift if specified.

Without this update, namely the cache doesn't behave correctly,
not able to distinguish between @variance() calls with different
bit-shifts.

8 years agoAdded autoconf logic to search for python version 2 and 3.
David Smith [Thu, 15 Sep 2016 21:28:47 +0000 (16:28 -0500)]
Added autoconf logic to search for python version 2 and 3.

* configure.ac: Add code to search for python version 2 and 3. Change the
  '--with-python3' option to check and make sure python version 3 is
  installed on the system.
* dtrace.in: Updated method to select preferred version of python.
* Makefile.in: Regenerated.
* configure: Ditto
* doc/Makefile.in: Ditto
* doc/SystemTap_Tapset_Reference/Makefile.in: Ditto
* doc/beginners/Makefile.in: Ditto
* java/Makefile.in: Ditto
* man/Makefile.in: Ditto
* man/cs/Makefile.in: Ditto
* python/Makefile.in: Ditto
* stapdyn/Makefile.in: Ditto
* staprun/Makefile.in: Ditto

8 years agoman stap.1: update @variance text
Frank Ch. Eigler [Wed, 14 Sep 2016 21:00:05 +0000 (17:00 -0400)]
man stap.1: update @variance text

Explain a little bit more about the bitshift and normalization.

8 years agoUpdate @variance testcases after fixing PR20599.
Martin Cermak [Wed, 14 Sep 2016 10:40:56 +0000 (12:40 +0200)]
Update @variance testcases after fixing PR20599.

This update fixes the reference values for @variance where PR20599
(histogram breaks @variance) manifested.

For linear_large.exp and linear_large_neg.exp, remove @variance
tests because of arithmetic overflow.

linear.exp: Update the @variance reference value.
linear_nearlyempty.exp: Ditto.
linear_over.exp: Ditto.
linear_overunder.exp: Ditto.
linear_under.exp: Ditto.
linear_large.exp: Remove the @variance subtest.
linear_large.stp: Ditto.
linear_large_neg.exp: Ditto.
linear_large_neg.stp: Ditto

8 years agoDocument @variance in the stap.1 man page.
Martin Cermak [Wed, 14 Sep 2016 10:40:21 +0000 (12:40 +0200)]
Document @variance in the stap.1 man page.

8 years agoAdd a range check for the bit-shift of the @variance operator.
Martin Cermak [Wed, 14 Sep 2016 10:36:33 +0000 (12:36 +0200)]
Add a range check for the bit-shift of the @variance operator.

8 years agobump bundled unwind table size limit to 32M
Frank Ch. Eigler [Wed, 14 Sep 2016 10:45:49 +0000 (06:45 -0400)]
bump bundled unwind table size limit to 32M

It was reported that one version of oracle db has unwind tables in
excess of 24MB in size, and the prior stap limit of 16MB precludes
backtracing through it.

8 years agoRename the '--with-python' configure option to '--with-python2'.
David Smith [Tue, 13 Sep 2016 19:30:00 +0000 (14:30 -0500)]
Rename the '--with-python' configure option to '--with-python2'.

* configure.ac: Rename the '--with-python' configure option to
  '--with-python2' (and all the associated variables).
* tapset-python.cxx (register_tapset_python): Handle renamed 'HAVE_PYTHON'
  to 'HAVE_PYTHON2' defined. Split python probe support into
  'HAVE_PYTHON2' and 'HAVE_PYTHON3' sections.
* config.in: Ditto.
* configure: Ditto.

8 years agoAdded a new '--with-python' configure option.
David Smith [Tue, 13 Sep 2016 19:02:19 +0000 (14:02 -0500)]
Added a new '--with-python' configure option.

* configure.ac: Add a new configure option, '--with-python' to enable
  python probe support.
* tapset-python.cxx (register_tapset_python): Only register python probes
  if HAVE_PYTHON is defined.
* Makefile.in: Regenerated.
* aclocal.m4: Ditto.
* config.in: Ditto.
* configure: Ditto.
* doc/Makefile.in: Ditto.
* doc/SystemTap_Tapset_Reference/Makefile.in: Ditto.
* doc/beginners/Makefile.in: Ditto.
* java/Makefile.in: Ditto.
* man/Makefile.in: Ditto.
* man/cs/Makefile.in: Ditto.
* python/Makefile.in: Ditto.
* stapdyn/Makefile.in: Ditto.
* staprun/Makefile.in: Ditto.

8 years agoFix PR20599 by only updating needed members of statistic_decl.
Martin Cermak [Tue, 13 Sep 2016 08:56:14 +0000 (10:56 +0200)]
Fix PR20599 by only updating needed members of statistic_decl.

After introducing @variance in commit 63ead7fa, stat_ops and
bit_shift need to be tracked within the statistic_decl.  Before
this update, new histogram always rewrote these new members,
which was causing the problem described in PR20599.

elaborate.cxx: Only rewrite type, linear_low, linear_high, and
         linear_step, when binding new histogram with a global.

8 years agoFix PR20597 and move @avg() calculations out of runtime.
Martin Cermak [Tue, 13 Sep 2016 08:33:09 +0000 (10:33 +0200)]
Fix PR20597 and move @avg() calculations out of runtime.

Revert those parts of commit 63ead7f, that introduce new "avg"
member of the struct stat_data and move computations of @avg()
from the code directly emitted by the translator to the runtime.

The goal of this update is both to fix PR20597, and to speed up
the runtime.  Note that @variance() calculations are based on the
avg too, but the variance vehicle carries its own avg_s, which is
an average scaled by certain bit_shift for numerical precision
improvement purpose.  Variance calculations are optimized out if
unneeded.

So after this change, @avg computations should be as fast as they
were before @variance has been introduced in commit 63ead7f.

elaborate.cxx: Calculate @avg based on sum and count.
translate.cxx: Ditto.
runtime/map.c: Ditto, plus remove the online @avg calculations.
runtime/stat.c: Remove online @avg calculations.
runtime/stat.h: Drop the 'avg' member from the struct stat_data.

8 years agoRevert last change to flightrec*.exp testcases and add comments.
David Smith [Mon, 12 Sep 2016 20:53:46 +0000 (15:53 -0500)]
Revert last change to flightrec*.exp testcases and add comments.

* testsuite/systemtap.base/flightrec1.exp: Revert last commit and add
  comments explaining what is going on. We expect the original 'stap'
  command to finish and leave stapio running in the background.
* testsuite/systemtap.base/flightrec2.exp: Ditto.
* testsuite/systemtap.base/flightrec3.exp: Ditto.
* testsuite/systemtap.base/flightrec4.exp: Ditto.
* testsuite/systemtap.base/flightrec5.exp: Ditto.

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