]> sourceware.org Git - systemtap.git/log
systemtap.git
9 years agoPR11528: pass function args as char * where possible
Abegail Jakop [Tue, 23 Sep 2014 14:28:27 +0000 (10:28 -0400)]
PR11528: pass function args as char * where possible

elaborate.cxx: store the function arguements that are not modified
within the function body
translate.cxx: change the type of unmodified, string function args
to char * and treat them as such when emitting functioncalls

9 years agoPR17395: Add breaks to is_valid_pid error switch
Josh Stone [Mon, 15 Sep 2014 19:35:22 +0000 (12:35 -0700)]
PR17395: Add breaks to is_valid_pid error switch

9 years agostapdyn: use process_vm_readv/writev when possible
Josh Stone [Fri, 12 Sep 2014 22:51:10 +0000 (15:51 -0700)]
stapdyn: use process_vm_readv/writev when possible

For script deref uses, we were using pread/pwrite on /proc/self/mem.
But thanks to CVE-2012-0056, some kernels have completely disabled
mem_write, so stapdyn guru scripts can't write memory at all.  Our
testsuite failed on at_var_lvalue.exp and deref.exp in this case.

When the process_vm_readv/writev syscalls are available, we can
accomplish the same thing, and don't even need an open fd for it.

9 years agostap.1: document --save-uprobes
Jonathan Lebon [Fri, 12 Sep 2014 20:58:09 +0000 (16:58 -0400)]
stap.1: document --save-uprobes

9 years agoinitscript: also delete uprobes.ko during cleanup
Jonathan Lebon [Fri, 12 Sep 2014 20:53:42 +0000 (16:53 -0400)]
initscript: also delete uprobes.ko during cleanup

If after cleanup we've removed all the scripts that require uprobes.ko,
then we should also delete uprobes.ko itself. It will be copied back in
the cache directory the next time a uprobes.ko dependent script is
compiled.

9 years agoinitscript: automatically detect uprobes dependency
Stefan Hajnoczi [Tue, 9 Sep 2014 15:23:46 +0000 (16:23 +0100)]
initscript: automatically detect uprobes dependency

systemtap-initscript scripts that rely on uprobes must be configured
with the --save-uprobes option.  This option saves the generated
uprobes.ko module and loads it when running the script.

The uprobes dependency information is actually available at compile time
so we can autodetect as follows:
1. Check if uprobes.ko was generated during compile
2. When uprobes.ko was generated, touch <name>.uprobes in the cache
   directory.
3. Add the staprun -u option if <name>.uprobes exists

It is no longer necessary to specify the --save-uprobes option in the
initscript configuration file, although doing so allowed.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9 years agoPR16716 partial fix: Fix types in 'syscall.{mlock,mlockall,msync,munmap}'.
David Smith [Fri, 12 Sep 2014 21:36:47 +0000 (16:36 -0500)]
PR16716 partial fix: Fix types in 'syscall.{mlock,mlockall,msync,munmap}'.

* tapset/linux/syscalls.stp (syscall.mlock): Fix types.
  (syscall.mlockall): Ditto.
  (syscall.msync): Ditto.
  (syscall.munmap): Ditto.
* tapset/linux/nd_syscalls.stp (nd_syscall.mlock): Fix types.
  (nd_syscall.msync): Ditto.
  (nd_syscall.munmap): Ditto.
* tapset/linux/aux_syscalls.stp: Updated and improved _msync_flag_str()
  and _mlockall_flags_str().
* testsuite/systemtap.syscall/mmap.c: Added tests.

9 years agoPR17190: accept functions given with their decl_line
Jonathan Lebon [Fri, 12 Sep 2014 18:06:08 +0000 (14:06 -0400)]
PR17190: accept functions given with their decl_line

If the user gives a probe for a specific function, e.g.

kernel.function("vfs_read@fs/read_write.c:393")

where the vfs_read() function is declared at lineno 393, we don't
actually want to probe lineno 393 (most likely there's nothing there
anyway). We simply need to probe the function's entry point.

9 years agolisting_mode.exp: test nearest
Jonathan Lebon [Mon, 8 Sep 2014 21:50:36 +0000 (17:50 -0400)]
listing_mode.exp: test nearest

Purposely use wrong linenos and check that the resulting line listing is
the same as what the user entered both for ABSOLUTE and RELATIVE linenos.

9 years agonearest probes: preserve user-entered lineno in chain
Jonathan Lebon [Mon, 8 Sep 2014 21:17:59 +0000 (17:17 -0400)]
nearest probes: preserve user-entered lineno in chain

This patch adds an earlier well-formed probe point in the derivation
chain of .nearest probes so that the original lineno entered is
retained during stap -l.

Before:

$ stap -l 'kernel.statement("vfs_read@fs/read_write.c:396").nearest'
kernel.statement("vfs_read@fs/read_write.c:397").nearest

