]> sourceware.org Git - systemtap.git/log
systemtap.git
10 years agoPR16716: Fix types in syscall.sched_{getscheduler,setscheduler,rr_get_interval}
David Smith [Wed, 9 Apr 2014 17:00:05 +0000 (12:00 -0500)]
PR16716: Fix types in syscall.sched_{getscheduler,setscheduler,rr_get_interval}

* tapset/linux/syscalls2.stp (syscall.sched_getscheduler): Fixed types.
  (syscall.sched_setscheduler): Ditto.
  (syscall.sched_rr_get_interval): Fixed nesting and types. Also change
  'argstr' to just have a pointer to the 'struct timespec' value, since
  that is an output parameter and decoding it on input won't produce
  anything of value.
* tapset/linux/nd_syscalls2.stp: Ditto.
* tapset/linux/aux_syscalls.stp (_sched_policy_str): Updated to handle new
  values, including the new SCHED_RESET_ON_FORK flag.
* testsuite/systemtap.syscall/test.tcl (run_one_test): Since execname()
  only returns the first 15 characters of the test program name, truncate
  it.
* testsuite/systemtap.syscall/sched_getscheduler.c: New testcase
* testsuite/systemtap.syscall/sched_rr_get_interval.c: Ditto.
* testsuite/systemtap.syscall/sched_setscheduler.c: Ditto.

10 years agoBetter cleanup in testsuite/systemtap.base/callee.exp.
David Smith [Wed, 9 Apr 2014 16:35:06 +0000 (11:35 -0500)]
Better cleanup in testsuite/systemtap.base/callee.exp.

10 years agopublican docs: make buildable on f19 w/ fop
Frank Ch. Eigler [Wed, 9 Apr 2014 15:16:52 +0000 (11:16 -0400)]
publican docs: make buildable on f19 w/ fop

Some funky errors occur on some fedora installations featuring perhaps
only partial publican setup, or some other mysterious causes.  Add
some xml tags to hit the default ="common" case, and add a Makefile
conditional to have publican force --pdftool=fop rather than
wkhtmltopdf, which fails in entertaining ways sometimes.

10 years agoPR16716 partial fix: Better types in 'syscall.madvise'.
David Smith [Mon, 7 Apr 2014 16:44:16 +0000 (11:44 -0500)]
PR16716 partial fix: Better types in 'syscall.madvise'.

* tapset/linux/syscalls.stp (syscall.madvise): Fixed types.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/aux_syscalls.stp (_madvice_advice_str): Update.
* testsuite/systemtap.syscall/madvise.c: New testcase.
* testsuite/systemtap.syscall/sendfile.c: Update "COVERAGE" comment.

10 years agoBZ1084692: adapt to kernel droppage of CPUFREQ_RESUMECHANGE
Frank Ch. Eigler [Sat, 5 Apr 2014 16:19:19 +0000 (12:19 -0400)]
BZ1084692: adapt to kernel droppage of CPUFREQ_RESUMECHANGE

Just #ifdef the bad boy.

10 years agotestsuite: tighten the verbosity of at_var_void_stmt
Josh Stone [Fri, 4 Apr 2014 22:04:48 +0000 (15:04 -0700)]
testsuite: tighten the verbosity of at_var_void_stmt

This test is only looking for specific "Eliding..." messages, so it
doesn't really need everything to be verbose, just pass-2.

10 years agotestsuite: perf counter test improvements
Josh Stone [Fri, 4 Apr 2014 21:14:41 +0000 (14:14 -0700)]
testsuite: perf counter test improvements

- Use anchored -re patterns for more precise matching.
- Remove unused counter_a/b that caused unmatched warnings.
- Allow "max towers" to be one digit less.

10 years agoparse: note "@perf" as a built-in
Josh Stone [Thu, 3 Apr 2014 00:32:05 +0000 (17:32 -0700)]
parse: note "@perf" as a built-in

- Add "@perf" to lexer::atwords for macro-conflict warnings.
- Don't bother with any --compatible check.

10 years agoAUTHORS update
Frank Ch. Eigler [Fri, 4 Apr 2014 19:43:21 +0000 (15:43 -0400)]
AUTHORS update

10 years agonew sample: 2048 game
NeoCat [Fri, 4 Apr 2014 19:32:35 +0000 (15:32 -0400)]
new sample: 2048 game

Kindly donated from its original home at:
https://gist.github.com/NeoCat/9947862

10 years agoPR16307: testsuite: use new kill proc
Jonathan Lebon [Wed, 2 Apr 2014 20:24:08 +0000 (16:24 -0400)]
PR16307: testsuite: use new kill proc

Replace 'exec kill' by a call to the new kill proc, which accounts for
double-dashing as necessary. Where it makes sense, the timeout argument
was also used so that a SIGKILL was also sent after a few seconds.

10 years agoPR16307: proc kill: new proc for safer killing
Jonathan Lebon [Wed, 2 Apr 2014 16:31:36 +0000 (12:31 -0400)]
PR16307: proc kill: new proc for safer killing

During setup, check what kind of kill executable we're dealing with to
find out whether we'll need to use double dashes when calling it. We
also create a new kill proc that takes this into account when calling
kill.

10 years agoPR16716 partial fix: Better types in 'syscall.shutdown'.
David Smith [Thu, 3 Apr 2014 20:08:56 +0000 (15:08 -0500)]
PR16716 partial fix: Better types in 'syscall.shutdown'.

* tapset/linux/syscalls2.stp: Fix types in syscall.shutdown.
* tapset/linux/aux_syscalls.stp: Convert _shutdown_how_str() to use
  _stp_lookup_str().
* runtime/linux/compat_net.h: Define SHUT_* for RHEL5.
* testsuite/systemtap.syscall/shutdown.c: New testcase.

