David Smith [Wed, 8 Apr 2015 17:01:10 +0000 (12:01 -0500)]
Fixed PR18213 by fixing getting the syscall number on arm kernels.
* runtime/syscall.h: For arm, use our own syscall_get_nr(), since the
kernel supplied one doesn't work well. Rename all uses of
syscall_get_nr() to _stp_syscall_get_nr().
* runtime/linux/task_finder.c: Rename all uses of syscall_get_nr() to
_stp_syscall_get_nr().
* runtime/linux/task_finder2.c: Ditto.
* tapset/linux/aux_syscalls.stp: Ditto.
* tapset/linux/utrace.stp: Ditto.
* stap-serverd.cxx (get_server_mok_fingerprints): Call stat() if readdir()
returns 'DT_UNKNOWN'. Certain filesystems like XFS don't implement
returning the file type.
* stap-serverd.cxx (mok_dir_valid_p): Call stat() if readdir() returns
'DT_UNKNOWN'. Certain filesystems like XFS don't implement returning the
file type.
David Smith [Wed, 1 Apr 2015 15:38:07 +0000 (10:38 -0500)]
Added several small syscall tapset/testsuite fixes.
* tapset/linux/syscalls.stp: Fixed syscall.execveat and added a fix for
arm in syscall.fadvise64.
* tapset/linux/nd_syscalls.stp: Added a fix for arm in
nd_syscall.fadvise64.
* tapset/linux/x86_64/syscalls.stp: Fixed syscall.compat_execve.
* testsuite/systemtap.syscall/getrlimit.c: Updated COVERAGE comment.
* testsuite/systemtap.syscall/syscall.exp: Minor test output
improvement.
* testsuite/systemtap.syscall/nd_syscall.exp: Ditto.
* testsuite/systemtap.syscall/uname.c: New testcase.
Lukas Berk [Mon, 30 Mar 2015 12:20:09 +0000 (08:20 -0400)]
Changed spin-rawhide git-description to match fedora package guidelines
Prerelease snapshots require a YYYYMMDDgit<hash> style release version according
to fedora package guidelines. Changing spin-rawhide to produce the same
As a tool to help diagnose suspected kernel kprobes/uprobes
problems, this script may be helpful to generate "perf probe ..."
command lines from a stap script or probe pattern.
Frank Ch. Eigler [Thu, 26 Mar 2015 20:21:06 +0000 (16:21 -0400)]
numerous small coverity fixes
A mixture of stuff noted for stap 2.7, like missing rc checks, c++ POD
member initialization, @perf() array checks. No actual bugs appear in
this batch, but it should make coverity happier in the future.
Frank Ch. Eigler [Thu, 26 Mar 2015 20:20:09 +0000 (16:20 -0400)]
testsuite: split additional_scripts.exp at installtest_p point
Some of the tests require stap -p5; segregate those at the bottom,
protected by [installtest_p], so the rest of the test still runs &
passes at "make check".
Abegail Jakop [Thu, 19 Mar 2015 15:36:15 +0000 (11:36 -0400)]
remove need for xvfb to generate beginners guide
using xvfb was for a workaround to an issue with publican mentioned
in BZ920216. since the beginners guide docs are generated using xmlto
instead of publican, no longer need the to check for xvfb
Abegail Jakop [Wed, 18 Mar 2015 13:49:00 +0000 (09:49 -0400)]
limit content in beginners guide to generic info
*.xml : remove content where the content is specific to either fedora or
rhel.
*html.xsl: include a title between the nav buttons at the top of the page
Abegail Jakop [Tue, 17 Mar 2015 16:31:02 +0000 (12:31 -0400)]
generate beginners guide with xmlto instead of publican
the beginners guide is generated when --enable-docs is specified and
xmlto is found.
configure.ac: remove publican specific variables and code chunks, since
the beginners guide docs were the last to use publican. create a new
variable to check if xmlto is available.
doc/beginners/Makefile.am: change the requirement from publican to
xmlto. replace the publican commands for generating the html and pdf
docs to xmlto commands.
systemtap.spec: remove publican requirement
Abegail Jakop [Tue, 17 Mar 2015 16:21:22 +0000 (12:21 -0400)]
add images, css and xsl files for beginners guide
*/Common_Content: contains images, css and a few xml files for
generating html and pdf files of the beginners guide using xmlto
*/xsl: contains stylesheets for generating html and pdf files of the
beginners guide using xmlto
David Smith [Fri, 20 Mar 2015 15:45:53 +0000 (10:45 -0500)]
Fix PR18143 by updating tapset/linux/target_set.stp.
* tapset/linux/target_set.stp: Since [nd_]syscall.fork got split into
the [nd_]syscall.{fork,vfork,clone} probes, update the tapset to handle
all 3 probes. Otherwise, we miss clone()/vfork() calls on systems that
don't support process.{begin,end}.
David Smith [Thu, 19 Mar 2015 21:24:33 +0000 (16:24 -0500)]
Adjust fix to PR18122 by displaying the number of environment variables.
* tapset/linux/aux_syscalls.stp (__count_envp): New function.
(__count_compat_envp): Ditto.
* tapset/linux/syscalls.stp: Changed execve, compat_execve, execveat, and
compat_execveat probes to use new __count_envp/__count_compat_envp
functions to display the number of environment variables (instead of
displaying the actual environment variables). Displaying the actual
environment variables can easily overflow MAXSTRINGLEN and doesn't match
what strace does.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/i386/nd_syscalls.stp: Ditto.
* tapset/linux/i386/syscalls.stp: Ditto.
* tapset/linux/ia64/nd_syscalls.stp: Ditto.
* tapset/linux/ia64/syscalls.stp: Ditto.
* tapset/linux/powerpc/nd_syscalls.stp: Ditto.
* tapset/linux/powerpc/syscalls.stp: Ditto.
* tapset/linux/s390/nd_syscalls.stp: Ditto.
* tapset/linux/s390/syscalls.stp: Ditto.
* tapset/linux/x86_64/nd_syscalls.stp: Ditto.
* tapset/linux/x86_64/syscalls.stp: Ditto.
* testsuite/buildok/aux_syscalls-embedded.stp: Added test for new functions.
* testsuite/systemtap.syscall/execve.c: Adjusted regexps for new output.
* testsuite/systemtap.syscall/execveat.c: Ditto.
David Smith [Thu, 19 Mar 2015 17:50:31 +0000 (12:50 -0500)]
Add more syscall testsuite test program fixes.
* testsuite/systemtap.syscall/accept4.c: Test on more systems.
* testsuite/systemtap.syscall/adjtimex.c: Be more forgiving with return
values.
* testsuite/systemtap.syscall/clone.c: Fix gcc 5 problems.
David Smith [Thu, 19 Mar 2015 17:20:20 +0000 (12:20 -0500)]
Fix PR18122 by fixing/updating [nd_]syscall.{execve,execveat}.
* NEWS: Mention deprecation of the 'fd' and 'fd_str' variables in the
[nd_]syscall.execveat probes.
* tapset/linux/syscalls.stp (syscall.execve): Add 'env_str' convenience
variable for the list of environment variables. For kernels < 3.7, move
execve tapset support to arch-specific tapset code so we can catch all
calls.
(syscall.compat_execve): Ditto.
(syscall.execveat): Add 'env_str' convenience variable for the list of
environment variables.
(syscall.compat_execveat): Ditto.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/aux_syscalls.stp (__get_argv): Improve formatting and
report the difference between an invalid address and a NULL.
(__get_compat_argv): Ditto.
(_adjtimex_return_str): Minor improvement.
* tapset/linux/i386/syscalls.stp: Added execve support for kernels < 3.7.
* tapset/linux/i386/nd_syscalls.stp: Ditto.
* tapset/linux/ia64/syscalls.stp: Ditto.
* tapset/linux/ia64/nd_syscalls.stp: Ditto.
* tapset/linux/powerpc/syscalls.stp: Ditto.
* tapset/linux/powerpc/nd_syscalls.stp: Ditto.
* tapset/linux/s390/syscalls.stp: Ditto.
* tapset/linux/s390/nd_syscalls.stp: Ditto.
* tapset/linux/x86_64/syscalls.stp: Ditto.
* tapset/linux/x86_64/nd_syscalls.stp: Ditto.
* testsuite/systemtap.syscall/syscall.exp: No longer use '--skip-badvars'
when compiling module.
* testsuite/systemtap.syscall/nd_syscall.exp: Ditto.
* testsuite/buildok/nd_syscalls-detailed.stp: Updated.
* testsuite/buildok/syscalls-detailed.stp: Ditto.
* testsuite/systemtap.syscall/execveat.c: Improved a bit.
* testsuite/systemtap.syscall/execve.c: New test case.
Jonathan Lebon [Sat, 14 Mar 2015 19:38:51 +0000 (15:38 -0400)]
PR18115: use begin probe to initialize conditions
We previously initialized the cond_enabled field by evaluating the
conditions during systemtap_module_init(). However, these conditions may
create tmpvars during unparsing (e.g. maps), which require a context to
operate. Therefore, we instead create a synthetic begin probe which will
serve to initialize all cond_enabled fields (or more precisely, switch
them to 0 from their default of 1 if the condition is false).
As a bonus, this allows us to re-use emit_probe_condition_update() for
both condition initialization and updating, and thus to get rid of
emit_probe_condition_initialize().
Jonathan Lebon [Mon, 16 Mar 2015 16:05:38 +0000 (12:05 -0400)]
PR18115: make c_tmpcounter visit probe conditions
Probe conditions may require tmpvars when being unparsed (e.g. maps).
These tmpvars need to be accounted by the tmpcounter so that tmpvar
declaration and usage match up.
Josh Stone [Mon, 2 Mar 2015 23:18:37 +0000 (15:18 -0800)]
tapset: tag many inline embedded-C blocks as pure
If embedded-C is not explicitly marked pure, then it is assumed to have
side effects, and can never be optimized away. In many cases, we're
simply referencing a constant value, so this is certainly pure, and
should be tagged so.
This patch doesn't bother updating instances that are in impure contexts
anyway, like the many cases of @__syscall_gate et al. which test the
constant to perhaps issue probe "next".
Josh Stone [Mon, 2 Mar 2015 21:06:06 +0000 (13:06 -0800)]
tapset/linux: Introduce and use @task macro
The @task macro performs the very common @cast to a task_struct.
The embedded-C bodies of task_current() and pid2task() are now wrapped
by @task, which gives them a debuginfo type on the return value. With
autocast type propagation, this removes the need for any explicit @cast
in many places.
Other places which take untyped task pointers as parameters, for
instance, now use @task as well to simplify their code.
Tangentially related, task_start_time() was broken for a while by the
change of real_start_time from timespec to u64, commit 57e0be041d9e2.
This is fixed and added to buildok/task_test.stp.
Abegail Jakop [Mon, 2 Mar 2015 16:13:21 +0000 (11:13 -0500)]
PR10488: add proctop.stp example script
proctop.stp: a top-like script that periodically prints out process
information such as state, mem usage and time, while keeping track of
processes that exited while the script was running.
Jonathan Lebon [Mon, 23 Feb 2015 16:10:03 +0000 (11:10 -0500)]
stmt_rel.exp and vars.exp: adapt to latest kernel
The bio.c file was moved from the fs directory to the block directory.
The two test cases stmt_rel.exp and vars.exp used functions from that
file to make some sanity checks. Update the testcases to be more
flexible.
Jonathan Lebon [Fri, 20 Feb 2015 18:24:18 +0000 (13:24 -0500)]
nearest probes: allow ENUMERATED and WILDCARD linenos
This commit reverses commit 2ff2868 which added the restriction of only
allowing .nearest probes on ABSOLUTE and RELATIVE linenos. We now allow
this for all lineno types.
WILDCARD lineno types do not need any special handling for .nearest
probes since the resulting linenos are already known to be correct. For
ENUMERATED linenos however, we now must add .nearest handling: for each
lineno enumerated, if we fail to find an address, we check if there is a
nearby lineno we can instead probe.
This commit also fixes failures in the unprivileged_myproc.exp testcase.
Related PRs: PR17906, PR17986.
Abegail Jakop [Wed, 25 Feb 2015 21:48:30 +0000 (16:48 -0500)]
PR16974: wrap if, try and for tmpvar decls in unions
translate.cxx: in c_tmpcounter::visit_block, the tmpvar declarations
in the generated c code are wrapped in a union, with each
block->statements[i] wrapped in a struct, to reduce context memory
allocation. following ::visit_block, the tmpvar declarations in
::visit_if_statement, ::visit_try_block and ::visit_for_loop are
wrapped in a union. since this causes quite a lot of nesting, comments
are added to the generated c code to indicate the source file and
line the struct/union tmpvars correspond to.
Abegail Jakop [Wed, 25 Feb 2015 21:32:17 +0000 (16:32 -0500)]
PR16974: move struct+visit outputting to new fn(s)
translate.cxx: from c_tmpcounter::visit_block(), move the portion
to wrap the statement->visit() part in a struct declaration to a
function, ::wrap_visit_in_struct()
Frank Ch. Eigler [Mon, 23 Feb 2015 18:12:00 +0000 (13:12 -0500)]
dtrace.in python3 support, testsuite parts
Prepare for fuller /usr/bin/dtrace python3-compatibility by extending
the dtrace.exp test case to run with -each- python interpreter.
Various embedded input files were also factored out into separate
files for easier diagnostics.
David Smith [Mon, 23 Feb 2015 19:04:48 +0000 (13:04 -0600)]
Add minor syscall testsuite test case tweaks.
* testsuite/systemtap.syscall/chmod.c: Avoid nesting by looking for return
values. Test old 16-bit syscall variants on all 32-bit platforms.
* testsuite/systemtap.syscall/uid16.c: Ditto.
* testsuite/systemtap.syscall/getgroups.c: Test old 16-bit syscall
variants on all 32-bit platforms.
* testsuite/systemtap.syscall/poll.c: Add 'epoll_create1' to the covered
list.
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.