Now:

$ stap -l 'kernel.statement("vfs_read@fs/read_write.c:396").nearest'
kernel.statement("vfs_read@fs/read_write.c:396").nearest

9 years agodwflpp.cxx: refactor nearest code
Jonathan Lebon [Tue, 2 Sep 2014 17:22:19 +0000 (13:22 -0400)]
dwflpp.cxx: refactor nearest code

Some code refactoring to eliminate a bit of duplication and make control
flow more linear.

9 years agonearest probes: restrict to ABSOLUTE and RELATIVE
Jonathan Lebon [Tue, 2 Sep 2014 16:00:42 +0000 (12:00 -0400)]
nearest probes: restrict to ABSOLUTE and RELATIVE

9 years agoPR16716 partial fix: Fix types/nesting in 'syscall.{setfs[gu]id,set[gu]id}'.
David Smith [Fri, 12 Sep 2014 16:53:05 +0000 (11:53 -0500)]
PR16716 partial fix: Fix types/nesting in 'syscall.{setfs[gu]id,set[gu]id}'.

* tapset/linux/syscalls2.stp (syscall.setfsgid): Fix gid/uid type.
  (syscall.setfsuid): Ditto.
  (syscall.setgid): Ditto.
  (syscall.setuid): Ditto.
* tapset/linux/nd_syscalls2.stp (nd_syscall.setfsgid): Fix gid/uid type.
  (nd_syscall.setfsuid): Ditto.
  (nd_syscall.setgid): Ditto.
  (nd_syscall.setuid): Ditto.
* testsuite/systemtap.syscall/uid.c: Corrected/added more tests.

9 years agopfaults: index call/return arrays by tid, not pid
Josh Stone [Fri, 12 Sep 2014 00:37:34 +0000 (17:37 -0700)]
pfaults: index call/return arrays by tid, not pid

9 years agoPR16716 partial fix: Fix types/nesting in 'syscall.{sigprocmask,tgkill}'.
David Smith [Thu, 11 Sep 2014 20:25:57 +0000 (15:25 -0500)]
PR16716 partial fix: Fix types/nesting in 'syscall.{sigprocmask,tgkill}'.

* tapset/linux/syscalls2.stp (syscall.sigprocmask): Fix nesting.
  (syscall.tgkill): Fix types.
* tapset/linux/nd_syscalls2.stp (nd_syscall.sigprocmask): Fix nesting.
* runtime/linux/compat_unistd.h: Add fake __NR_sigprocmask.
* testsuite/systemtap.syscall/signal.c: Add more tests.
* testsuite/systemtap.syscall/uid.c: Ditto.

9 years agoserver.exp: fix condition affecting avahi related subtests
Martin Cermak [Wed, 10 Sep 2014 18:21:16 +0000 (20:21 +0200)]
server.exp: fix condition affecting avahi related subtests

On systemd based systems, /usr/sbin/service calls /bin/systemctl.
Unlike rhel6's /sbin/service, systemctl logs to stderr even in case
of successful service restart. Tcl's exec(), called from the as_root(),
is by default sensitive to stderr, and produced false failure.

Additionally the condition logic was inverted.

9 years agoFix compile problem (new in 2.6) in nd_syscall.clock_nanosleep.
David Smith [Wed, 10 Sep 2014 15:07:12 +0000 (10:07 -0500)]
Fix compile problem (new in 2.6) in nd_syscall.clock_nanosleep.

* tapset/linux/nd_syscalls.stp (nd_syscall.clock_nanosleep): Fix compile
  problem by using 'flags_str' instead of 'flag_str'.

9 years agoAdd -fpic -fPIC to the list of accepted but ignored dtrace options.
Stan Cox [Tue, 9 Sep 2014 19:07:44 +0000 (15:07 -0400)]
Add -fpic -fPIC to the list of accepted but ignored dtrace options.

* dtrace.in (main):  Add ignore_options.

9 years agoIgnore symtab descriptors and undefined symbols
Josh Stone [Tue, 9 Sep 2014 18:54:47 +0000 (11:54 -0700)]
Ignore symtab descriptors and undefined symbols

These were already ignored for direct matches (commit 2867a2a13d186),
but we should also skip them in the wildcard-matching loop.

Noted in PR17360 by the a.out+0 warning for "__libc_start_main".

9 years agobump versions to 2.7 and autoreconf
Josh Stone [Fri, 5 Sep 2014 22:03:46 +0000 (15:03 -0700)]
bump versions to 2.7 and autoreconf

9 years agoAdd a 2.6 %changelog to the spec release-2.6
Josh Stone [Fri, 5 Sep 2014 21:33:21 +0000 (14:33 -0700)]
Add a 2.6 %changelog to the spec

9 years agoDate release 2.6 in NEWS
Josh Stone [Fri, 5 Sep 2014 21:05:47 +0000 (14:05 -0700)]
Date release 2.6 in NEWS

