]> sourceware.org Git - systemtap.git/log
systemtap.git
7 years agoImprove relayfs autoconf test for F24.
David Smith [Wed, 14 Dec 2016 16:07:15 +0000 (10:07 -0600)]
Improve relayfs autoconf test for F24.

* runtime/linux/autoconf-relay_buf-per_cpu_ptr.c: Improve test so that it
  properly fails on Fedora 24's 4.8.10-200.fc24.x86_64 kernel.

7 years agoRemoved runtime/linux/autoconf-get_proc_freq.c, which isn't ready yet.
David Smith [Tue, 13 Dec 2016 23:01:12 +0000 (17:01 -0600)]
Removed runtime/linux/autoconf-get_proc_freq.c, which isn't ready yet.

7 years agoFix get_user_pages_remote() autoconf test for 4.8 kernels.
David Smith [Tue, 13 Dec 2016 22:55:36 +0000 (16:55 -0600)]
Fix get_user_pages_remote() autoconf test for 4.8 kernels.

* runtime/linux/autoconf-get_user_pages_remote-flags.c: Since later
  autoconf-style test don't get the results of previous tests, remove
  STAPCONF_GET_USER_PAGES_REMOTE check.

7 years agoPR20889: metadatabase.db location
Cody Santing [Fri, 9 Dec 2016 21:40:10 +0000 (16:40 -0500)]
PR20889: metadatabase.db location

* Makefile.am: Remove DOCDIR. Copy examples to $pkgdatadir rather than $docdir.
* Makefile.in: Updated using autoreconf.
* NEWS: Mention new examples location.
* doc/Makefile.in: Updated using autoreconf.
* doc/beginners/Makefile.in: same
* interactive.cxx: Look for metadatabase.db under PKGDATADIR rather than DOCDIR.
* java/Makefile.in: Updated using autoreconf.
* systemtap.spec: Update location of examples directory.

7 years agoFix BZ1386120 by fixing systemtap bulk-mode output.
David Smith [Fri, 9 Dec 2016 19:50:34 +0000 (13:50 -0600)]
Fix BZ1386120 by fixing systemtap bulk-mode output.

* runtime/transport/relay_v2.c (__stp_relay_wakeup_timer): Fix typo error
  introduced in bulk-mode output.

7 years agoFix BZ1386120 by updating systemtap to handle the 4.9 kernel.
David Smith [Fri, 9 Dec 2016 17:41:35 +0000 (11:41 -0600)]
Fix BZ1386120 by updating systemtap to handle the 4.9 kernel.

* runtime/linux/access_process_vm.h (__access_process_vm_): Use
  STAPCONF_GET_USER_PAGES_REMOTE_FLAGS to handle get_user_pages_remote()
  kernel function API change.
* runtime/transport/procfs.c (_stp_proc_read): Use _stp_get_rchan_subbuf()
  macro to handle kernel relayfs rchan->buf changes.
* runtime/transport/relay_v2.c (__stp_relay_wakeup_timer): Ditto.
  (_stp_data_write_reserve): Ditto.
* runtime/transport/symbols.c (_stp_module_panic_notifier): Ditto.
* buildrun.cxx (compile_pass): Add autoconf-style tests.
* runtime/linux/autoconf-get_user_pages_remote-flags.c: New file.
* runtime/linux/autoconf-relay_buf-per_cpu_ptr.c: New file.
* runtime/transport/relay_compat.h: New file.

7 years agoelaborate.cxx: make "side-effect-free probe" warnings suppressable
Frank Ch. Eigler [Wed, 7 Dec 2016 15:26:46 +0000 (10:26 -0500)]
elaborate.cxx: make "side-effect-free probe" warnings suppressable

The low level probe_XXXX name is not useful anyway.

7 years agoFix the initscript/99stap/check.in syntax.
Martin Cermak [Tue, 6 Dec 2016 13:42:48 +0000 (14:42 +0100)]
Fix the initscript/99stap/check.in syntax.

7 years agoAvoid creating a file called '&1' in testsuite/systemtap.pass1-4/semko.exp.
David Smith [Fri, 2 Dec 2016 17:28:34 +0000 (11:28 -0600)]
Avoid creating a file called '&1' in testsuite/systemtap.pass1-4/semko.exp.

7 years agosocket-events.stp example revamp WIP
Cody Santing [Thu, 1 Dec 2016 19:46:14 +0000 (14:46 -0500)]
socket-events.stp example revamp WIP

* testsuite/systemtap.examples/general/socket-events.stp: Made the output much more compact.  Still has a few things needing to be updated, mainly occasional timing inaccuracies.

7 years agoPR20879 and add variance to -t
Cody Santing [Thu, 1 Dec 2016 17:48:27 +0000 (12:48 -0500)]
PR20879 and add variance to -t

