Josh Stone [Fri, 20 Feb 2015 19:40:56 +0000 (11:40 -0800)]
PR18000: Always use new tracequery objects directly
When new tracequery objects are built, always use them directly from the
build directory, regardless of whether the systemtap cache is enabled.
This allow traceponts to be found even under --disable-cache.
Martin Cermak [Tue, 17 Feb 2015 18:19:00 +0000 (19:19 +0100)]
PR16716 partial fix: Fix types and nesting for 'syscall.{mbind,move_pages,migrate_pages}'.
* runtime/linux/compat_unistd.h: Define __NR_move_pages for rhel5 powerpc platform
* tapset/linux/nd_syscalls.stp: Fix types and nesting for 'syscall.{mbind,move_pages,migrate_pages}'.
* tapset/linux/syscalls.stp: Fix types and nesting for 'syscall.{mbind,move_pages,migrate_pages}'.
* testsuite/buildok/nd_syscalls-detailed.stp: Test all convenience variables.
* testsuite/buildok/syscalls-detailed.stp: Test all convenience variables.
* testsuite/systemtap.syscall/numa.c: New testcase.
Frank Ch. Eigler [Mon, 16 Feb 2015 20:50:55 +0000 (15:50 -0500)]
testsuite listing_mode: Adapt to changed line numbers
commit 2538abbc94 inserted some blank lines to separate function
declarations and bodies, but the .exp file needs correponding updates
for the pushed-down line numbers.
Frank Ch. Eigler [Fri, 13 Feb 2015 15:31:32 +0000 (10:31 -0500)]
BZ1128209: add a configure --{enable,disable}-virt option
It was desirable that a systemtap rpm be buildable in a predictable
manner (in this case, without virthost support), even if prerequisites
(libvirt etc.) were accidentally installed.
Josh Stone [Fri, 13 Feb 2015 02:06:54 +0000 (18:06 -0800)]
PR17966: never generate .call for an unresolved .return $var
The saved-return code already skipped .call for any $var that generated
an error, but variables attempted in a symtab context don't generate
errors until later. This means a @defined-guarded $var might create an
unguarded access in .call that causes unrecoverable errors further on.
Now the .call will be skipped if the target_symbol persists for any
reason, regardless of its error state. Any resolved target_symbol
should become something quite different, usually a loc2c function call.
The minidebuginfo.exp test is extended to exercise @defined and .return
scenarios as well.
Josh Stone [Thu, 12 Feb 2015 21:45:15 +0000 (13:45 -0800)]
runtime/linux: block utrace-via-tracepoints without tracepoints
The code in autoconf-utrace-via-tracepoints.c will compile just fine on
kernels which do have those tracepoints, but not CONFIG_TRACEPOINTS=y.
That would only result in ENOSYS at runtime.
To get this autoconf working at compile time, check the config directly.
Reported-by: Crestez Dan Leonard <cdleonard@gmail.com>
Frank Ch. Eigler [Tue, 10 Feb 2015 22:42:35 +0000 (17:42 -0500)]
gcc5 -Wformat=2 tweaks
-Wformat=2 now includes -Wformat=signedness, which sadly some of our
violates. Correct this throughout with some casts. In the case of
stapdyn, we downgrade to -Wformat=1 due to problems with
dyninst-devel.
Regenerate auto* configury on fedora rawhide, since automake was
complaining about needing "subdir-objects" in AUTOMAKE_OPTIONS.
William Cohen [Tue, 10 Feb 2015 12:36:51 +0000 (07:36 -0500)]
Make all socketcall.connect probes optional.
Both 32-bit and 64-bit arm do not implement syscall socketcall. A
number of tests were failing on those architectures because two of the
syscall socketcall return probes were not optional. Made those two
syscall socketcall variants optional like all the others.
William Cohen [Sat, 7 Feb 2015 05:42:07 +0000 (00:42 -0500)]
The 32-bit arm does not remap epoll_wait or poll syscalls
The poll test was failing because the test was expecting the 32-bit
arm processor to remap the epoll_wait syscall to epoll_pwait and to
remap the poll syscall to ppoll. Only the arm64 is remapping those
syscalls.
William Cohen [Sat, 7 Feb 2015 04:15:17 +0000 (23:15 -0500)]
Do not expect that alarm(-1) to work for the syscall alarm.c test
Setting a alarm for a time in the past (alarm(-1)) doesn't make much
sense. Some kernels allow this and do not flag an error. Others such
as the Fedora 20 32-bit ARM kernel return -EINVAL. Allow the
syscall alarm test to pass with kernels that do return an error.
Abegail Jakop [Thu, 5 Feb 2015 21:30:27 +0000 (16:30 -0500)]
PR12276: example usages of symfileline() to profile
EXAMPLE/profiling/periodic.stp: for the case of printing out symdata for a
kernel address, if file:line information is available, then print out the
symbol@file:line information.
EXAMPLE/profiling/fileline-profile.*: use symfileline() and symname(),
or symdata if file:line info is not available, to print out information
on the top 20 addresses sampled from when the stap script was running.
Abegail Jakop [Mon, 2 Feb 2015 23:05:47 +0000 (18:05 -0500)]
PR12276: check all sequences in _stp_linenumber_lookup
runtime/sym.c: addresses can only increase within a sqeunce, but at the
start of the new sequence, the starting address can be lower than the
previous'. _stp_linenumber_lookup() was changed to iterate through all
sequences until a suitable address is found, instead of giving up when
the line data address passes the desired address.
Abegail Jakop [Tue, 27 Jan 2015 18:51:23 +0000 (13:51 -0500)]
PR12276: symfile[line]() return path and filename
sym.c: changed the filename gathering portion from _stp_linenumber_lookup()
to collect the directory information and include that with the returned
filename. moved the filename gathering portion to its own function,
_stp_filename_lookup()
Abegail Jakop [Wed, 14 Jan 2015 17:22:24 +0000 (12:22 -0500)]
PR12276: fix inital line data check to check all units
translate.cxx: encase the majority of dump_line_tables_check() in a while
loop to check all of the units/line number programs instead of only
the first unit/line number program
Abegail Jakop [Wed, 31 Dec 2014 15:22:11 +0000 (10:22 -0500)]
PR12276: tests for symfileline and related
[u]context-symbols-embedded.stp: check that [u]symfileline() and
the related tapset functions build without issues
usymfileline.*: tests usymfileline(), usymfile(), and usymline() with
and without debug_line info
symfileline.*: tests symfileline(), symfile() and symline() with
an valid address from the kernel module set up in context.exp
context.exp: add symfileline to list of tests to be run
Abegail Jakop [Mon, 22 Dec 2014 21:58:44 +0000 (16:58 -0500)]
PR12276: add functions [u]symfile and [u]symline
runtime/sym.c: in _stp_snprint_addr(), add in the ability to return
the linenumber or the filename.
tapset/linux/[u]context-symbols.stp: added functions [u]symline and
[u]symfile. fixed spelling mistake with pragma:myproc-unprivileged
Abegail Jakop [Mon, 22 Dec 2014 20:04:34 +0000 (15:04 -0500)]
PR12276: fix addr adjustment for symfileline()
runtime/sym*: adjust the given address to account for the load offset
runtime/transport/symbols.c: include the body of _stp_module_update_self()
if STP_NEED_LINE_DATA so that the sec_load_offset can be updated
tapset/linux/context-symbols.stp: remove the pragma myproc-unpriveleged
since it's spelled wrong, and it's not needed anyways
translate.cxx: add funtion find_debug_frame_offset() to set the
sec_load_offset for the ".text" section
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
Abegail Jakop [Thu, 5 Feb 2015 21:30:27 +0000 (16:30 -0500)]
PR12276: example usages of symfileline() to profile
EXAMPLE/profiling/periodic.stp: for the case of printing out symdata for a
kernel address, if file:line information is available, then print out the
symbol@file:line information.
EXAMPLE/profiling/fileline-profile.*: use symfileline() and symname(),
or symdata if file:line info is not available, to print out information
on the top 20 addresses sampled from when the stap script was running.
Abegail Jakop [Mon, 2 Feb 2015 23:05:47 +0000 (18:05 -0500)]
PR12276: check all sequences in _stp_linenumber_lookup
runtime/sym.c: addresses can only increase within a sqeunce, but at the
start of the new sequence, the starting address can be lower than the
previous'. _stp_linenumber_lookup() was changed to iterate through all
sequences until a suitable address is found, instead of giving up when
the line data address passes the desired address.
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.