9 years agoupdate-po
Josh Stone [Fri, 5 Sep 2014 18:45:00 +0000 (11:45 -0700)]
update-po

9 years agostap: allow command line arguments in listing mode
Josh Stone [Thu, 4 Sep 2014 23:25:39 +0000 (16:25 -0700)]
stap: allow command line arguments in listing mode

9 years agotestsuite: When testing .nearest listing, be sure to say it
Josh Stone [Thu, 4 Sep 2014 22:58:41 +0000 (15:58 -0700)]
testsuite: When testing .nearest listing, be sure to say it

9 years agostapdyn: publicize the -V (version) option in the usage text
Frank Ch. Eigler [Fri, 5 Sep 2014 14:07:58 +0000 (10:07 -0400)]
stapdyn: publicize the -V (version) option in the usage text

9 years agoexamples: regen indexes
Frank Ch. Eigler [Thu, 4 Sep 2014 18:32:40 +0000 (14:32 -0400)]
examples: regen indexes

9 years agoAUTHORS bump
Josh Stone [Thu, 4 Sep 2014 16:31:22 +0000 (09:31 -0700)]
AUTHORS bump

9 years agoRemove systemtap_session::built_uprobes
Josh Stone [Wed, 3 Sep 2014 23:37:06 +0000 (16:37 -0700)]
Remove systemtap_session::built_uprobes

For the purpose of save_uprobes, it doesn't actually matter whether
uprobes.ko was just built or was pulled from the cache.  If we have the
uprobes_path at all, go ahead and save it.

9 years agoinitscript: use --save-uprobes instead of -u
Jonathan Lebon [Wed, 3 Sep 2014 21:45:33 +0000 (17:45 -0400)]
initscript: use --save-uprobes instead of -u

Rather than masking the -u option of stap (unoptimized mode), use the
actual option which we use with stap (--save-uprobes). This will allow
us to remain backwards-compatible if we later on automate the uprobes
saving by always turning on --save-uprobes.

So now, users have to do the following if they require userspace
probing:

  # cat /etc/systemtap/conf.d/example.conf
  example_OPT=--save-uprobes

9 years agoinitscript: allow scripts to load uprobes
Stefan Hajnoczi [Wed, 3 Sep 2014 21:40:52 +0000 (17:40 -0400)]
initscript: allow scripts to load uprobes

Scripts that rely on userspace probing must include the -u option in
their conf file:

  # cat /etc/systemtap/conf.d/example.conf
    example_OPT=-u

The uprobe kernel module will be loaded when the script runs.

9 years agoinitscript: copy uprobes.ko to cache directory
Stefan Hajnoczi [Wed, 3 Sep 2014 21:40:11 +0000 (17:40 -0400)]
initscript: copy uprobes.ko to cache directory

If the uprobes.ko module was built then it will be needed at staprun
time.  Copy the module into the cache directory alongside compiled
scripts.

9 years agostap: add --save-uprobes
Stefan Hajnoczi [Wed, 3 Sep 2014 21:38:30 +0000 (17:38 -0400)]
stap: add --save-uprobes

The stap -m <name> option saves the script module.  For scripts that
rely on uprobes it may also be necessary to get the uprobes module (if
it was built by stap).

The new stap --save-uprobes option saves uprobes/uprobes.ko into the
current directory.

9 years agofix issues related to -E scripts
Jonathan Lebon [Wed, 3 Sep 2014 16:52:34 +0000 (12:52 -0400)]
fix issues related to -E scripts

Fix stap exiting successfully in listing mode even when no probes were
found in the primary script. E.g. the following should return nonzero:

stap -l junk -E 'probe timer.s(1) { next }'

Similarly, fix stap running with no issues even when no probes are
present in the primary script. E.g. the following should error out:

stap -e 'global x' -E 'probe timer.s(1) { next }'

9 years agoenospc.stp: rename warn() function to avoid conflict
Jonathan Lebon [Wed, 3 Sep 2014 18:39:05 +0000 (14:39 -0400)]
enospc.stp: rename warn() function to avoid conflict

Otherwise, we get a conflict with the warn() located in logging.stp.

9 years agolisting_mode_sanity.exp: clarify FAIL messages
Jonathan Lebon [Wed, 3 Sep 2014 16:52:18 +0000 (12:52 -0400)]
listing_mode_sanity.exp: clarify FAIL messages

Use different FAIL messages to know which one failed.

9 years agoupdate AUTHORS list
Jonathan Lebon [Tue, 2 Sep 2014 21:51:09 +0000 (17:51 -0400)]
update AUTHORS list

9 years agoclient_args.exp: avoid propagating PR17301
Martin Cermak [Wed, 3 Sep 2014 12:48:59 +0000 (14:48 +0200)]
client_args.exp: avoid propagating PR17301