10 years agoPR16716 partial fix: Better types in 'syscall.{accept,accept4}'.
David Smith [Thu, 3 Apr 2014 18:58:00 +0000 (13:58 -0500)]
PR16716 partial fix: Better types in 'syscall.{accept,accept4}'.

* tapset/linux/syscalls.stp (syscall.accept): Split into 'syscall.accept'
  and 'syscall.accept4'. Fix types and nesting. Deprecate 'flags' and
  'flags_str'
  (syscall.accept4): New probe alias.
* tapset/linux/nd_syscalls.stp: Ditto.
* runtime/linux/compat_unistd.h: Add __NR_accept and __NR_accept4 defines.
* testsuite/systemtap.syscall/accept.c: New testcase.
* testsuite/systemtap.syscall/accept4.c: Ditto.
* testsuite/buildok/syscalls-detailed.stp: Updated with accept/accept4
  changes.
* testsuite/buildok/nd_syscalls-detailed.stp: Ditto.
* NEWS: Mention variable deprecations.
* testsuite/systemtap.syscall/net1.c: Minor update.
* testsuite/systemtap.syscall/sendmmsg.c: Check for SYS_SENDMSG.

10 years agoMake _sock_type_str() and _sock_flags_str() handle undefined values properly.
David Smith [Thu, 3 Apr 2014 16:28:26 +0000 (11:28 -0500)]
Make _sock_type_str() and _sock_flags_str() handle undefined values properly.

* tapset/linux/aux_syscalls.stp: Update _sock_type_str() and
  _sock_flags_str() to handle undefined values properly.
* testsuite/systemtap.syscall/socket.c: Update expected output.
* testsuite/systemtap.syscall/socketpair.c: Ditto.

10 years agoMake vm.pagefault and vm.pagefault.return probe only one real function
William Cohen [Wed, 2 Apr 2014 20:16:21 +0000 (16:16 -0400)]
Make vm.pagefault and vm.pagefault.return probe only one real function

Newer versions of the kernel have both __handle_mm_fault and
handle_mm_fault functions.  The __handle_mm_fault may be inlined for
some kernel causing some arguments and the return probe to be
unavailable.  The memory tapset should just watch one of these
functions to instrument.

10 years agoload/stress generation for examples: followup
Frank Ch. Eigler [Wed, 2 Apr 2014 18:36:28 +0000 (14:36 -0400)]
load/stress generation for examples: followup

Changed all remaining "sleep 0.2" test cases to "sleep 1", so that the
check.exp mapping to "/usr/bin/stress ...." is triggered.  Further,
made the stress a little more stressy with more i/o workload.

10 years agoAdjust the output of sched_switch.stp to be more readable
William Cohen [Wed, 2 Apr 2014 19:50:23 +0000 (15:50 -0400)]
Adjust the output of sched_switch.stp to be more readable

Several numerical values were printed as one string of digits.  Placed
spaces between the numbers and adjusted to formatting so that the output
is easier to read.

10 years agoPR16716 partial fix: Better types in 'syscall.{sendmsg,sendmmsg}'.
David Smith [Wed, 2 Apr 2014 19:22:55 +0000 (14:22 -0500)]
PR16716 partial fix: Better types in 'syscall.{sendmsg,sendmmsg}'.

* tapset/linux/syscalls2.stp: Fixed types and nesting in
  'syscall.{sendmsg,sendmmsg}.
* tapset/linux/nd_syscalls2.stp: Ditto.
* tapset/linux/syscalls.stpm: Added __compat_syscall() macro.
* tapset/linux/aux_syscalls.stp: Includes compat_net.h.
* runtime/linux/compat_net.h: New file.
* runtime/linux/compat_unistd.h: Added defines.
* testsuite/systemtap.syscall/sendmmsg.c: New test.
* testsuite/systemtap.syscall/sendmsg.c: Ditto.

10 years agotestsuite: recvmsg.c don't use unitialized bytes.
Mark Wielaard [Wed, 2 Apr 2014 13:01:43 +0000 (15:01 +0200)]
testsuite: recvmsg.c don't use unitialized bytes.

valgrind flags the buffer as containing random bytes when the read call
fails.

10 years agoproc stap_run_error: also use -KILL in case -INT fails
Jonathan Lebon [Tue, 1 Apr 2014 21:18:52 +0000 (17:18 -0400)]
proc stap_run_error: also use -KILL in case -INT fails

Just like the previous commit, but for stap_run_error.

It can happen that a stap session started with stap_run_error ignores
-INT, in which case we need to be a little meaner and use -KILL.

10 years agoproc stap_run: also use -KILL in case -INT fails
Jonathan Lebon [Tue, 1 Apr 2014 20:48:03 +0000 (16:48 -0400)]
proc stap_run: also use -KILL in case -INT fails

It can happen that a stap session started with stap_run ignores -INT, in
which case we need to be a little meaner and use -KILL.

10 years agolisting_mode.exp: new testcase for -l/-L
Jonathan Lebon [Tue, 1 Apr 2014 19:35:43 +0000 (15:35 -0400)]
listing_mode.exp: new testcase for -l/-L

The -l and -L switches of stap are extensively used throughout the
testsuite. However, there were no testcases explicitly testing them.

10 years agodump_probe_aliases.exp: new testcase for --dump-probe-aliases
Jonathan Lebon [Tue, 1 Apr 2014 15:41:39 +0000 (11:41 -0400)]
dump_probe_aliases.exp: new testcase for --dump-probe-aliases

10 years agostap: unite all dumping modes into s.dump_mode
Jonathan Lebon [Mon, 31 Mar 2014 20:11:27 +0000 (16:11 -0400)]
stap: unite all dumping modes into s.dump_mode

