David Smith [Fri, 16 Aug 2013 16:00:35 +0000 (11:00 -0500)]
Fix PR15805 by allocating map memory with vmalloc() instead of kmalloc().
* runtime/linux/map_runtime.h (_stp_map_del): Call _stp_vfree() to free
all the node memory.
(_stp_map_vzalloc): Renamed from _stp_map_kzalloc() and reworked to use
vmalloc-based allocations instead of kmalloc-based allocations.
(_stp_map_init): Allocate all the node memory in one big chunk using
vmalloc(). Change all other allocations to use vmalloc().
* runtime/map.h: Add 'node_mem' variable to 'map_root' structure
definition.
* runtime/linux/alloc.c (_stp_vzalloc): New function.
(_stp_vzalloc_node): Ditto.
For xen kernels, handle cpufreq_register_notifier() failure.
* runtime/time.c (_stp_kill_time): If cpufreq_register_notifier()
suceeded, unregister the notifier.
(_stp_init_time): On xen kernels, cpufreq_register_notifier() can
fail. Just ignore the error.
David Smith [Tue, 30 Jul 2013 18:41:49 +0000 (13:41 -0500)]
Made systemtap.server/server_locale.exp more robust.
* testsuite/systemtap.server/server_locale.exp: Updated tests for new
warning/error messages. For French tests, made them more permissive - if
we get anything in French, the test passes. This was done because we may
not have a translation of a particular message.
PR15803: netfilter: tolerate absent context when collecting $verdict
It is possible to skip from the prologue epilogue through to the
prologue for reasons such as shortage of available stack space.
In these cases, the context* c; pointer could remain NULL, which
is considered generally inappropriate to dereference.
* tapset-netfilter.cxx (epilogue): Check for NULL c before extracting
$verdict.
David Smith [Mon, 29 Jul 2013 21:59:31 +0000 (16:59 -0500)]
Made systemtap.server/client.exp more robust.
* testsuite/systemtap.server/client.exp: When this test is run right after
another server test, sometimes the server from the previous test hasn't
quite died. So, when getting the initial list of online servers, make
sure we get the same result twice. Simplify code by using new
'array_compare' procedure.
Jonathan Lebon [Fri, 26 Jul 2013 19:31:49 +0000 (15:31 -0400)]
session.cxx: make string params const
And change colorize() to take in a token pointer rather than a ref. This
is more in line with other funcs that take in a token and also ensures
that we don't have undefined behaviour if we're called with a
dereferenced NULL pointer (which coverity complained about).
David Smith [Wed, 24 Jul 2013 16:13:02 +0000 (11:13 -0500)]
Added "buildok" test improvements.
* testsuite/systemtap.pass1-4/buildok.exp: Kfail twentyeightprime.stp if
we're using inode uprobes, since absolute probes don't work there.
* testsuite/buildok/twenty.stp: Also probe 'iterate_dir', since
'vfs_readdir' has been renamed.
Jonathan Lebon [Wed, 24 Jul 2013 12:59:11 +0000 (08:59 -0400)]
PR15375: implement function suggestions
Added dwarf_builder::suggest_functions(), which builds a list of similar
functions from a given function. This is used in dwarf_builder::build()
to suggest functions to the user when the probe point could not be
derived.
Jonathan Lebon [Wed, 24 Jul 2013 12:48:47 +0000 (08:48 -0400)]
PR15375: add visited_modules to dwarf_query struct
The visited_modules member of dwarf_query is used to keep track of all
the modules which have been visited during the query. This information
will be used in the function suggestion feature to know from which
modules to pull functions.
Jonathan Lebon [Wed, 24 Jul 2013 12:42:11 +0000 (08:42 -0400)]
PR15375: add sym_seen to module_info struct
The sym_tab struct only caches non-inlined functions. The sym_seen set
includes all functions, and is also updated during update_symtab. This
will allow us to give better function suggestions.
David Smith [Tue, 23 Jul 2013 19:49:26 +0000 (14:49 -0500)]
Kfail unsupported inode uprobes tests in unprivileged_probes.exp.
* testsuite/lib/systemtap.exp (inode_uprobes_p): New function.
* testsuite/systemtap.base/uprobes_filtering.exp: Use 'inode_uprobes_p',
instead of private code, to know whether to test.
* testsuite/systemtap.unprivileged/unprivileged_probes.exp
(test_unrestricted_probes): Kfail
'process(number).statement(number).absolute*' tests if we're using inode
uprobes, since absolute probes aren't supported.
David Smith [Tue, 23 Jul 2013 17:27:20 +0000 (12:27 -0500)]
Tweak systemtap.examples/process/psig.stp to compile on RHEL6.
* testsuite/systemtap.examples/process/psig.stp (translate_mask): Tweak
function to lower stack usage. This avoids the dreaded "the frame size
of XXX bytes is larger than 256 bytes" error messages.
David Smith [Mon, 22 Jul 2013 17:55:41 +0000 (12:55 -0500)]
Fix testsuite/semok/thirtysix.stp.
* testsuite/semok/thirtysix.stp: Since not all markers in "stap" have a
'$arg' parameter, this test was failing (correctly). To fix this, only
probe the "pass*__*" markers (which all have a '$arg' parameter).
David Smith [Fri, 19 Jul 2013 17:31:23 +0000 (12:31 -0500)]
The testsuite now looks for systemtap java support before java testing.
* testsuite/lib/systemtap.exp (java_p): New function.
(setup_systemtap_environment): Test for systemtap java functionality.
* testsuite/systemtap.apps/java.exp: Mark as untested if no stap java
support.
* testsuite/systemtap.unprivileged/unprivileged_probes.exp
(test_unrestricted_probes): Mark java probe tests as untested if no stap
java support.
David Smith [Wed, 17 Jul 2013 15:55:56 +0000 (10:55 -0500)]
Fix PR15751 by adding support for new 'compat' sigaction structures.
* buildrun.cxx (compile_pass): Added 'compat_sigaction' autoconf test.
* runtime/linux/autoconf-compat_sigaction.c: New file.
* tapset/linux/aux_syscalls.stp (_struct_sigaction32_u): Prefer 'struct
compat_sigaction' when available (over old 'struct sigaction32').
(_struct_old_sigaction32_u) Prefer 'struct compat_old_sigaction' when
available (over old 'struct old_sigaction32').
* testsuite/systemtap.context/usymbols.exp: Update to use
'compat_sigaction' where available.
David Smith [Tue, 16 Jul 2013 14:57:11 +0000 (09:57 -0500)]
Improve stapdyn uprobe error reporting.
* stapdyn/mutatee.cxx (mutatee::instrument_dynprobe_target): Turn off
dyninst error messages and add our own if we can't find the uprobe entry
functions.
David Smith [Fri, 12 Jul 2013 19:37:17 +0000 (14:37 -0500)]
PR15731: Fix 'syscall.{execve,compat_execve}' on newer kernels.
* tapset/linux/syscalls.stp (syscall.execve): Use 'sys_execve', since
'do_execve' can be inlined.
(syscall.compat_execve): Prefer 'compat_sys_execve', which can't be
inlined.
* tapset/linux/nd_syscalls.stp: Matching changes from syscalls.stp for
'nd_syscall.execve' and 'nd_syscall.compat_execve'.
* testsuite/buildok/twentyseven.stp: Updated for change to
'syscall.execve'.
* testsuite/systemtap.base/pointer_array.stp: Ditto.
* testsuite/systemtap.base/execve.exp: New 'syscall.execve' test.
* testsuite/systemtap.base/execve.stp: Ditto.
David Smith [Thu, 11 Jul 2013 19:17:20 +0000 (14:17 -0500)]
Improve perf probe warnings and testcase.
* runtime/linux/perf.c (_stp_perf_init): Print a better warning for
unsupported perf probe types.
* testsuite/systemtap.base/perf.exp: Change perf hw probes to sw probes,
which are more widely available.
Lukas Berk [Wed, 10 Jul 2013 20:52:57 +0000 (16:52 -0400)]
Enable 32-bit unwinding on 64bit
runtime/unwind.c: Add compat_task flag and enable COMPAT_REG_MAP
when active
runtime/unwind/unwind.h: Add COMPAT_REG_MAP 1 to 1 mapping in case x86_64.h
isn't defined
runtime/unwind/x86_64.h: COMPAT_REG_MAP mapping from 32 DWARF register values
to 64 bit register values
testsuite/systemtap.exelib/exelib.exp: enable -m32 flags on x86_64
translate.cxx: Remove warning and check for 32bit unwinding on 64bit
David Smith [Tue, 9 Jul 2013 21:16:18 +0000 (16:16 -0500)]
Improve buildok-dyninst.exp test results a bit.
* testsuite/systemtap.pass1-4/buildok-dyninst.exp: Add kfail for
buildok/fortyseven.stp.
* testsuite/buildok/gtod_init.stp: Only look for 'STAP_NEED_GETTIMEOFDAY'
when using the kernel runtime.
* testsuite/buildok/gtod_noinit.stp: Ditto.
Jonathan Lebon [Tue, 9 Jul 2013 19:11:23 +0000 (15:11 -0400)]
PR14927: change error messages from using warn/x() to staperror()
There are two main reasons for this:
1. Using staperror() will preface the errors with an "ERROR:" string,
which may be colored, depending on the coloring mode.
2. The use of warn() and family are not recommended as they are provided
only for compatibility with BSD.
When printing source context for an error, we don't really know how
many characters from the source to highlight for any given token, as
that only stores the starting column position.
The tok->content.size() is a guide, but not a perfect one, as for some
(tok_string, tok_embedded, ...), the content is processed from the
source characters (with quotation signs removed, etc.), for others,
the tok->content() can be many lines long. That's a problem because
if we try to source_line.substr(..., long_multiline_token.length()...),
we'll get a SEGV.
So we colorize only those tokens whose type is known to be simple and
literal transcriptions of the source file, starting at
column=tok->column.
Jonathan Lebon [Tue, 9 Jul 2013 13:50:48 +0000 (09:50 -0400)]
PR14927: make more warnings from staprun/stapdyn sensitive to -w
Before, even with the -w option specified for staprun, some warnings
(such as when the child process exits with a nonzero code) were still
output. Now, all warnings are affected by -w.
A similar operation was carried out in stapdyn, where the use of warnx()
was changed to stapwarn() so that -w now silences them. This changes
also gives those warnings the chance to be colored if necessary.
Jonathan Lebon [Tue, 9 Jul 2013 14:05:50 +0000 (10:05 -0400)]
PR14927: fix inheritance of color mode to staprun and stapdyn from stap
Added the -C switch in the building of the cmd for stapdyn. Also, since
the default color mode is now auto, we must check if the currently
active mode is anything other than auto before explicitly passing the -C
switch to staprun or stapdyn.