9 years agoPR12333: testsuite hashbang "#!stap" -> "#! stap" fix
Frank Ch. Eigler [Wed, 3 Sep 2014 07:22:58 +0000 (03:22 -0400)]
PR12333: testsuite hashbang "#!stap" -> "#! stap" fix

The former confuses the test driver dejagnu code.

9 years agoAdd a NEWS blurb about the autocast type propagation
Josh Stone [Tue, 2 Sep 2014 23:27:45 +0000 (16:27 -0700)]
Add a NEWS blurb about the autocast type propagation

9 years agoUse is_valid_pid in more places
Josh Stone [Tue, 2 Sep 2014 22:06:04 +0000 (15:06 -0700)]
Use is_valid_pid in more places

Several places were duplicating the "kill(pid,0); switch(errno)...", and
can all be replaced by is_valid_pid calls.

9 years agoPR16603 followup: unbreak on rhel4
Frank Ch. Eigler [Tue, 2 Sep 2014 22:29:11 +0000 (18:29 -0400)]
PR16603 followup: unbreak on rhel4

jistone noted that the smp_call_function_single() function call
introduced in commit 590a9ae1acc47 didn't exist on 2.6.9-era kernels.
We de-optimize to plain smp_call_function() on such dinosaurs.

9 years agostap-report: generate fewer incidental errors on unusual platforms
Frank Ch. Eigler [Tue, 2 Sep 2014 15:17:19 +0000 (11:17 -0400)]
stap-report: generate fewer incidental errors on unusual platforms

9 years agoman/stap.1: add portion on array slicing
Abegail Jakop [Tue, 2 Sep 2014 22:03:04 +0000 (18:03 -0400)]
man/stap.1: add portion on array slicing

9 years agoNEWS: added a piece about array slicing (PR12333)
Abegail Jakop [Tue, 2 Sep 2014 20:26:25 +0000 (16:26 -0400)]
NEWS: added a piece about array slicing (PR12333)

9 years agotestsuite: Reduce global timeout to 15 minutes
Josh Stone [Tue, 2 Sep 2014 19:20:31 +0000 (12:20 -0700)]
testsuite: Reduce global timeout to 15 minutes

Very old kernels used jiffies for timer.s, and limit that to 1000000ms
to avoid overflows.  The testsuite rc's timer.s(3100) exceeded that.

A 15 minute timeout, timer.s(900), fits the limit and should suffice.

9 years agofix process_by_pid.exp failing to hit all probes point
Abegail Jakop [Tue, 2 Sep 2014 17:52:13 +0000 (13:52 -0400)]
fix process_by_pid.exp failing to hit all probes point

process_by_pid.stp: more information is printed if the test case fails
process_by_pid.c: add sleep() so it has a plt that can be reached easily

9 years agotapsets.cxx: throw error for invalid PID, not valid PID
Abegail Jakop [Tue, 2 Sep 2014 17:14:26 +0000 (13:14 -0400)]
tapsets.cxx: throw error for invalid PID, not valid PID

9 years agoMerge branch 'ajakop/12333'
Abegail Jakop [Tue, 2 Sep 2014 15:06:47 +0000 (11:06 -0400)]
Merge branch 'ajakop/12333'

9 years agoPR12333: added another pmaps membership test case
Abegail Jakop [Tue, 2 Sep 2014 14:56:34 +0000 (10:56 -0400)]
PR12333: added another pmaps membership test case

9 years agoPR12333: cleanup and membership test with pmaps
Abegail Jakop [Tue, 2 Sep 2014 14:27:16 +0000 (10:27 -0400)]
PR12333: cleanup and membership test with pmaps

9 years agoPR12333: Aggregate pmaps for sliced array_in
Josh Stone [Fri, 29 Aug 2014 22:37:05 +0000 (15:37 -0700)]
PR12333: Aggregate pmaps for sliced array_in

Since sliced array_in iterates over the aggregate for pmaps, it needs to
actually build that aggregate first, unless we're already in foreach.

9 years agoPR12333: Use 1/0 conditions instead of true/false in C
Josh Stone [Fri, 29 Aug 2014 22:15:47 +0000 (15:15 -0700)]
PR12333: Use 1/0 conditions instead of true/false in C

The kernel happens to declare true/false values for C to use, at least
since commit 6e21828743247 (in 2.6.19), but stapdyn's normal C runtime
doesn't have that.  Use boring old 1/0 instead.

9 years agoDrop passing the last parameter to determin_java_type
Lukas Berk [Fri, 29 Aug 2014 19:35:49 +0000 (15:35 -0400)]
Drop passing the last parameter to determin_java_type

*java/HelperSDT.c - drop passing the lsat parameter to determin_java_type
    and simply return the casted value instead of assigning
    and then returning

9 years agoFix ppc64 value issue by changing how java vars are passed from jni
Lukas Berk [Fri, 29 Aug 2014 14:13:05 +0000 (10:13 -0400)]
Fix ppc64 value issue by changing how java vars are passed from jni

