Abegail Jakop [Thu, 11 Dec 2014 20:20:44 +0000 (15:20 -0500)]
PR12276: debug_line data decoder
runtime/sym.c: have _stp_linenumber_lookup() go through the
debug_line info and determine if the given address corresponds
to a line number (and a file name).
Abegail Jakop [Tue, 9 Dec 2014 20:58:17 +0000 (15:58 -0500)]
PR12276: constant definitions and moved functions
unwind.*: moved function and constant definitions related to read_pointer()
from unwind.c to unwind/unwind.h for use by the debug_line decoder
sym.*: include the unwind header file and add in constants for decoding
opcodes within the debug_line decoder
Abegail Jakop [Fri, 5 Dec 2014 15:15:37 +0000 (10:15 -0500)]
PR12276: dump debug_line data to generated header
elaborate.cxx: set a flag to indicate debug_line data is needed if
pragma:lines was found in embedded code
translate.cxx: gather debug_line data if it is needed and can be accessed.
if the data was gathered, output it to the generated header file
William Cohen [Mon, 2 Feb 2015 04:02:01 +0000 (23:02 -0500)]
Fix the hw_watch_addr.stp test to properly test for kernel support
The check for kernel support uses perf and perf needs to just have the
address to watch. There was additional output on the line from
/proc/kallsyms causing the test to fail. Used awk to extract only the
numerical address from the line.
William Cohen [Mon, 2 Feb 2015 02:21:24 +0000 (21:21 -0500)]
Fix the hw_watch_sym.stp test to properly test for kernel support
The check for kernel support uses perf and perf needs to just have the
address to watch. There was additional output on the line from
/proc/kallsyms causing the test to fail. Used awk to extract only the
numerical address from the line.
William Cohen [Mon, 2 Feb 2015 01:16:54 +0000 (20:16 -0500)]
Match more 32-bit ARM variants for sdt_misc.exp
On 32-bit ARM The target names may be things like
armv7l-unknown-linux-gnueabihf. The target test would miss these
types of tuples because the tuple had something other than just "arm".
The tests have been broaden to allow for these other arm variants.
William Cohen [Fri, 30 Jan 2015 22:38:43 +0000 (17:38 -0500)]
Fixed systemtap-server.exp
When certain systemtap-service.exp tests failed the failure would
cause the script to exit early due to an error and omit the remaining
tests due to a missing "global test". Added the missing statement.
Now the failures are reported and the rest of the tests are run.
Jonathan Lebon [Mon, 26 Jan 2015 19:19:59 +0000 (14:19 -0500)]
PR17749: add subtest to global_end.exp
Make a new test script checking all the ways in which a variable should
be marked as used.
Note that there are other places in which a var should be marked used
(e.g. stat_op), but they would need to be nested within a context which
already marks nested symbols as used (e.g. in an if() condition). Unless
it's placed on a line by itself, in which case it doesn't matter because
it would get elided as a side-effect-free expr.
Jonathan Lebon [Mon, 12 Jan 2015 20:27:10 +0000 (15:27 -0500)]
PR17749: varuse visitor: account for all ways vars are used
Ensures that vars are marked as used in the following situations:
- if conditions
- for/while loop conditions
- function call arguments
- return statements
- foreach array slices
- foreach limit
- ternary expression conditions
- arrayindex indexes
Also fixes all the variables in a function marked as used if called from
an lvalue context.
William Cohen [Thu, 29 Jan 2015 17:56:45 +0000 (12:56 -0500)]
Remove the "-m64" option forr arm64 sdt_misc.exp tests
The arm64 code is always 64-bit, never 32-bit. Tthe gcc compiler does
not have a "-m64" option to force 64-bit code generation for arm64 and
the builds will fail with "-m64" on the command line. Eliminated the
unwanted option from the sdt_misc.exp tests when running on arm64.
William Cohen [Thu, 29 Jan 2015 16:58:28 +0000 (11:58 -0500)]
Just use a simple match for the uname for cmd_parse15
When building kernels from a git repository the uname ends up having
'+' in the name. The '+' in the uname can cause the expect for the
cmd_parse15 test to fail. Changed expect to use the simple-minded
"-gl" to match in these cases.
William Cohen [Wed, 28 Jan 2015 03:36:40 +0000 (22:36 -0500)]
Support constant arguments for arm64 sdt markers
Testing of the arm64 uprobes kernel support showed that systemtap was
not handling sdt marker arguments that were optimized into constants
correctly (PR17889). The arm64 does not prefix literals. No '$' or
'#' prefixes. Corrected the matching code to address this case. Also
added an entry in the comment of architecture specific sdt argument
constructs documenting the possible arm64 sdt marker argument formats.
David Smith [Tue, 27 Jan 2015 20:45:49 +0000 (14:45 -0600)]
Fix PR17888 by updating the dentry.stp tapset.
* tapset/linux/dentry.stp (task_dentry_path): For newer kernels, the 'mnt'
and 'dentry' members of 'struct path' are already pointers, so no need
to take their addresses.
William Cohen [Tue, 27 Jan 2015 15:29:08 +0000 (10:29 -0500)]
Make EM_AARCH64 backup definition more generally available (PR17884)
There are older versions of elf.h that do not have a definition of
EM_AARCH64. There was a backup definition of EM_AARCH64 in
tapset.cxx, but also need this definition for dwflpp.cxx. Moved the
definition EM_AARCH64 to dwflpp.h to make it more generally visible.
William Cohen [Mon, 26 Jan 2015 21:01:33 +0000 (16:01 -0500)]
Correct syscall numbers for arm64
The 32-bit arm and 64-bit arm architectures are pretty different.
They do not share the same syscall numbers for mmap, mmap2, munmap,
and mremap. These need to be corrected for systemtap to notice when
memory map operations occured on arm64 and uprobes may need to be
inserted or removed.
Josh Stone [Fri, 23 Jan 2015 23:03:01 +0000 (15:03 -0800)]
Tolerate missing line records in prologue search
If we're trying to scan line records for the function prologue, but the
current CU fails dwarf_getsrclines(), then just return so we can probe
without skipping prologues.
Such CUs were seen for the jemalloc sources built into Rust's libstd.
For some reason these don't have any DW_AT_stmt_list at all!
Josh Stone [Fri, 23 Jan 2015 22:46:03 +0000 (14:46 -0800)]
PR17858: Just warn and continue for stapdyn unknown globals
With staprun modules, the kernel just noted the unknown module option in
dmesg, and everything continues. For stapdyn, we were getting a warning
which set enough of an error state to skip the rest of initialization,
including begin probes, but not enough to exit the script. Now unknown
options just warn without setting error state, but invalid options like
bad number formats will set an error and properly exit.
Jonathan Lebon [Fri, 16 Jan 2015 18:29:40 +0000 (13:29 -0500)]
PR17860: match foreach logic in tmpcounter and unparser
This patch fixes PR17860 by ensuring that tmpvars are declared in
c_tmpcounter::visit_foreach_loop() in the same order as they are used in
c_unparser::visit_foreach_loop().
Martin Cermak [Wed, 21 Jan 2015 17:29:48 +0000 (18:29 +0100)]
PR17864: Fix alias_tapset.exp regression
* Take only interesting parts of the stap output into account
so that expect's match_max doesn't get exceeded.
* Adapt the testcase to commit befbf100 which modifies
syscall.read on s390x
If DW_AT_comp_dir is the same as s.kernel_build_tree, then it's not a
useful path for s.kernel_source_tree. By ignoring this case, we allow
the next block to check whether the source symlink is useful instead.
Martin Cermak [Mon, 12 Jan 2015 16:37:18 +0000 (17:37 +0100)]
PR17714: Work with valid pointers, correctly test for unimplemented syscalls.
* tapset/linux/syscalls.stp: Work with valid pointers in s390 compat task.
* testsuite/systemtap.syscall/poll.c: epoll_pwait() unimplemented on RHEL5 x86_64.
Jonathan Lebon [Fri, 19 Dec 2014 18:53:09 +0000 (13:53 -0500)]
don't support TRACE_SYSTEM for --compatible <= 2.6
When in compatibility mode, we want the probe name to remain the same so
that e.g. pn() still only displays the tracepoint name (without the
system prefix).
Jonathan Lebon [Fri, 26 Sep 2014 22:00:23 +0000 (18:00 -0400)]
tracepoint_builder: add section to hold TRACE_SYSTEM
Upon compiling the various headers, we also suck up the current value of
TRACE_SYSTEM into a new section called .stap_trace_system.
Unfortunately, we cannot play the same trick we do with the
stapprobe_{function} since TRACE_SYSTEM can be any string value and may
thus contain invalid identifier characters.
Josh Stone [Thu, 8 Jan 2015 22:47:20 +0000 (14:47 -0800)]
Use the kernel source symlink for tracepoints
When the source symlink is different than the build symlink, as for
out-of-tree kernel builds and Debian linux-headers, then we should use
that path as a prefix for finding tracepoint headers.
David Smith [Tue, 6 Jan 2015 21:43:42 +0000 (15:43 -0600)]
Fix PR17807 by updating the vfs tapset.
* tapset/linux/vfs.stp (generic.fop.aio_read): Make optional and fix
__iov_length() call to use VERIFY_WRITE.
(generic.fop.aio_read.return): Make optional.
(generic.fop.read_iter): New probe.
(generic.fop.read_iter.return): Ditto.
(generic.fop.aio_write): Make optional and fix __iov_length() call to
use VERIFY_READ.
(generic.fop.aio_write.return): Make optional.
(generic.fop.write_iter): New probe.
(generic.fop.write_iter.return): Ditto.
* tapset/linux/nfs.stp (nfs.fop.aio_read): Fix __iov_length() call to use
VERIFY_WRITE.
(nfs.fop.read_iter): Ditto.
(nfs.fop.aio_write): Fix __iov_length() call to use VERIFY_READ.
(nfs.fop.write_iter): Ditto.
* testsuite/buildok/vfs-detailed.stp: Add tests for the new probes.
On suggestion from Brendan Gregg, it would be helpful for the examples
list to highlight "best" scripts, out of the over-one-hundred we ship.
To begin, this is approximated by special support for the .meta keyword
"_best", which results in highlighting the marked samples at the top
of the [keyword-]index.html files.
Frank Ch. Eigler [Tue, 30 Dec 2014 15:25:01 +0000 (10:25 -0500)]
PR17743: stap* help/version text should go peacefully to stdout
As per GNU habits, specifically requested help/version strings for
our programs should go to stdout with rc=0 rather than stderr rc=1.
Adjust stap, staprun, stapio, stapdyn code to taste. helpout.exp
test case to confirm.
Jonathan Lebon [Mon, 22 Dec 2014 17:21:40 +0000 (12:21 -0500)]
listing_mode.exp: update for RHEL5
The listing_mode.exp testcase showed multiple failures on RHEL5. This
commit fixes these errors by making perf probe testing conditional on
system support and by adjusting linenos to play nice with RHEL5's GCC.
Frank Ch. Eigler [Mon, 22 Dec 2014 16:59:40 +0000 (11:59 -0500)]
PR17737: tapset-reference html chapters should not get <toc>
The docbook xsl-stylesheets' html output normally includes generated
TOC for incoming <chapter> blocks. Suppress this with a cunning
choice of generate.toc --stringparam for the xmlto. (On F21 at least,
the parameter needs to contain an embedded \ apparently due to layers
of being passed between shell scripts and xml parsers and whatnot.
Sorry.)
David Smith [Tue, 16 Dec 2014 16:58:05 +0000 (10:58 -0600)]
Fix PR17688 by updating the nfs tapset for kernels >= 3.16.
* tapset/linux/nfs.stp (nfs.fop.aio_read): Only use if the kernel version
is less than 3.16. Upstream kernel has switched from aio_{read,write} to
{read_write}_iter, but using the same function names.
(nfs.fop.aio_write): Ditto.
(nfs.fop.read_iter): New probe for kernel versions >= 3.16.
(nfs.fop.write_iter): Ditto.
* testsuite/buildok/nfs-detailed.stp: Added new tests.
William Cohen [Mon, 15 Dec 2014 19:45:40 +0000 (14:45 -0500)]
Improve the output of cycle_thief.stp to include executable name
Jeremy Eder suggested that it would be good to include the executable
name in the output to save people the step of looking up the
executable name of the various PIDs. The change also includes a
header for the output in that section to make it clearer what each
column is.
William Cohen [Mon, 8 Dec 2014 21:25:37 +0000 (16:25 -0500)]
Fix the SDT_V3 operand handling to recognize arm64 style address modes
The arm64 address operands are very similar to 32-bit arm address
operands, but they are not identical. The arm64 versions may lack
white space and the '#' before the offset value. The regular
expression matching has been adjusted to recognized both 32-bit and
64-bit arm versions.
David Smith [Mon, 8 Dec 2014 20:04:19 +0000 (14:04 -0600)]
Fix BZ1171823 by updating the __svc_fh() nfsd tapset function.
* tapset/linux/nfsd.stp: Rewrite __svc_fh() in systemtap script language
instead of embedded-C to get around the disappearance of struct svc_fh's
declaration from a public kernel header file.
William Cohen [Mon, 8 Dec 2014 19:39:25 +0000 (14:39 -0500)]
Allow speculate.exp to use syscall.openat on arm64
On arm64 the syscall.open is deprecated and will never be used. The
arm64 will use syscall.openat instead. The speculate.exp test has
been adjusted accept syscall.openat in the place of syscall.open.
William Cohen [Mon, 8 Dec 2014 17:08:05 +0000 (12:08 -0500)]
Allow pp.exp to use syscall.openat on arm64
On arm64 the syscall.open is deprecated and will never be used. The
arm64 will use syscall.openat instead. The pp.exp test has been
adjusted accept syscall.openat in the place of syscall.open.
William Cohen [Mon, 8 Dec 2014 14:47:41 +0000 (09:47 -0500)]
Corrections to global_var_kernel.stp tests
Newer kernels have moved kernel/time.c to kernel/time/time.c and the
@var() statements need to be less picky where it looks for sys_tz.
Also some machines such as the arm64 use the syscall.openat than
the deprecated syscall.open.
Martin Cermak [Fri, 5 Dec 2014 16:38:50 +0000 (17:38 +0100)]
PR16716 partial fix: Fix types in 'syscall.sched_{{get,set}param,get_priority_{max,min},yield}'
* tapset/linux/aux_syscalls.stp: Fix handling negative args in _sched_policy_str()
* tapset/linux/nd_syscalls2.stp: Fix argstr in sched_get_priority_{max,min}
* tapset/linux/syscalls2.stp: Fix types and argstr in sched_get_priority_{max,min}
and sched_{get,set}param
* testsuite/systemtap.syscall/mknod.c: Use thin wrapper around the syscall()
* testsuite/systemtap.syscall/sched.c: New testcase