Clean up the way dumping modes are implement. We create a new enum
member which tracks the type of dumping wanted. This enum handles all
stap invocations which do not directly handle a user-script:
-l/-L/--dump-probe-types/--dump-probe-aliases/--dump-functions. It also
allows us to clean up the cmdline_script/have_script hacks previously
used in switch handling.

The trickiest part about this patch is to now allow for the possibility
of s.user_file to be NULL throughout passes 1 and 2, which previously
always assumed a script was present.

10 years agoNEWS: add blurb about new dump switches
Jonathan Lebon [Mon, 31 Mar 2014 21:15:16 +0000 (17:15 -0400)]
NEWS: add blurb about new dump switches

10 years agostap: add --dump-probe-aliases
Jonathan Lebon [Fri, 28 Mar 2014 22:02:20 +0000 (18:02 -0400)]
stap: add --dump-probe-aliases

We add a new --dump-probe-aliases switch, which dumps all the aliases
picked up in library files after pass 1 and then exits. Aliases whose
names don't start with '_' are hidden behind a -v.

Also change probe_alias::printsig() so that epilogue-style aliases are
printed properly.

10 years agoMake _struct_sockaddr_u_impl() tapset function output more consistent.
David Smith [Tue, 1 Apr 2014 19:01:16 +0000 (14:01 -0500)]
Make _struct_sockaddr_u_impl() tapset function output more consistent.

* tapset/linux/aux_syscalls.stp (_struct_sockaddr_u_impl): Make output
  more consistent. When _struct_sockaddr_u_impl() succeeds, it returns
  '{INFO}'. When it failed, it returned '[...]'. Now when it fails it
  returns '{...}'.
* testsuite/systemtap.syscall/bind.c: Updated expected test output.
* testsuite/systemtap.syscall/connect.c: Updated expected test output.
* testsuite/systemtap.syscall/sendto.c: Updated expected test output.

10 years agoPR16716 partial fix: Better types in 'syscall.{send,sendto}'.
David Smith [Tue, 1 Apr 2014 18:30:06 +0000 (13:30 -0500)]
PR16716 partial fix: Better types in 'syscall.{send,sendto}'.

* tapset/linux/syscalls2.stp: Fixed types and nesting in
  'syscall.{send,sendto}'. Fixed a few more types in
  'syscall.{recv,recvfrom}'.
* tapset/linux/nd_syscalls2.stp: Ditto.
* runtime/linux/compat_unistd.h: Added __NR_sendto.
* tapset/linux/aux_syscalls.stp: Be sure we have the SYS_* defines by
  including '<linux/net.h>'.
* testsuite/systemtap.syscall/send.c: New testcase.
* testsuite/systemtap.syscall/sendto.c: New testcase.
* testsuite/systemtap.syscall/recv.c: Added more testing of the 'flags'
  parameter.
* testsuite/systemtap.syscall/recvfrom.c: Ditto.
* testsuite/systemtap.syscall/recvmmsg.c: Ditto.
* testsuite/systemtap.syscall/recvmsg.c: Ditto.

10 years agoUse FD_SETSIZE for select() in other syscall tests.
David Smith [Tue, 1 Apr 2014 13:54:52 +0000 (08:54 -0500)]
Use FD_SETSIZE for select() in other syscall tests.

* testsuite/systemtap.syscall/connect.c: Use FD_SETSIZE for select()
  parameter.
* testsuite/systemtap.syscall/recv.c: Ditto.
* testsuite/systemtap.syscall/recvfrom.c: Ditto.

10 years agoruntime: Use INIT_WORK_ONSTACK for perf
Josh Stone [Tue, 1 Apr 2014 00:33:36 +0000 (17:33 -0700)]
runtime: Use INIT_WORK_ONSTACK for perf

This only appears to matter for debug kernels, but rawhide is such.

10 years agoPR16665: Tweak buildok/task_rlimit_test.stp
Josh Stone [Mon, 31 Mar 2014 21:54:03 +0000 (14:54 -0700)]
PR16665: Tweak buildok/task_rlimit_test.stp

- Add "#! stap -p4" for direct execution.
- Expect its failure in buildok-dyninst.exp, since it's kernel only.

10 years agosyscall recv*msg tests: use FD_SETSIZE for select(2) parameter 1
Frank Ch. Eigler [Mon, 31 Mar 2014 20:33:41 +0000 (16:33 -0400)]
syscall recv*msg tests: use FD_SETSIZE for select(2) parameter 1

10 years agoFix recvmmsg() testcase for kernels < 2.6.34.
David Smith [Mon, 31 Mar 2014 19:09:54 +0000 (14:09 -0500)]
Fix recvmmsg() testcase for kernels < 2.6.34.

* testsuite/systemtap.syscall/recvmmsg.c: Change MSG_WAITFORONE flag to
  MSG_DONTWAIT, since MSG_WAITFORONE is only supported since linux
  2.6.34.

10 years agoMake recvmmsg() testcase more robust.
David Smith [Mon, 31 Mar 2014 18:50:58 +0000 (13:50 -0500)]
Make recvmmsg() testcase more robust.

* testsuite/systemtap.syscall/recvmmsg.c: Make testcase more robust. It no
  longer waits forever for recvmmsg.c to receive a message.

10 years agoPR16766 cont'd: tolerate STAP_SESSION_ERROR in module_refresh callback
Frank Ch. Eigler [Sun, 30 Mar 2014 12:17:23 +0000 (08:17 -0400)]
PR16766 cont'd: tolerate STAP_SESSION_ERROR in module_refresh callback

If a systemtap module is in error state (but not yet shut down via
message from stapio/staprun), it may harmlessly continue receiving
and processing module-notification callbacks.