Instead of using a _staparg struct, we now just use a int64_t var
and cast to that, instead of making assumptions on how the struct is
packed.

*java/HelperSDT.c - use int64_t as the arg type instead of _staparg union

9 years agoPR12333: updated and added tests, and removed comment
Abegail Jakop [Thu, 28 Aug 2014 19:49:09 +0000 (15:49 -0400)]
PR12333: updated and added tests, and removed comment

9 years agoPR12333: added minor tests, updated main test case
Abegail Jakop [Thu, 28 Aug 2014 19:18:16 +0000 (15:18 -0400)]
PR12333: added minor tests, updated main test case

9 years agoPR12333: deleting pmap specified by array slice
Abegail Jakop [Thu, 28 Aug 2014 19:08:59 +0000 (15:08 -0400)]
PR12333: deleting pmap specified by array slice

runtime/map.c: have iterdel() use pre-existing functions
translate.cxx: generate code to delete elements from a pmap, based on
an array slice given. rename next() that called iterdel to del_next()
staptree.cxx: cleanup of an unnecessary condition

9 years agoAdd helper that can handle wildcards within arrayindexes
Abegail Jakop [Thu, 28 Aug 2014 19:00:13 +0000 (15:00 -0400)]
Add helper that can handle wildcards within arrayindexes

9 years agoFix runtime-java triggers for ppc64le
Yaakov Selkowitz [Wed, 27 Aug 2014 17:28:51 +0000 (12:28 -0500)]
Fix runtime-java triggers for ppc64le

Signed-off-by: Lukas Berk <lberk@redhat.com>
9 years agostore given pid for process probe for use by task_finder
Abegail Jakop [Tue, 26 Aug 2014 19:53:22 +0000 (15:53 -0400)]
store given pid for process probe for use by task_finder

session.cxx: replace readlink(), which did the pid validation,
with is_valid_pid()
tapsets.cxx: if given, within dwarf_builder::build store the pid
for use by uprobe_derived_probe so that task_finder associates
the probe with the pid
util.*: new function that checks if the given pid is valid. if
not, it generates an error message that can be used.

9 years agotranslate.cxx: declaring tmpvars for array slices
Abegail Jakop [Mon, 25 Aug 2014 14:49:15 +0000 (10:49 -0400)]
translate.cxx: declaring tmpvars for array slices

9 years agoPR12333: store wildcards in array slices as NULL
Abegail Jakop [Fri, 22 Aug 2014 20:52:33 +0000 (16:52 -0400)]
PR12333: store wildcards in array slices as NULL

parse.cxx: set the index for array slices as NULL if it's a wildcard
elaborate.cxx: account for NULL indexes. added error message in
symresolution_info::visit_arrayindex if it encounters a NULL index,
since all expressions that support wildcards dealt with separately
staptree.cxx: when printing out foreach, delete and array_in, replace
NULL indexes with "*"
translate.cxx: account for NULL indexes. don't generate a tmpvar
for a wildcard array index

9 years agoPR12333: use parent for symresolution in delete array index
Abegail Jakop [Fri, 22 Aug 2014 15:28:28 +0000 (11:28 -0400)]
PR12333: use parent for symresolution in delete array index

9 years agooptim_arridx.exp: avoid propagating PR17301
Martin Cermak [Fri, 22 Aug 2014 12:55:28 +0000 (14:55 +0200)]
optim_arridx.exp: avoid propagating PR17301