* runtime/linux/common_session_state.h: Add STAT_OP_VARIANCE parameter to stat session initializations.
* runtime/linux/probe_lock.h: Increment contention attempts.
* translate.cxx: Print variance and contention attempts if STP_TIMING.

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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.

8 years agoFix PR200601 by updating __get_skb_iphdr() for newer 32-bit kernels.
David Smith [Mon, 12 Sep 2016 18:05:44 +0000 (13:05 -0500)]
Fix PR200601 by updating __get_skb_iphdr() for newer 32-bit kernels.

* tapset/linux/ip.stp (__get_skb_iphdr): Updated for newer 32-bit
  kernels. Validates the skb structure, then calls the real
  skb_network_header() function.

8 years agoFix PR20589 by updating kernel_buffer_quoted().
David Smith [Mon, 12 Sep 2016 16:47:51 +0000 (11:47 -0500)]
Fix PR20589 by updating kernel_buffer_quoted().

* tapset/linux/conversions.stp (kernel_buffer_quoted): Validate the
  'outlen' parameter, ensuring it is between 0 and MAXSTRINGLEN.
  (kernel_buffer_quoted_error): Ditto.

8 years agocopyright year bump
Frank Ch. Eigler [Fri, 9 Sep 2016 14:20:27 +0000 (10:20 -0400)]
copyright year bump

8 years ago@variance runtime: fix map.c aggregate/calculations
Frank Ch. Eigler [Fri, 9 Sep 2016 14:10:27 +0000 (10:10 -0400)]
@variance runtime: fix map.c aggregate/calculations

gcc's indentation warnings pointed a finger of suspicion at the
new code that merges variance-related partial statistics across
stats structs.  Two blocks are now conditioned on STAT_OP_VARIANCE.

8 years agobump supported kernel version to 4.7
Frank Ch. Eigler [Fri, 9 Sep 2016 13:56:41 +0000 (09:56 -0400)]
bump supported kernel version to 4.7

8 years agoPR20423: tweak error message generation for case without e->components[]
Frank Ch. Eigler [Fri, 9 Sep 2016 13:43:03 +0000 (09:43 -0400)]
PR20423: tweak error message generation for case without e->components[]

... e.g. a case where a C function returns a struct, $return would
trigger the "... is being accessed instead of member" message, but the
operative tok* is the e node, not a member of the empty
e->components[].

8 years agotweak whitespace for gcc warning compliance
Joe Gorse [Thu, 8 Sep 2016 18:28:25 +0000 (14:28 -0400)]
tweak whitespace for gcc warning compliance

8 years agoHandle testsuite 'spawn' calls correctly by calling 'close' and 'wait'.
David Smith [Thu, 8 Sep 2016 16:09:59 +0000 (11:09 -0500)]
Handle testsuite 'spawn' calls correctly by calling 'close' and 'wait'.

* testsuite/systemtap.base/auto_path.exp: Add 'close' and 'wait' calls
  after a 'spawn'.
* testsuite/systemtap.base/const_op.exp: Ditto.
* testsuite/systemtap.base/kallsyms.exp: Ditto.
* testsuite/systemtap.base/timeout.exp: Ditto.
* testsuite/systemtap.context/symbols.exp: Kill spawned stap process and
  call 'close' before calling 'wait'.
* testsuite/systemtap.base/flightrec1.exp: Fix location of close/wait
  calls.
* testsuite/systemtap.base/flightrec2.exp: Ditto.
* testsuite/systemtap.base/flightrec3.exp: Ditto.
* testsuite/systemtap.base/flightrec4.exp: Ditto.
* testsuite/systemtap.base/flightrec5.exp: Ditto.
* testsuite/systemtap.base/crash.exp: Call 'catch' around individual
  'close' and 'wait' calls.
* testsuite/systemtap.maps/foreach_fail.exp: Ditto.
* testsuite/systemtap.base/backtrace.exp: Call 'catch' around 'wait'
  calls.
* testsuite/systemtap.base/cache_clean.exp: Ditto.
* testsuite/lib/systemtap.exp (setup_server): Add 'catch' around 'exec'.
  (stap_run_batch): Call 'close' before calling 'wait'.
* testsuite/lib/stap_compile.exp (stap_compile): Call 'close' before
  calling 'wait'.