10 years agostap.1: document possible issues with --use-server --dump-functions
Jonathan Lebon [Fri, 28 Mar 2014 20:56:58 +0000 (16:56 -0400)]
stap.1: document possible issues with --use-server --dump-functions

10 years agomain(): print e.what() for exceptions
Jonathan Lebon [Fri, 28 Mar 2014 20:10:22 +0000 (16:10 -0400)]
main(): print e.what() for exceptions

Instead of catching just runtime_errors in the outermost handler, use
exception to catch all ranges of printable exceptions.

10 years agoruntime: improve the preempt_enable_no_resched copy
Josh Stone [Fri, 28 Mar 2014 20:53:15 +0000 (13:53 -0700)]
runtime: improve the preempt_enable_no_resched copy

The variant introduced in commit 651a87924c22 only handled the
CONFIG_PREEMPT_COUNT side of things, which causes mayhem when that's not
set, as with kernel-3.14.0-0.rc8.git0.1.fc21.x86_64.  The #else case just
needs a barrier().  The former "TODO rethink" still stands.

10 years agoPR16766 cont'd: unbreak --runtime=dyninst
Frank Ch. Eigler [Fri, 28 Mar 2014 19:24:19 +0000 (15:24 -0400)]
PR16766 cont'd: unbreak --runtime=dyninst

* translate.cxx: While emitting systemtap_module_refresh(), protect
  the printk diagnostics with #if defined(__KERNEL__).

10 years agoPR16716 partial fix: Fix 'syscall.{recv,recvfrom}' on 32-bit platforms.
David Smith [Fri, 28 Mar 2014 19:10:01 +0000 (14:10 -0500)]
PR16716 partial fix: Fix 'syscall.{recv,recvfrom}' on 32-bit platforms.

* tapset/uconversions.stp (user_ulong): New function.
  (user_ulong_warn): Ditto.
* tapset/linux/syscalls2.stp: Change all calls to user_uint64() to
  user_ulong(), so that 32-bit platforms are handled correctly.
* tapset/linux/nd_syscalls2.stp: Ditto. Also added asmlinkage() calls to
  'nd_syscall.{recv,recvfrom}'.
* testsuite/buildok/conversions-embedded.stp: Added build tests for
  user_ulong() and user_ulong_warn().
* testsuite/buildok/conversions.stp: Ditto.

10 years agoPR16665: fix generated doc directory
Frank Ch. Eigler [Fri, 28 Mar 2014 16:16:30 +0000 (12:16 -0400)]
PR16665: fix generated doc directory

10 years agoPR16665: new tapset for task resource limit queries + demo script
Robin Hack [Fri, 28 Mar 2014 15:52:10 +0000 (11:52 -0400)]
PR16665: new tapset for task resource limit queries + demo script

* tapset/linux/rlimit.stp, task.stp: New function task_rlimit() and
  assistants.
* testsuite/systemtap.examples/process/rlimit_nofile.*: New sample.

10 years agoRemove outdated comments from nd_syscalls.stp and nd_syscalls2.stp.
David Smith [Fri, 28 Mar 2014 15:49:04 +0000 (10:49 -0500)]
Remove outdated comments from nd_syscalls.stp and nd_syscalls2.stp.

* tapset/linux/nd_syscalls.stp: No actual code change. Remove old comments
  showing the syscall variant of the probe. These comments have gotten out
  of date, and it isn't that hard to lookup the syscall variant of the
  probe. In addition, having these comments present prevents easily
  looking for actual '$var' references that shouldn't be there.
* tapset/linux/nd_syscalls2.stp: Ditto.

10 years agoPR16716 partial fix: Better types in 'syscall.{recvmsg,recvmmsg}'
David Smith [Fri, 28 Mar 2014 15:17:24 +0000 (10:17 -0500)]
PR16716 partial fix: Better types in 'syscall.{recvmsg,recvmmsg}'

* tapset/linux/syscalls2.stp: Fix types and nesting in
  'syscall.{recvmsg,compat_sys_recvmsg,recvmmsg,compat_recvmmsg}'.
* tapset/linux/nd_syscalls2.stp: Ditto.
* testsuite/systemtap.syscall/recvmmsg.c: New test.
* testsuite/systemtap.syscall/recvmsg.c: Ditto.
* testsuite/systemtap.syscall/connect.c: Updated.
* testsuite/systemtap.syscall/recv.c: Ditto.
* testsuite/systemtap.syscall/recvfrom.c: Ditto.

10 years agosystemtap.spec: ppc64le buildability
Brent Baude [Fri, 28 Mar 2014 14:37:23 +0000 (10:37 -0400)]
systemtap.spec: ppc64le buildability

10 years agoPR16766: kernel crash for failed-init module-notification
Frank Ch. Eigler [Fri, 28 Mar 2014 01:29:04 +0000 (21:29 -0400)]
PR16766: kernel crash for failed-init module-notification

Suppress the module_notifier callback for cases of failure of the
main generated systemtap module-initialization code, which checks
build-ids, privileges, etc. etc.; we don't want any module-notifier
callbacks after an error.

* runtime/transport/transport.c: Don't call module-notifier stuff
  if initialization failed.
* translate.cxx (emit_module_refresh): Emit code to suppress callback
  payload if somehow the notifier got activated anyway.

10 years agoUpdated some expected output in several syscall tests.
David Smith [Wed, 26 Mar 2014 21:00:51 +0000 (16:00 -0500)]
Updated some expected output in several syscall tests.

* testsuite/systemtap.syscall/bind.c: Update expected test output.
* testsuite/systemtap.syscall/getitimer.c: Ditto.
* testsuite/systemtap.syscall/getrusage.c: Ditto.
* testsuite/systemtap.syscall/sendfile.c: Ditto.
* testsuite/systemtap.syscall/setitimer.c: Ditto.
* testsuite/systemtap.syscall/wait4.c: Ditto.