9 years agoalias_tapset.exp: avoid unwanted interference with the "timeout feature" (commit...
Martin Cermak [Fri, 22 Aug 2014 08:52:37 +0000 (10:52 +0200)]
alias_tapset.exp: avoid unwanted interference with the "timeout feature" (commit d13c9b7)

9 years agoPR12333: test file for array slicing
Abegail Jakop [Thu, 21 Aug 2014 17:25:41 +0000 (13:25 -0400)]
PR12333: test file for array slicing

9 years agoPR12333" array slicing for membership test
Abegail Jakop [Thu, 21 Aug 2014 16:17:40 +0000 (12:17 -0400)]
PR12333" array slicing for membership test

parse.cxx: accept wildcards in the arrayindex for array_in
elaborate.cxx: new function symresolution_info::visit_array_in
that skips processing wildcards that are present in the arrayindex
translate.cxx: generate code to iterate over the array until a
match is found or until the end of the array

9 years agoPR12333: don't store array slice indexes as lrvalues
Abegail Jakop [Wed, 20 Aug 2014 21:11:05 +0000 (17:11 -0400)]
PR12333: don't store array slice indexes as lrvalues

9 years agoPR12333: treat array slice indexes as rvalues
Abegail Jakop [Wed, 20 Aug 2014 20:12:14 +0000 (16:12 -0400)]
PR12333: treat array slice indexes as rvalues

9 years agoPR12333: array slicing for delete statements
Abegail Jakop [Tue, 19 Aug 2014 18:12:52 +0000 (14:12 -0400)]
PR12333: array slicing for delete statements

parse.cxx: accept wildcards (*) within array indexes
elaborate.cxx: skip processing wildcards in array indexes for delete
staptree.cxx: for the varuse_collecting_visitor, don't throw an error
about no referent if the symbol is a wildcard
translate.cxx: generate code for deleting variables if the indexes match
the array slice given. Also generate code to initialize tmpvars used to
store indexes in the array slice.
runtime/map.c: new function _stp_map_iterdel that deletes the node given,
and returns the next node in the map.

9 years agoruntime: improve robustness of shutdown phase via flush_scheduled_work()
Frank Ch. Eigler [Sun, 17 Aug 2014 14:55:35 +0000 (10:55 -0400)]
runtime: improve robustness of shutdown phase via flush_scheduled_work()

It has been observed that schedule_work() artifacts have the potential
to overstay their welcome during shutdown, triggering some time after
their operand data structures have been deallocated.  This has shown
up most recently on 3.17-rc0 during the on-the-fly stress-testing, but
also can be observed with plain pseudo-utrace callbacks.  We now add a
flush_scheduled_work() into our cargo-cult stp_synchronize_sched(),
which we now call during the on-the-fly shutdown phase too.

9 years agotranslator: in -u (unoptimized) mode, don't merge identical probe handler bodies
Frank Ch. Eigler [Sun, 17 Aug 2014 14:50:52 +0000 (10:50 -0400)]
translator: in -u (unoptimized) mode, don't merge identical probe handler bodies

Normal optimized mode can make it difficult to see which stap probe
was being invoked for which C probe handler body, as identical probe
handlers are reused.  This is inconvenient if one just has a kernel
crash backtrace to start from from.

* translate.cxx (emit_common_header, emit_probe): In -u mode,
  eschew duplicate probe handler body elision.

9 years agoPR12333: printscript() prints array slice in foreach loops
Abegail Jakop [Fri, 15 Aug 2014 20:42:48 +0000 (16:42 -0400)]
PR12333: printscript() prints array slice in foreach loops

9 years agoPR12333: evaluating the indexes before the loop body
Abegail Jakop [Fri, 15 Aug 2014 20:33:33 +0000 (16:33 -0400)]
PR12333: evaluating the indexes before the loop body

translate.cxx: evaluate the expressions that make up the array slice
index for foreach loops. updated c_tmpcounter::visit_foreach_loop to
account for the additional tmpvars used to store array slice indexes

9 years agoFix PR17275 by fixing testcase problems on s390x.
David Smith [Fri, 15 Aug 2014 20:07:52 +0000 (15:07 -0500)]
Fix PR17275 by fixing testcase problems on s390x.

* testsuite/buildok/memory-all-probes.stp: Tweak test to avoid overly
  broad wildcards, which can cause the test to fail on systems without
  uprobes (like s390x).
* testsuite/buildok/tcp-all-probes.stp: Ditto.

9 years agoPR16716 partial fix: Fix types in 'syscall.{mmap[2],[p]poll}'.
David Smith [Fri, 15 Aug 2014 16:07:28 +0000 (11:07 -0500)]
PR16716 partial fix: Fix types in 'syscall.{mmap[2],[p]poll}'.

* tapset/linux/syscalls.stp (syscall.mmap2): Fixed type.
* tapset/linux/nd_syscalls.stp (nd_syscall.mmap2): Ditto.
* tapset/linux/syscalls2.stp: Fixed types in syscall.poll, syscall.ppoll,
  and syscall.compat_ppoll.
* tapset/linux/nd_syscalls2.stp: Ditto.
* tapset/linux/aux_syscalls.stp (_mremap_flags): Updated and improved.
  (get_mmap_args): Fixed type.
* tapset/linux/i386/syscalls.stp: Fixed types in syscall.mmap2.
* tapset/linux/i386/nd_syscalls.stp: Ditto.

* tapset/linux/ia64/syscalls.stp: Fixed types in syscall.mmap and
  syscall.mmap2.
* tapset/linux/ia64/nd_syscalls.stp: Ditto.
* tapset/linux/powerpc/syscalls.stp: Ditto.
* tapset/linux/powerpc/nd_syscalls.stp: Ditto.
* tapset/linux/x86_64/syscalls.stp: Ditto.
* tapset/linux/x86_64/nd_syscalls.stp: Ditto.
* tapset/linux/s390/syscalls.stp: Ditto.
* tapset/linux/s390/nd_syscalls.stp (get_32mmap_args): Updated and fixed
  types.
* testsuite/buildok/syscalls2-detailed.stp: Made syscall.uselib tests
  optional, since rawhide kernels have dropped the syscall.
* testsuite/buildok/nd_syscalls2-detailed.stp: Ditto.
* testsuite/systemtap.syscall/mmap.c: Added more tests.
* testsuite/systemtap.syscall/poll.c: Ditto.
* testsuite/systemtap.syscall/recv.c: Ignore error code.

9 years agostap_run.exp: avoid propagating PR17274
Martin Cermak [Fri, 15 Aug 2014 15:37:25 +0000 (17:37 +0200)]
stap_run.exp: avoid propagating PR17274

9 years agohrtimer/kprobes_onthefly.exp: use process.function only if supported
Jonathan Lebon [Thu, 14 Aug 2014 19:07:15 +0000 (15:07 -0400)]
hrtimer/kprobes_onthefly.exp: use process.function only if supported

We should test for uprobes support before testing with the
process("echo").function probe.

9 years agoImprove on-the-fly initialization code.
David Smith [Thu, 14 Aug 2014 18:49:44 +0000 (13:49 -0500)]
Improve on-the-fly initialization code.

* translate.cxx (c_unparser::emit_probe_condition_initialize): Only output
  'cond_enabled' field initialization if the probe isn't always enabled.
  (translate_pass): Always initialize 'cond_enabled' to 1. This can get
  overridden by the output of
  c_unparser::emit_probe_condition_initialize().

9 years agoPR17242 extra: Remove _stp_register_regs() from x86_gs test
Josh Stone [Thu, 14 Aug 2014 15:52:11 +0000 (08:52 -0700)]
PR17242 extra: Remove _stp_register_regs() from x86_gs test

9 years agoPR17242 extra: Change dangling _stp_register_regs() function to init probes.
David Smith [Thu, 14 Aug 2014 14:56:39 +0000 (09:56 -0500)]
PR17242 extra: Change dangling _stp_register_regs() function to init probes.

* tapset/i386/registers.stp: Convert the _stp_register_regs() function to
  an init probe.
* tapset/powerpc/registers.stp: Ditto.

9 years agoAdd perf.return functionality to ltrace.stp.
Stan Cox [Wed, 13 Aug 2014 18:41:00 +0000 (14:41 -0400)]
Add perf.return functionality to ltrace.stp.

* ltrace.stp (filter_p, arg, report, begin, end):  New
(process.plt, process.plt.return): Handle return value.
(end): Display summary statistics.

* perf.sh (poly): Add guard for negative and too large values.

9 years agoruntime: plea with the gods for a lockless stp_print_flush
Frank Ch. Eigler [Tue, 12 Aug 2014 19:57:01 +0000 (15:57 -0400)]
runtime: plea with the gods for a lockless stp_print_flush

9 years agoPR17260: Use get_context to guard stp_print_flush's lock
Josh Stone [Tue, 12 Aug 2014 17:29:30 +0000 (10:29 -0700)]
PR17260: Use get_context to guard stp_print_flush's lock

Holding a context ensures that any probes triggered in the interim will
be considered reentrant and skipped, since such a nested probe might
have recursed on that spinlock.  We faced a similar situation before
with _stp_ctl_send and all the locks it touches.

Reverts "PR17260: make stp_print_flush use spin_trylock instead of
spin_lock", commit 80c97a2fab46b9d6213d93d63e18d6fd2cbd88f1.

9 years agotranslator: fix function-call actioncount optimization regression
Frank Ch. Eigler [Tue, 12 Aug 2014 15:14:26 +0000 (11:14 -0400)]
translator: fix function-call actioncount optimization regression

commit #765e6976 accidentally emitted actioncount-tracking code in the
wrong place in the function-call sequence.

* translate.cxx (visit_functioncall): Move it up a wee little bit.

9 years agoPR17260: make stp_print_flush use spin_trylock instead of spin_lock
Frank Ch. Eigler [Tue, 12 Aug 2014 15:05:42 +0000 (11:05 -0400)]
PR17260: make stp_print_flush use spin_trylock instead of spin_lock

This risks "WARNING: NNNN transport failures..." messages at stap
shutdown, but appears to work around this particular reentrancy
problem.

9 years agotestsuite: switch from kernel.function("copy_flags") -> "copy_signal"
Frank Ch. Eigler [Mon, 11 Aug 2014 21:23:11 +0000 (17:23 -0400)]
testsuite: switch from kernel.function("copy_flags") -> "copy_signal"

The former was retired in kernel commit #514ddb446c; the latter
exists as far back as RHEL4.

9 years agoPR10995: stapprobes.3stap: armability corrections from jlebon
Frank Ch. Eigler [Mon, 11 Aug 2014 20:33:28 +0000 (16:33 -0400)]
PR10995: stapprobes.3stap: armability corrections from jlebon

9 years agoPR10995: extend man pages re. arming/disarming
Frank Ch. Eigler [Mon, 11 Aug 2014 20:24:07 +0000 (16:24 -0400)]
PR10995: extend man pages re. arming/disarming

9 years agostatement.nearest probes followup: some docs, samples, tweakage
Frank Ch. Eigler [Mon, 11 Aug 2014 19:56:15 +0000 (15:56 -0400)]
statement.nearest probes followup: some docs, samples, tweakage

* NEWS: Mention it.
* man/stapprobes.3stap: Document it.
* testsuite/systemtap.examples/*: Use it.
* testsuite/systemtap.*/: Baby test it.
* dwflpp.cxx: Drop debugging statement and make a speech.

9 years agodwflpp: register statement.nearest suffix
Honggyu Kim [Mon, 4 Aug 2014 13:18:40 +0000 (22:18 +0900)]
dwflpp: register statement.nearest suffix

If a line number is given in 'statement', line records in dwarf may not
be found for a given line number.
In this case, alternative line numbers were suggested and exited.

With statement.nearest suffix, a kprobe is inserted into the nearest
line number that is available in dwarf line record.

 * dwflpp.cxx(dwflpp.cxx::insert_alternative_linenos): Add a new method,
       Add an arg "has_nearest" in dwflpp::iterate_over_srcfile_lines
 * dwflpp.h(dwflpp.cxx::insert_alternative_linenos): Ditto.
 * tapsets.cxx: Add a new suffix statement.nearest

Signed-off-by: Honggyu Kim <hong.gyu.kim@lge.com>
9 years agoMerge branch 'jlebon/onthefly' (PR10995)
Jonathan Lebon [Mon, 11 Aug 2014 19:40:19 +0000 (15:40 -0400)]
Merge branch 'jlebon/onthefly' (PR10995)

This branch adds support for on-the-fly probes as described in PR10995.
It also includes various minor fixes as well as a new file
runtime/linux/kprobes.c which hosts kprobes-related code (rather than
being dynamically emitted from tapsets.cxx).

9 years agoNEWS: add blurb for on-the-fly
Jonathan Lebon [Fri, 8 Aug 2014 16:30:27 +0000 (12:30 -0400)]
NEWS: add blurb for on-the-fly

9 years agopr13306.exp: adapt to new timing report
Jonathan Lebon [Mon, 11 Aug 2014 14:46:15 +0000 (10:46 -0400)]
pr13306.exp: adapt to new timing report

9 years agoon-the-fly: don't use background timer if hrtimers missing
Jonathan Lebon [Wed, 23 Jul 2014 20:24:45 +0000 (16:24 -0400)]
on-the-fly: don't use background timer if hrtimers missing

On older systems (< 2.6.17), hrtimers are not supported. Guard code
related to the background timer with this check so that we can at least
still compile code on these older platforms.

9 years agoon-the-fly: only start background timer if needed
Jonathan Lebon [Tue, 22 Jul 2014 18:41:42 +0000 (14:41 -0400)]
on-the-fly: only start background timer if needed

Rather than always starting the background timer, only start it when it
is needed. That is, start the background timer when a probe which has an
effect on the conditions of probes which support on-the-fly operations
isn't a safe context for calling schedule_work() (determined by
otf_safe_context()).