* testsuite/systemtap.base/alternatives.exp: Ditto.
* testsuite/systemtap.base/at_var_unresolved.exp: Ditto.
* testsuite/systemtap.base/at_var_unresolved_lvalue.exp: Ditto.
* testsuite/systemtap.base/at_var_void_stmt.exp: Ditto.
* testsuite/systemtap.base/bz10078.exp: Ditto.
* testsuite/systemtap.base/bz1074541.exp: Ditto.
* testsuite/systemtap.base/bz1126645.exp: Ditto.
* testsuite/systemtap.base/bz13338.exp: Ditto.
* testsuite/systemtap.base/cmd_parse.exp: Ditto.
* testsuite/systemtap.base/debugpath.exp: Ditto.
* testsuite/systemtap.base/deref2.exp: Ditto.
* testsuite/systemtap.base/func_alias.exp: Ditto.
* testsuite/systemtap.base/multisym.exp: Ditto.
* testsuite/systemtap.base/pr13158.exp: Ditto.
* testsuite/systemtap.base/pr13306.exp: Ditto.
* testsuite/systemtap.base/pr14546.exp: Ditto.
* testsuite/systemtap.base/prologues.exp: Ditto.
* testsuite/systemtap.base/pthread_stacks.exp: Ditto.
* testsuite/systemtap.base/rep_ret.exp: Ditto.
* testsuite/systemtap.base/wakeup.exp: Ditto.
* testsuite/systemtap.base/warn_overflow.exp: Ditto.
* testsuite/systemtap.base/warnings.exp: Ditto.
* testsuite/systemtap.stress/whitelist.exp: Ditto.
* testsuite/systemtap.apps/tcl.exp: Update 'spawn' comment.

8 years agotweak whitespace and @variance conflicting-bitshift message
Frank Ch. Eigler [Thu, 8 Sep 2016 14:54:26 +0000 (10:54 -0400)]
tweak whitespace and @variance conflicting-bitshift message

Reported-by: jhg_ on IRC.
8 years agoIntroduce new statistics operator @variance().
Martin Cermak [Thu, 8 Sep 2016 12:03:57 +0000 (14:03 +0200)]
Introduce new statistics operator @variance().

New statistics @variance() operator using the Welford's online algorithm
for per-cpu computation, and the Total Variance formula authored by
Niranjan Kamat and Arnab Nandi from the Ohio State University for the
cross-cpu aggregation.

8 years agoAUTHORS refresh
Frank Ch. Eigler [Fri, 2 Sep 2016 14:25:56 +0000 (10:25 -0400)]
AUTHORS refresh

8 years agosystemtap: Blacklist powerpc:hash_fault tracepoint
Hemant Kumar [Fri, 2 Sep 2016 00:57:43 +0000 (06:27 +0530)]
systemtap: Blacklist powerpc:hash_fault tracepoint

Commit c4a048331603a3fe19c886498e957f5f2a577ed9 blacklists hcall_*
kernel tracepoints for powerpc to avoid recursive page faults and
kernel panic due to that. powerpc:hash_fault should be blacklisted
too, since, its placed in the same path of kernel code which is
invoked on a page fault.

Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com>
8 years agotweak error message for exhausted-overloaded-functions
Frank Ch. Eigler [Thu, 1 Sep 2016 21:28:37 +0000 (17:28 -0400)]
tweak error message for exhausted-overloaded-functions

Correct the error message generated for "all functions exhausted" to
focus on the token of the function-call site, rather than whatever
inner statement was last executed before a "next".

8 years agointeractive mode: allow supplied script
Felix Lu [Tue, 30 Aug 2016 15:32:11 +0000 (11:32 -0400)]
interactive mode: allow supplied script

8 years agodwflpp: cache CU entry PCs for pr15123_retry_addr
Josh Stone [Fri, 26 Aug 2016 20:57:08 +0000 (13:57 -0700)]
dwflpp: cache CU entry PCs for pr15123_retry_addr

Previously it was calling getscopes(pc) to see if we're at the start of
the outermost function, which may be a preamble for -mfentry.  But the
scopes are inside-out -- [0] is the innermost -- so inlines were
comparing against their own entry pc, then inappropriately applying the
mfentry workaround.  It also assumes we're already focussed on the CU,
which may not be the case for .callee probes that expand across CUs.
And besides all that, dwarf_getscopes is an expensive traversal.

Instead, we can just keep a cached set of known entry PCs, built from
our existing cache of concrete functions, and check if possible mfentry
PCs are in that set.

8 years agoppc64le: Fix LEP usage for probing
Ravi Bangoria [Tue, 23 Aug 2016 11:24:28 +0000 (06:24 -0500)]
ppc64le: Fix LEP usage for probing

PPC64 ELF ABI v2 has a Global Entry Point and a Local Entry Point for
the functions. Debuginfo of ELF contains GEP which is same as entrypc
while symbol table contains GEP and offset, from which we can calculate
LEP. LEP is used to call function within single CU, when TOC pointer
update is not required. Placing a probe on LEP catches call from both
the GEP and the LEP but, by default, systemtap probes on GEP.

Commit b4c6a4b1cd00 ("Prioritize symbol table lookup for ppc64le") solve
this issue by storing LEP in symbol table and prioritizing symbol table
over debuginfo for ppc64le.

But there are few regression effect of this patch. Couple of examples
are given below.