10 years agoPR16716 partial fix: Better types in 'syscall.{recv,recvfrom}'.
David Smith [Wed, 26 Mar 2014 20:57:13 +0000 (15:57 -0500)]
PR16716 partial fix: Better types in 'syscall.{recv,recvfrom}'.

* tapset/linux/syscalls2.stp: Fix types, nesting, and missing compat
  support in 'syscall.{recv,recvfrom}'.
* tapset/linux/nd_syscalls2.stp: Ditto.
* runtime/linux/compat_unistd.h: Add defines.
* testsuite/systemtap.syscall/recv.c: New test.
* testsuite/systemtap.syscall/recvfrom.c: Ditto.

10 years agosystemtap.8: clarify docs regarding new-kernel-pkg
Jonathan Lebon [Wed, 26 Mar 2014 18:17:02 +0000 (14:17 -0400)]
systemtap.8: clarify docs regarding new-kernel-pkg

10 years agoinitscript: skip dracut stap module by default
Jonathan Lebon [Wed, 26 Mar 2014 17:56:20 +0000 (13:56 -0400)]
initscript: skip dracut stap module by default

We previously always enabled the dracut stap module as long as there
were scripts to include. This can lead to issues since the params.conf
file may be obsolete/not in sync e.g. during a kernel update. We now
make the module an opt-in feature, and make the initscript explicit
specify its inclusion.

10 years agoinitscript: use new-kernel-pkg after dracut
Jonathan Lebon [Wed, 26 Mar 2014 15:39:11 +0000 (11:39 -0400)]
initscript: use new-kernel-pkg after dracut