9 years agomake schedule_work() call depend on otf_safe_context()
Jonathan Lebon [Thu, 24 Jul 2014 18:15:22 +0000 (14:15 -0400)]
make schedule_work() call depend on otf_safe_context()

Now that each probe group directly describes whether their context is
safe for workqueue manipulations, we can directly emit in the probe
epilogue a call to schedule_work() if the probe is safe, rather than
doing it on a case-by-case basis.

9 years agoon-the-fly: make support a property of group rather than probe
Jonathan Lebon [Wed, 23 Jul 2014 18:32:15 +0000 (14:32 -0400)]
on-the-fly: make support a property of group rather than probe

Support for on-the-fly operations is more a property of the
derived_probe_group (which does the actual emitting), rather than
derived_probe.

For example, not because a dwarf_derived_probe supports on-the-fly
operations does it mean that a uprobe_derived_probe (which inherits from
dwarf_derived_probe) does. Similarly, a uprobe_derived_probe's support
for on-the-fly operations depends on the actual code emitted by the
group, which will emit different things depending on whether we're using
utrace or inode-uprobes for example.

To do this, we introduce a 'group' attribute which remembers to which
group a derived_probe has been added. This is then used during
translation time to check if the probe group supports on-the-fly
operations.

This patch also introduces otf_safe_context(), which determines whether
the context of the probe type is safe enough for direct workqueue
manipulations. This then allows us to only use the background timer if
the probe doing the toggling does not support workqueue manipulations.

9 years agoimplement STP_ON_THE_FLY_INTERVAL
Jonathan Lebon [Wed, 23 Jul 2014 14:15:10 +0000 (10:15 -0400)]
implement STP_ON_THE_FLY_INTERVAL

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