1. If target program is compiled without optimization and user is
interested in function parameter, systemtap should probe after function
prologue. But above patch forces probe on LEP and which result in garbage
value of function parameter will get recorded.

  $ make verbose=1 installcheck RUNTESTFLAGS='at_var.exp -v --debug'
    ...
    # of expected passes        1
    # of unexpected failures    1

2. Probe on shared library function with parameter is failing at Pass 2.

  $ make verbose=1 installcheck RUNTESTFLAGS='exelib.exp -v --debug'
    ...
    # of expected passes        10
    # of unexpected failures    64

3. When symbol_name with offset is used to register kprobe, kernel itself
will find LEP and adds offset to it. Systemtap using LEP to find offset
is resulting in offset being added two times.
  GEP + lep_offset (by systemtap) + lep_offset (by kernel)

This can be solved by calculating LEP only at a time of adding a probe.
That will make effect of LEP local to that area and won't have any
regression effect.

After applying patch:

  $ make verbose=1 installcheck RUNTESTFLAGS='at_var.exp -v --debug'
    ...
    # of expected passes        2

  $ make verbose=1 installcheck RUNTESTFLAGS='exelib.exp -v --debug'
    ...
    # of expected passes        74

Fixes: Commit b4c6a4b1cd00 ("Prioritize symbol table lookup for ppc64le")
Reported-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[ Reported about issue with shared library ]
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
8 years agoppc64le: Store correct function entry address in symbol_table
Ravi Bangoria [Tue, 23 Aug 2016 11:24:27 +0000 (06:24 -0500)]
ppc64le: Store correct function entry address in symbol_table

PPC64 ELF ABI v2 has a Global Entry Point and a Local Entry Point for
the functions. Debuginfo of ELF contains GEP which is same as entrypc
while symbol table contains GEP and offset, from which we can calculate
LEP. LEP is used to call function within single CU, when TOC pointer
update is not required. Placing a probe on LEP catches call from both
the GEP and the LEP but, by default, systemtap probes on GEP.

For ppc64le, Systemtap stores LEP in symbol table and prioritize symbol
table over debuginfo. But, storing LEP in symbol table has couple of
regression effect. As LEP is only required at a time of adding a probe,
don't store it in symbol table.

No need to prioritize symbol table as well because debuginfo and symbol
table both will contain Global Entry Point.

Revert commit b4c6a4b1cd00 ("Prioritize symbol table lookup for ppc64le")
partially.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
8 years agoAdd 'list-unfinished' target to the top-level Makefile.
David Smith [Wed, 24 Aug 2016 15:55:26 +0000 (10:55 -0500)]
Add 'list-unfinished' target to the top-level Makefile.

* Makefile.am: Add 'list-unfinished' target (that just defers to
  testsuite/Makefile).
* Makefile.in: Regenerated.

8 years agodon't colorize stap -L for non tty
Felix Lu [Wed, 24 Aug 2016 15:25:56 +0000 (11:25 -0400)]
don't colorize stap -L for non tty

8 years agointeractive mode command aliases
Felix Lu [Tue, 23 Aug 2016 20:19:58 +0000 (16:19 -0400)]
interactive mode command aliases

Add more aliases for interactive mode commands.

8 years agoInteractive mode example commands
Cody Santing [Tue, 23 Aug 2016 18:40:28 +0000 (14:40 -0400)]
Interactive mode example commands

After null input while in interactive mode, a list of example commands are printed.

8 years agoUpdate help commnd for interactive mode
Cody Santing [Tue, 23 Aug 2016 16:08:22 +0000 (12:08 -0400)]
Update help commnd for interactive mode

help SUBCOMMAND will now print help description for only that one command.

Passing a command that requires arguments with no arguments will trigger help COMMAND.

8 years agostap.1 man page interactive entry
Felix Lu [Tue, 23 Aug 2016 14:52:21 +0000 (10:52 -0400)]
stap.1 man page interactive entry

8 years agocleanup --help text
Felix Lu [Tue, 23 Aug 2016 14:40:52 +0000 (10:40 -0400)]
cleanup --help text

8 years agomodify interactive mode load behavior
Felix Lu [Tue, 23 Aug 2016 13:49:57 +0000 (09:49 -0400)]
modify interactive mode load behavior

The "load" command no longer appends to the existing script. The user
is prompted if they want to overwrite the existing file if the script is
not empty.

8 years agoAdd testcase for RHBZ1269062.
Martin Cermak [Tue, 23 Aug 2016 08:49:06 +0000 (10:49 +0200)]
Add testcase for RHBZ1269062.

8 years agofix interactive mode empty script saving
Felix Lu [Mon, 22 Aug 2016 19:59:18 +0000 (15:59 -0400)]
fix interactive mode empty script saving

When saving an empty script with the "save" or "edit" command,
a runtime error from join() causes interactive mode to exit.

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