With this patch, we now also call new-kernel-pkg --update after creating
the new image so that the bootloader is updated if need be (see also
BZ1051649#c9).

This patch also includes some polishing re. console log output.

10 years agoImprove _struct_sockaddr_u_impl() formatting.
David Smith [Wed, 26 Mar 2014 14:59:51 +0000 (09:59 -0500)]
Improve _struct_sockaddr_u_impl() formatting.

* tapset/linux/aux_syscalls.stp (_struct_sockaddr_u_impl): Improve unix
  socket path formatting by adding quotes around the path.

10 years agoReplace _sendflags_str() and _recvflags_str() with _msg_flags_str().
David Smith [Wed, 26 Mar 2014 14:43:23 +0000 (09:43 -0500)]
Replace _sendflags_str() and _recvflags_str() with _msg_flags_str().

* tapset/linux/aux_syscalls.stp (_msg_flags_str): New function to replace
  _sendflags_str() and _recvflags_str().
  (_sendflags_str): Deprecated and reimplemented with _msg_flags_str().
  (_recvflags_str): Ditto.
* tapset/linux/syscalls2.stp: Replace _sendflags_str() and
  _recvflags_str() with _msg_flags_str().
* tapset/linux/nd_syscalls2.stp: Ditto.
* testsuite/buildok/aux_syscalls-embedded.stp: Test _msg_flags_str().
* NEWS: Mention deprecations.

10 years agoMinor testsuite tweaks for stapdyn
Josh Stone [Wed, 26 Mar 2014 00:04:00 +0000 (17:04 -0700)]
Minor testsuite tweaks for stapdyn

- global_end: Allow for zero time (i.e. less than 1 microsecond), and
  don't double the _dyninst test suffix.

- process_by_cmd: Add an "int rc" just to give distinct IPs between
  function start and the first mark, so we don't need to worry about
  determinism of the probe order.  (stapdyn was hitting the mark first.)

- suppress-time-limit: Expect the WARNING messages too, because stapdyn
  often has them mixed with the normal script output.

10 years agoperf.exp: add a quick global (non-process) test
Josh Stone [Tue, 25 Mar 2014 22:05:59 +0000 (15:05 -0700)]
perf.exp: add a quick global (non-process) test

10 years agosocktop: Make sure *_str are always known as strings
Josh Stone [Tue, 25 Mar 2014 20:46:57 +0000 (13:46 -0700)]
socktop: Make sure *_str are always known as strings

The new removal of unreachable code meant socktop might remove its whole
filter setup, and all the related variables are left with unknown type.
They would typically be pruned away just fine, but socktop also has a
probe never with print statements to avoid autoprint.  Changing those to
log() lets stap always know they are strings.

10 years agoTighten a semok/doubleglob.stp pattern
Josh Stone [Tue, 25 Mar 2014 20:43:29 +0000 (13:43 -0700)]
Tighten a semok/doubleglob.stp pattern

With 't**es(1)', we only intended to match 'timer.jiffies(1), but we
also matched a 'tcp[...].callees(1)' on accident.  This odd instance has
some issues in variable expansion, so we should just avoid it.  Using
'ti**es(1)' gets back to the original intent of the test.

10 years agotestsuite: reorganize perf tests
Josh Stone [Tue, 25 Mar 2014 19:31:07 +0000 (12:31 -0700)]
testsuite: reorganize perf tests

- Some of the parseko tests belong in semko.  The remaining parseko
  tests should use -p1.

- Some of the perf.exp tests can be simple semko.  The remaining runtime
  tests now have their scripts in separate files.

- A new semko/perf06.stp makes sure perf.process is resolved in pass2.

10 years agoRemove code that follows unconditional control statements
Josh Stone [Tue, 25 Mar 2014 18:22:43 +0000 (11:22 -0700)]
Remove code that follows unconditional control statements

When a block contains return, next, break, or continue, any following
statements are unreachable.  Warn and remove them.

This replaces tapset-perfmon's statement_counter, which didn't know
enough to deal with blocks like '{ { } }' that arise from perf aliases.
Now it just inserts a 'next', and the later optimization passes can
figure this out in a very generic way.

10 years agoRead the perf process from -c during pass2
Josh Stone [Fri, 21 Mar 2014 18:46:03 +0000 (11:46 -0700)]
Read the perf process from -c during pass2

When a bare .process is used, it's value is inferred from -c CMD.  This
must be checked during pass2, or else a changed -c CMD will not trigger
a hash change, and an incorrect cached module will be used.

This patch also unifies the wordexp argv[0] parsing of -c CMD into a
shared systemtap_session::cmd_file().

10 years agoDon't add empty .process/counter to perf pp()
Josh Stone [Fri, 21 Mar 2014 18:44:21 +0000 (11:44 -0700)]
Don't add empty .process/counter to perf pp()

If the user didn't specify a .process or .counter, then we shouldn't add
empty values into the final probe point specification.

10 years agoPR14223: Allow perf probes for mere @stapdev mortals
Josh Stone [Fri, 21 Mar 2014 18:39:42 +0000 (11:39 -0700)]
PR14223: Allow perf probes for mere @stapdev mortals

Even though we're using the kernel interface, perf checks CAP_SYS_ADMIN,
which our mere @stapdev user may not have.  By running via a workqueue,
we'll be in an events/X kernel thread with sufficient privileges.

10 years agomove utrace14.stp to semok
Jonathan Lebon [Tue, 25 Mar 2014 20:23:46 +0000 (16:23 -0400)]
move utrace14.stp to semok

Since commit 5da0e9f, probing pid 1 is allowed.

10 years agodump_functions.exp: new testcase for --dump-functions
Jonathan Lebon [Mon, 24 Mar 2014 22:07:57 +0000 (18:07 -0400)]
dump_functions.exp: new testcase for --dump-functions

10 years agostap: add --dump-functions option
Jonathan Lebon [Fri, 21 Mar 2014 20:38:43 +0000 (16:38 -0400)]
stap: add --dump-functions option

10 years agosystemtap_session: removed unused member
Jonathan Lebon [Sat, 22 Mar 2014 04:36:35 +0000 (00:36 -0400)]
systemtap_session: removed unused member

10 years agosemantic_error: also print source of error
Jonathan Lebon [Sat, 22 Mar 2014 04:50:53 +0000 (00:50 -0400)]
semantic_error: also print source of error

When printing semantic_errors at high verbosity (-vv), it can be useful
to also know where the error came from. That information is already made
available through the errsrc member of semantic_error (initially
implemented for dup-error elimination).

We also change the ERRSRC macro to use __FILE__ rather than __FUNCTION__
to be not only more informative, but more foolproof (e.g. two errors
thrown from identically named functions at identical lines in separate
files before would have been considered equivalent by the dup-error
elimination).

The final result is e.g. something like this:

semantic error: unresolved type : identifier 'ActiveOpens' at :22:8
   thrown from: elaborate.cxx:5239
        source: global ActiveOpens
                       ^

10 years agoPR16719: tweak testcase
Jonathan Lebon [Sun, 23 Mar 2014 05:07:57 +0000 (01:07 -0400)]
PR16719: tweak testcase

10 years agotestsuite: big cleanup of sdt_misc types
Josh Stone [Sat, 22 Mar 2014 00:32:06 +0000 (17:32 -0700)]
testsuite: big cleanup of sdt_misc types

- Use a central check() function throughout, so tests and messages are
  easily uniform.  Prefix the PASS/FAIL messages with "sdt_types" so
  they are easily distinguishable from dejagnu PASS/FAIL in the log.

- Adjust most constants to test the bounds of their types.

- Add unsigned char and unsigned long long.

- Tighten the expect patterns to exactly one line at a time, and
  increment $notok for extra lines (like WARNINGs).

10 years agotestsuite: big cleanup of sdt_asm
Josh Stone [Fri, 21 Mar 2014 22:09:53 +0000 (15:09 -0700)]
testsuite: big cleanup of sdt_asm

- Use a central check() function throughout, so tests and messages are
  easily uniform.  Prefix the PASS/FAIL messages with "sdt_asm" so they
  are easily distinguishable from dejagnu PASS/FAIL in the log.

- Save and restore SP when when changing it in sdt_asm.S, and prepare
  the stack and return value at the end for a clean exit.

- Skip mark("*sp") for --runtime=dyninst, because it's not prepared to
  deal with that bad stack state.

- Tighten the expect patterns to exactly one line at a time, and
  increment $notok for extra lines (like WARNINGs).

10 years agotestsuite: prefix regex.stp PASS/FAIL messages
Josh Stone [Fri, 21 Mar 2014 19:47:39 +0000 (12:47 -0700)]
testsuite: prefix regex.stp PASS/FAIL messages

Adding a "regex " prefix on regex.stp messages makes it easier to
distinguish these from dejagnu messages in systemtap.log.

10 years agoLet synthesized end probes use foreach values again
Josh Stone [Fri, 21 Mar 2014 19:12:52 +0000 (12:12 -0700)]
Let synthesized end probes use foreach values again

When these were moved to parse_synthetic_probe, I neglected to maintain
use of the "foreach (val = ...)" syntax.  Add this back in, and update
optim_arridx.exp to expect the internal underscored names.

10 years agoPR16725: Warn if stapdyn process probes lack a target
Josh Stone [Fri, 21 Mar 2014 00:30:10 +0000 (17:30 -0700)]
PR16725: Warn if stapdyn process probes lack a target

10 years agoPR16719: add testcase to watch for regression
Jonathan Lebon [Fri, 21 Mar 2014 18:06:24 +0000 (14:06 -0400)]
PR16719: add testcase to watch for regression

This testcase should fail if stap ever goes back to leaving files open
during pass-5.

10 years agocallee probes: rename caller_match() to _caller_match()
Jonathan Lebon [Fri, 21 Mar 2014 15:06:40 +0000 (11:06 -0400)]
callee probes: rename caller_match() to _caller_match()

Add an underscore prefix to caller_match() to emphasize 'internalness'
of the function.

10 years agoPR16730 addendum, link java method probes to the user
Josh Stone [Thu, 20 Mar 2014 23:23:34 +0000 (16:23 -0700)]
PR16730 addendum, link java method probes to the user

After commit ede0102cfd22, the java method probes that were built using
parse_synthetic_probe don't look like they come from the user's script
anymore, so the listing mode skips them.  Since the mark probe is the
one containing the user's code, link its probe->base back to the user.

Also move the test in printscript a bit so verbose diagnostics are still
printed, to help with issues like this.

10 years agofind_and_build(): don't handle recursive_expansion_error
Jonathan Lebon [Thu, 20 Mar 2014 20:33:58 +0000 (16:33 -0400)]
find_and_build(): don't handle recursive_expansion_error

There's no need to catch recursive_expansion_error since
try_suffix_expansion() rethrows it as a semantic_error. If it did
rethrow it as a recursive_expansion_error (which might have been the
original intent), the errors would have been printed as:

recursive loop in alias expansion...
while resolving probe point...
no match

Rather, it is printed as follow:

while resolving probe point...
recursive loop in alias expansion...

which kills the 'no match' msg and is more in line with what we do for
other errors (i.e.  having the 'while resolving probe point' msg first).

10 years agoRHBZ1065757: don't delete objects that are in use
Jonathan Lebon [Thu, 20 Mar 2014 20:12:27 +0000 (16:12 -0400)]
RHBZ1065757: don't delete objects that are in use

Catching a semantic_error does not mean that nothing was derived. This
can occur in the case of probe aliases, where the first alias_name was
derived, but the second wasn't. In those cases, the first derived probe
uses those created objects, so corruption may result if we delete them.

We instead rely on the size of the results vector to determine if it is
safe to delete the objects.

10 years agoPR16730: Don't list auxiliary tapset probes
Josh Stone [Thu, 20 Mar 2014 21:28:54 +0000 (14:28 -0700)]
PR16730: Don't list auxiliary tapset probes

We should only list probes that can be traced back to the user's -l/-L
specification, not any auxiliary probes in the tapsets.

10 years agoBZ1073605 addendum, add _start tests
Josh Stone [Thu, 20 Mar 2014 21:24:25 +0000 (14:24 -0700)]
BZ1073605 addendum, add _start tests

These were mentioned in commit d9436f1ebe9c, but apparently forgotten.

10 years agoPR16716 partial fix: Better types in 'syscall.{listen,setsockopt}'.
David Smith [Thu, 20 Mar 2014 20:04:53 +0000 (15:04 -0500)]
PR16716 partial fix: Better types in 'syscall.{listen,setsockopt}'.

* tapset/linux/syscalls.stp (syscall.listen): Fix types.
* tapset/linux/syscalls2.stp (syscall.setsockopt): Ditto.
* tapset/linux/nd_syscalls2.stp (nd_syscall.setsockopt): Fix types.
* testsuite/systemtap.syscall/getsockopt.c: Fixed typo.
* testsuite/systemtap.syscall/listen.c: Added test.
* testsuite/systemtap.syscall/setsockopt.c: New test case.

10 years agoPR16716 partial fix: Better types in 'syscall.{getsockname,getsockopt}'.
David Smith [Thu, 20 Mar 2014 18:52:30 +0000 (13:52 -0500)]
PR16716 partial fix: Better types in 'syscall.{getsockname,getsockopt}'.

* tapset/linux/syscalls.stp: Fix types in 'syscall.getsockname' and
  'syscall.getsockopt'.
* tapset/linux/aux_syscalls.stp (_stp_lookup_str): Move to the top of the
  file so that it can be called earlier.
  (_stp_lookup_or_str): Ditto.
  (_sockopt_optname_str): Convert to use _stp_lookup_or_str(). Update list
  of values handled.
  (_sockopt_level_str): Ditto.
* testsuite/systemtap.syscall/getsockname.c: New test case.
* testsuite/systemtap.syscall/getsockopt.c: Ditto.

10 years agoRHBZ1049083, C#23: rewordings proposed by jhradile
Martin Cermak [Thu, 20 Mar 2014 07:53:24 +0000 (08:53 +0100)]
RHBZ1049083, C#23: rewordings proposed by jhradile

10 years agoPR16716 partial fix: Better types in 'syscall.{getpeername,getrusage}'.
David Smith [Wed, 19 Mar 2014 18:25:38 +0000 (13:25 -0500)]
PR16716 partial fix: Better types in 'syscall.{getpeername,getrusage}'.

* tapset/linux/syscalls.stp: Fix types in 'syscall.getpeername'. Add
  better 'compat' support to 'syscall.getrusage' and fix types.
* tapset/linux/nd_syscalls.stp: Add better 'compat' support to
  'nd_syscall.getrusage'.
* tapset/linux/aux_syscalls.stp (_rusage_who_str): Add support for
  decoding 'RUSAGE_THREAD'.
* testsuite/systemtap.syscall/getpeername.c: New test case.
* testsuite/systemtap.syscall/getrusage.c: Ditto.

10 years agocallee.exp: clean up after yourself
Jonathan Lebon [Wed, 19 Mar 2014 15:05:25 +0000 (11:05 -0400)]
callee.exp: clean up after yourself

10 years agoPR16719: disable setupdwfl caching
Jonathan Lebon [Tue, 18 Mar 2014 15:23:37 +0000 (11:23 -0400)]
PR16719: disable setupdwfl caching

This patch is mostly a revert of commit 68983551.

The 'kernel_dwfl' and 'user_dwfl' references kept for caching purposes
in setupdwfl.cxx were causing the Dwfl object to never actually be
released, which in turn resulted in multiple files remaining open beyond
pass-3.

10 years agostap.1: fix typo re. default cache clean interval
Jonathan Lebon [Tue, 18 Mar 2014 22:25:21 +0000 (18:25 -0400)]
stap.1: fix typo re. default cache clean interval

10 years agoPR16716 partial fix: Better types in 'syscall.{getitimer,setitimer}.
David Smith [Wed, 19 Mar 2014 15:32:51 +0000 (10:32 -0500)]
PR16716 partial fix: Better types in 'syscall.{getitimer,setitimer}.

* tapset/linux/syscalls.stp: Fix argument types in 'syscall.getitimer' and
  'syscall.compat_getitimer'.
* tapset/linux/syscalls2.stp: Fix argument types in 'syscall.setitimer' and
  'syscall.compat_setitimer'.
* testsuite/systemtap.syscall/getitimer.c: New test case.
* testsuite/systemtap.syscall/setitimer.c: Ditto.

10 years agoPR16716 partial fix: Better types in 'syscall.connect'.
David Smith [Tue, 18 Mar 2014 21:23:19 +0000 (16:23 -0500)]
PR16716 partial fix: Better types in 'syscall.connect'.

* tapset/linux/syscalls.stp: Fix argument types in 'syscall.connect'.
* tapset/linux/nd_syscalls.stp: Ditto.
* testsuite/systemtap.syscall/socket.c: New test case.

10 years agoImproved last change to _struct_sockaddr_u_impl() by using clamp_t().
David Smith [Tue, 18 Mar 2014 19:58:23 +0000 (14:58 -0500)]
Improved last change to _struct_sockaddr_u_impl() by using clamp_t().

10 years agoPR16716 partial fix: Better types in 'syscall.{select,sendfile}'.
David Smith [Tue, 18 Mar 2014 19:55:13 +0000 (14:55 -0500)]
PR16716 partial fix: Better types in 'syscall.{select,sendfile}'.

* tapset/linux/syscalls2.stp: Fix argument types in 'syscall.select' and
  'syscall.sendfile'. Improve 'syscall.wait4'.
* tapset/linux/nd_syscalls2.stp: Fix 'nd_syscall.sendfile'.
* testsuite/systemtap.syscall/bind.c: Updated.
* testsuite/systemtap.syscall/select.c: Added bad argument testing.
* testsuite/systemtap.syscall/sendfile.c: Ditto.
* testsuite/systemtap.syscall/socketpair.c: Added a s390 fix.
* tapset/linux/syscalls.stpm: Added @__pointer() macro.
* runtime/linux/compat_unistd.h: Add __NR_sendfile64 define.

10 years agoFix typo in last commit.
David Smith [Tue, 18 Mar 2014 16:57:52 +0000 (11:57 -0500)]
Fix typo in last commit.

10 years agoAdded another PR16718 fix by auditing all calls to _stp_copy_from_user().
David Smith [Tue, 18 Mar 2014 14:53:23 +0000 (09:53 -0500)]
Added another PR16718 fix by auditing all calls to _stp_copy_from_user().

* tapset/linux/aux_syscalls.stp: Make sure a valid length is passed to all
  calls to _stp_copy_from_user().

10 years agoaux_syscalls: Fix STAP_ARG_len wrong check.
Robin Hack [Tue, 18 Mar 2014 14:26:47 +0000 (09:26 -0500)]
aux_syscalls: Fix STAP_ARG_len wrong check.

10 years agostap.1 man page: add more error reporting xrefs
Frank Ch. Eigler [Tue, 18 Mar 2014 14:16:00 +0000 (10:16 -0400)]
stap.1 man page: add more error reporting xrefs

10 years agostap.1 man page: xref systemtap(8)
Frank Ch. Eigler [Tue, 18 Mar 2014 13:04:18 +0000 (09:04 -0400)]
stap.1 man page: xref systemtap(8)

10 years agosymbol_table::get_from_elf use dwfl_module_getsym_info if available.
Mark Wielaard [Mon, 17 Mar 2014 21:05:33 +0000 (22:05 +0100)]
symbol_table::get_from_elf use dwfl_module_getsym_info if available.

dwfl_module_getsym does adjust the sym.st_value but doesn't try to resolve
it to a function address. dwfl_module_getsym_info leaves the st_value in
tact (no adjustment applied) and also returns the fully resolved address.
This matters for architectures that use function descriptors where we
want the actual function entry address and not just the address in the
function decriptor table (like .odp on ppc64).

10 years agoerror::pass4: clarify what 'upstream systemtap' means
Frank Ch. Eigler [Mon, 17 Mar 2014 19:31:38 +0000 (15:31 -0400)]
error::pass4: clarify what 'upstream systemtap' means

10 years agoPR16716 partial fix: Better types in 'syscall.{bind,socket,socketpair,wait4}'.
David Smith [Mon, 17 Mar 2014 17:41:44 +0000 (12:41 -0500)]
PR16716 partial fix: Better types in 'syscall.{bind,socket,socketpair,wait4}'.

* tapset/linux/syscalls.stp: Fix argument types in 'syscall.bind'.
* tapset/linux/syscalls2.stp: Fix argument types in 'syscall.socket',
  'syscall.socketpair', and 'syscall.wait4'.
* tapset/linux/nd_syscalls2.stp: Improved 'nd_syscall.wait4'.
* testsuite/systemtap.syscall/bind.c: Improved bad argument testing.
* testsuite/systemtap.syscall/socket.c: Ditto.
* testsuite/systemtap.syscall/socketpair.c: Ditto.
* testsuite/systemtap.syscall/wait4.c: New test case.

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