]> sourceware.org Git - systemtap.git/log
systemtap.git
10 years agoPR16443: fix typos in Beginner's Guide
Martin Cermak [Mon, 13 Jan 2014 17:06:02 +0000 (12:06 -0500)]
PR16443: fix typos in Beginner's Guide

10 years agostapvirt.1: fix sample output in tutorial
Jonathan Lebon [Mon, 23 Dec 2013 17:58:43 +0000 (12:58 -0500)]
stapvirt.1: fix sample output in tutorial

10 years agostap translator: tolerate NULLs coming from some elfutils string lookups
Frank Ch. Eigler [Sat, 11 Jan 2014 00:51:37 +0000 (19:51 -0500)]
stap translator: tolerate NULLs coming from some elfutils string lookups

It was reported on the mailing list, and privately experienced, that
stap pass-2 crashes could occur due to NULL dwarf_diename or
dwarf_decl_file's being propagated rather far within stap.  This
commit adds protections (of the form ?: "foo") to eliminate the
problem in a few spots.  There may be others; we should not store
so many raw char*'s.

10 years agosample: add some docs for new sockaddr decoding tapset
Frank Ch. Eigler [Thu, 9 Jan 2014 21:59:53 +0000 (16:59 -0500)]
sample: add some docs for new sockaddr decoding tapset

10 years agotapset: add decoded sockaddr field vars to socket-related syscalls
Robin Hack [Thu, 9 Jan 2014 21:52:55 +0000 (16:52 -0500)]
tapset: add decoded sockaddr field vars to socket-related syscalls

* tapset/linux/aux_syscalls.stp (_struct_sockaddr_u_impl): New pretty-printer
  with a bitfieldful of options.
* tapset/linux/syscalls.stpm (@_af_inet_info_u): New macro to pull call it.
* tapset/linux/*syscalls*: Lots of calls to it.
* testsuite/systemtap.examples/network/connect_stat.stp: New sample script.

10 years agodoc building: tolerate xvfb-run transient errors during publican run
Frank Ch. Eigler [Thu, 9 Jan 2014 18:32:42 +0000 (13:32 -0500)]
doc building: tolerate xvfb-run transient errors during publican run

10 years agostap.1 man page: clarify %m and %M precision parameter with an example
Frank Ch. Eigler [Thu, 9 Jan 2014 15:10:25 +0000 (10:10 -0500)]
stap.1 man page: clarify %m and %M precision parameter with an example

10 years agoMake sure that AVahi service names are valid before adding the service.
Dave Brolley [Wed, 8 Jan 2014 19:57:01 +0000 (14:57 -0500)]
Make sure that AVahi service names are valid before adding the service.

10 years agoImprove several syscall probe aliases for s390x.
David Smith [Tue, 7 Jan 2014 21:01:33 +0000 (15:01 -0600)]
Improve several syscall probe aliases for s390x.

* tapset/linux/syscalls2.stp: Improve the syscall.open,
  syscall.compat_rt_sigprocmask, syscall.compat_signalfd, and
  syscall.sigprocmask probe aliases.
* tapset/linux/syscalls.stp: Improve the syscall.lseek probe alias.
* tapset/linux/nd_syscalls2.stp: Fixed comment.

10 years agoAdd a ".local" variant to the DNS names on compile-server certificates.
Dave Brolley [Tue, 7 Jan 2014 19:16:53 +0000 (14:16 -0500)]
Add a ".local" variant to the DNS names on compile-server certificates.

This is an attempt to reduce the number of "Host name does not match
the DNS name(s) on the server certificate" warnings, particularly
when auto-discovering servers. Avahi presents the servers as
somehost.local, so having a somehost.local variant on the
server certificate prevents generating a warning for this
harmless situation.

10 years agoRework compile-server discovery.
Dave Brolley [Tue, 7 Jan 2014 19:07:02 +0000 (14:07 -0500)]
Rework compile-server discovery.

Limit unnecessary resolution of specified servers using dns
and Avahi.

- Don't dns-resolve avahi-provided host names.
- Don't query avahi when server address and port are provided directly.
- Allow unresolved host names to match an avahi-provided host name.

10 years agoDon't cast the pointer in STAP_RETVALUE:string
Josh Stone [Mon, 6 Jan 2014 19:55:13 +0000 (11:55 -0800)]
Don't cast the pointer in STAP_RETVALUE:string

If the embedded C author uses the wrong pointer type, the compiler
should rightly complain about it when passed to strlcpy.  In the rare
case a cast is truly needed, it should be manually added.

10 years ago2014 year bump for emitted copyright messages
Frank Ch. Eigler [Sat, 4 Jan 2014 19:18:47 +0000 (14:18 -0500)]
2014 year bump for emitted copyright messages

10 years agoPR10300: demonstrate use of STAP_RETURN() in tapset/string.stp functions
Frank Ch. Eigler [Fri, 3 Jan 2014 19:43:59 +0000 (14:43 -0500)]
PR10300: demonstrate use of STAP_RETURN() in tapset/string.stp functions

10 years agoPR10300: document STAP_RETURN()
Frank Ch. Eigler [Fri, 3 Jan 2014 19:03:19 +0000 (14:03 -0500)]
PR10300: document STAP_RETURN()

10 years agoPR10300: add STAP_RETURN(...) embedded-C macro
Frank Ch. Eigler [Fri, 3 Jan 2014 19:00:29 +0000 (14:00 -0500)]
PR10300: add STAP_RETURN(...) embedded-C macro

* translate.cxx (emit_function): Define a STAP_RETURN(int|string|void)
  for embedded-c functions.

10 years agoPR16207 partial fix: Fix the 'rt_signal' [nd_]syscall.exp tests on rawhide.
David Smith [Thu, 2 Jan 2014 17:58:40 +0000 (11:58 -0600)]
PR16207 partial fix: Fix the 'rt_signal' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls2.stp: Fix syscall nesting in
  'syscall.rt_sigprocmask' and 'syscall.compat_rt_sigprocmask' probes.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/aux_syscalls.stp: Added __uint32() function.
* runtime/linux/compat_unistd.h: Added '__NR_compat_rt_sigprocmask' define.

10 years agotutorial: fix poor wording in an exercise question
Frank Ch. Eigler [Fri, 27 Dec 2013 16:53:01 +0000 (11:53 -0500)]
tutorial: fix poor wording in an exercise question

Reported-By: storypku at stackoverflow
10 years agoClient/server related testsuite tweaks.
Dave Brolley [Tue, 24 Dec 2013 19:39:28 +0000 (14:39 -0500)]
Client/server related testsuite tweaks.

- in setup_server, give the server a chance to start before checking
  for it.
- The result of the test "New signing servers matches" was reversed
  in client.exp.

10 years agoadd PR context to previous csclient.cxx patch
Jonathan Lebon [Mon, 23 Dec 2013 16:18:02 +0000 (11:18 -0500)]
add PR context to previous csclient.cxx patch

10 years agoPR16207 partial fix: Fix the 'signalfd' [nd_]syscall.exp tests on rawhide.
David Smith [Mon, 23 Dec 2013 16:16:19 +0000 (10:16 -0600)]
PR16207 partial fix: Fix the 'signalfd' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls2.stp: Fix syscall nesting in 'syscall.signalfd'
  and 'syscall.compat_signalfd'.
* tapset/linux/nd_syscalls2.stp: Ditto.

10 years agocsclient.cxx: improve hostname resolution cache
Jonathan Lebon [Fri, 20 Dec 2013 15:46:52 +0000 (10:46 -0500)]
csclient.cxx: improve hostname resolution cache

Previously, the hostname resolution cache was associated with servers,
rather than addresses and hostnames. This can cause problems since
multiple servers can reside on the same host. This patch decouples
hostname cache from servers, resulting in proper handling of multiple
servers on the same host.

10 years agocsclient.cxx: ignore hostname for server equality
Jonathan Lebon [Wed, 18 Dec 2013 22:46:21 +0000 (17:46 -0500)]
csclient.cxx: ignore hostname for server equality

We previously relied on the hostname when checking whether two
compile_server_info objects referred to the same server. However, there
are situations where Avahi can report a server under a truncated
hostname which it previously reported using its FQDN.

So instead we change the strategy. We now rely on certificates to
determine whether two servers are indeed the same when one of them has a
missing IP address. The hostname is completely disregarded.

10 years agosession.cxx: respect ^C's during long verbose symbol-table listings
Frank Ch. Eigler [Fri, 20 Dec 2013 16:23:31 +0000 (11:23 -0500)]
session.cxx: respect ^C's during long verbose symbol-table listings

10 years agoerror::buildid: note -DSTP_NO_BUILDID_CHECK
Frank Ch. Eigler [Fri, 20 Dec 2013 16:23:14 +0000 (11:23 -0500)]
error::buildid: note -DSTP_NO_BUILDID_CHECK

10 years agoReduce avahi query timeout from 2 seconds to 0.5 seconds.
Dave Brolley [Fri, 20 Dec 2013 15:51:00 +0000 (10:51 -0500)]
Reduce avahi query timeout from 2 seconds to 0.5 seconds.

10 years agoAvahi usage improvements for stap-serverd.
Dave Brolley [Fri, 20 Dec 2013 15:47:03 +0000 (10:47 -0500)]
Avahi usage improvements for stap-serverd.

- Place a limit on service name collision resolution attempts.
- Use hostname(2) in service name instead of pid

10 years agoPR16207 partial fix: Fix the 'trunc' [nd_]syscall.exp tests on rawhide.
David Smith [Thu, 19 Dec 2013 19:57:37 +0000 (13:57 -0600)]
PR16207 partial fix: Fix the 'trunc' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stp: Add 'compat_sys_ftruncate" support to
  syscall.ftruncate probe.
* tapset/linux/nd_syscalls.stp: Ditto.
* tapset/linux/syscalls2.stp: Add 'compat_sys_truncate" support to
  syscall.truncate probe.
* tapset/linux/nd_syscalls2.stp: Ditto.

10 years agoPR16207 partial fix: Fix the 'mount' [nd_]syscall.exp tests on rawhide.
David Smith [Thu, 19 Dec 2013 19:55:25 +0000 (13:55 -0600)]
PR16207 partial fix: Fix the 'mount' [nd_]syscall.exp tests on rawhide.

* runtime/linux/compat_unistd.h: Added '__NR_compat_umount2' define.

10 years agoPR16207 partial fix: Fix the 'mount' [nd_]syscall.exp tests on rawhide.
David Smith [Thu, 19 Dec 2013 19:05:15 +0000 (13:05 -0600)]
PR16207 partial fix: Fix the 'mount' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls2.stp: Add 'sys_oldumount' support to the
  syscall.umount probe. Don't allow syscall nesting in syscall.umount.
* tapset/linux/nd_syscalls2.stp: Ditto.

10 years agoconfigury: followup to previous with_java check; m4 ate my "[" !
Frank Ch. Eigler [Thu, 19 Dec 2013 16:59:36 +0000 (11:59 -0500)]
configury: followup to previous with_java check; m4 ate my "[" !

10 years agoconfigury: don't use AC_CHECK_FILE for verifying java directory
Frank Ch. Eigler [Thu, 19 Dec 2013 14:37:42 +0000 (09:37 -0500)]
configury: don't use AC_CHECK_FILE for verifying java directory

It conflicts with cross-compilation.

10 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Dave Brolley [Wed, 18 Dec 2013 16:43:01 +0000 (11:43 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

Conflicts:
stapsslerr.h

10 years agoCorrect error path where NULL avahi-client service group pointer could be accessed.
Dave Brolley [Wed, 18 Dec 2013 16:39:40 +0000 (11:39 -0500)]
Correct error path where NULL avahi-client service group pointer could be accessed.

10 years agoCorrect the text for NSS error SEC_ERROR_LEGACY_DATABASE.
Dave Brolley [Wed, 18 Dec 2013 16:38:43 +0000 (11:38 -0500)]
Correct the text for NSS error SEC_ERROR_LEGACY_DATABASE.

10 years agolangref.tex: add [english] option to babel setup
Frank Ch. Eigler [Tue, 17 Dec 2013 22:34:43 +0000 (17:34 -0500)]
langref.tex: add [english] option to babel setup

Reported-By: Tony Jones <tjones@suse.de>
10 years agoPR16326: fix client.exp and simplify it
Jonathan Lebon [Fri, 13 Dec 2013 21:37:57 +0000 (16:37 -0500)]
PR16326: fix client.exp and simplify it

The client.exp testcase can now (again) work with other stap-servers
running. This patch also significantly simplifies the code by
introducing a few array utility procedures.

10 years agokernel tracepoints: bring up-to-date for 3.11
Frank Ch. Eigler [Mon, 16 Dec 2013 18:38:39 +0000 (13:38 -0500)]
kernel tracepoints: bring up-to-date for 3.11

Added a whole bunch of other hidey-spots where kernel tracepoint
DEFINE_EVENT's were plopped in recent kernels, along with a few
incomplete-definition type workarounds.

10 years agostapvirt: clarify that power cycling is required
Jonathan Lebon [Thu, 12 Dec 2013 18:47:54 +0000 (13:47 -0500)]
stapvirt: clarify that power cycling is required

Using 'restart' misleads people into thinking the guest OS just needs to
be restarted when really a full powering off of the machine is required.

10 years agostapvirt: document virtio-serial controller requirement
Jonathan Lebon [Thu, 12 Dec 2013 18:44:31 +0000 (13:44 -0500)]
stapvirt: document virtio-serial controller requirement

For a virtio-serial port to be successfully installed, the domain also
requires a virtio-serial controller. When doing 'stapvirt port-add',
this is done automatically by libvirt. However, when using hotplugging,
stapvirt will fail if no controller is installed. Note that
virtio-serial controllers cannot be hotplugged.

Documenting this issue is a first step. Efforts are under way to make
this more transparent to the user.

Also see: https://bugzilla.redhat.com/show_bug.cgi?id=1020500#c34

10 years agoSimplify sendfile.c test program for use on an NFS partition.
David Smith [Thu, 12 Dec 2013 16:47:52 +0000 (10:47 -0600)]
Simplify sendfile.c test program for use on an NFS partition.

* testsuite/systemtap.syscall/sendfile.c: Simplify testcase. Originally
  when compiled 32-bits on a 64-bit system and run on an NFS partition,
  fstat() returns an invalid size of the newly created file. This invalid
  size was verified with strace. Since we know the size of the file
  anyway, just use it directly, which avoids the NFS problem.

10 years agoFixed PR16312 by adding preadv syscall support.
David Smith [Wed, 11 Dec 2013 21:17:51 +0000 (15:17 -0600)]
Fixed PR16312 by adding preadv syscall support.

* tapset/linux/syscalls2.stp: Added preadv() probe support.
* tapset/linux/nd_syscalls2.stp: Ditto.
* testsuite/systemtap.syscall/readwrite.c: Added preadv() test.
* testsuite/buildok/nd_syscalls2-detailed.stp: Added preadv probe test.
* testsuite/buildok/syscalls2-detailed.stp: Ditto.

10 years agoImproved [nd_]syscall.lseek probe support for 32-bit on 64-bit apps.
David Smith [Wed, 11 Dec 2013 21:14:41 +0000 (15:14 -0600)]
Improved [nd_]syscall.lseek probe support for 32-bit on 64-bit apps.

* tapset/linux/syscalls.stp: Added "compat" sys_lseek() support for
  rawhide.
* tapset/linux/nd_syscalls.stp: Ditto.

10 years agoFixed PR16311 by adding/improving pwritev syscall support.
David Smith [Tue, 10 Dec 2013 23:14:51 +0000 (17:14 -0600)]
Fixed PR16311 by adding/improving pwritev syscall support.

* tapset/linux/syscalls2.stp: Improved syscall.pwritev probe support,
  fixed offset calculations.
* tapset/linux/nd_syscalls2.stp: Added 'nd_syscall.pwritev' and
  'nd_syscall.pwritev.return' probes.
* testsuite/buildok/syscalls2-detailed.stp: Added pwritev probe test.
* testsuite/buildok/nd_syscalls2-detailed.stp: Ditto.
* testsuite/systemtap.syscall/readwrite.c: Aded pwritev() test.

10 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Tue, 10 Dec 2013 18:48:13 +0000 (12:48 -0600)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

10 years agoAdded initial syscall.pwritev probe support.
Quentin Barnes [Tue, 10 Dec 2013 18:47:29 +0000 (12:47 -0600)]
Added initial syscall.pwritev probe support.

10 years agoPR16309: spawn stap-serverd with / cwd
Jonathan Lebon [Tue, 10 Dec 2013 16:38:39 +0000 (11:38 -0500)]
PR16309: spawn stap-serverd with / cwd

10 years agoproperly implement stapshd reload
Jonathan Lebon [Fri, 6 Dec 2013 19:50:44 +0000 (14:50 -0500)]
properly implement stapshd reload

We previously did not check the character device properly, which
resulted in all live sessions being killed during a reload. This was
especially an issue in the case of hotplugging under RHEL5/6, in which
udev can call reload multiple times even though only a single port was
hotplugged.

- stapshd.in: fix stapshd reload
- 99-stapsh-init.rules: add clarification comment for RHEL5

10 years agoPreserve sdt_misc test files in case of failure.
Stan Cox [Thu, 5 Dec 2013 21:54:52 +0000 (16:54 -0500)]
Preserve sdt_misc test files in case of failure.

10 years agoruntime: don't require CONFIG_KPROBES for user-space backtraces
Frank Ch. Eigler [Thu, 5 Dec 2013 16:32:24 +0000 (11:32 -0500)]
runtime: don't require CONFIG_KPROBES for user-space backtraces

* runtime/stack.c: Drop an unnecessary #ifdef CONFIG_KPROBES that
  wrapped even pure-userspace stack-unwinding-related code, and
  caused unnecessary -p4 failures.

Reported-By: calcifer_ on irc.freenode.net
10 years agoFixed PR16248 by adding user namespace support to pfiles.stp example.
David Smith [Tue, 3 Dec 2013 16:52:37 +0000 (10:52 -0600)]
Fixed PR16248 by adding user namespace support to pfiles.stp example.

* testsuite/systemtap.examples/process/pfiles.stp: Updated for kernels
  with CONFIG_USER_NS.

10 years agoUse proper set operations for symtab dupe checks
Josh Stone [Mon, 2 Dec 2013 22:34:07 +0000 (14:34 -0800)]
Use proper set operations for symtab dupe checks

In query_symtab_func_info, rather than full set iteration to check an
address in alias_dupes, just use set::insert().second as a test.  This
is what sets are designed to be algorithmically good at.

This also has the benefit of adding to alias_dupes, so duplicates within
the symbol table itself will still only be probed once.  (If we didn't
want that effect, we would just use set::count() to test membership.)

10 years agoSet git-describe --abbrev=12 for consistency and future-proofing
Josh Stone [Mon, 2 Dec 2013 22:15:30 +0000 (14:15 -0800)]
Set git-describe --abbrev=12 for consistency and future-proofing

Git's default abbrev is 7, with smarts to disambiguate the SHA1 for that
given moment.  Torvalds has recommended core.abbrev = 12 for kernel
developers to help avoid future as-yet-unknown collisions.

It becomes an issue to our scripts if this setting is not deterministic.
For instance, "make && sudo make install" will run git_version.sh with
$USER's git config, then root's config, but we don't want git_version.h
to be regenerated just for that difference.

Now our scripts use an explicit git-describe --abbrev=12 to be safe.

10 years agoclarify stap_waitpid return value
Jonathan Lebon [Mon, 2 Dec 2013 21:00:49 +0000 (16:00 -0500)]
clarify stap_waitpid return value

10 years agostap-serverd: remember exact rc from spawned stap
Jonathan Lebon [Mon, 2 Dec 2013 16:17:05 +0000 (11:17 -0500)]
stap-serverd: remember exact rc from spawned stap

Previously, stap-serverd used spawn_and_wait() to run stap and wait for
it to exit. However, the actual return code of stap was lost and never
bundled in the server response.

With this patch, spawn_and_wait() captures the child's exit rc in a
separate variable, so that we can differentiate between failure in
spawning and a nonzero exit code from the child.

So now the response/rc file holds the actual rc with which stap exited.
This makes a difference in the case of stap -l, in which we don't send a
script to the server and thus cannot rely on the presence or absence of
a compiled module in the server response to determine success.

csclient.cxx: don't print the 'via server failed' message if we're in
listing mode

10 years agostapsh.c: fix handling of POLLIN to indicate EOF
Jonathan Lebon [Sat, 30 Nov 2013 16:14:25 +0000 (11:14 -0500)]
stapsh.c: fix handling of POLLIN to indicate EOF

We previously relied on POLLHUP to indicate EOF. However, it is also
possible to receive POLLIN when EOF is reached. With this patch, upon
receiving POLLIN and reading from the associated fd, if EOF is found, we
modify the polling array to indicate we're no longer interested.

10 years agofix suggestion msg for tracepoints
Jonathan Lebon [Sat, 30 Nov 2013 15:43:05 +0000 (10:43 -0500)]
fix suggestion msg for tracepoints

10 years agoFix build error signed/unsigned comparison
Lukas Berk [Sat, 30 Nov 2013 01:36:11 +0000 (20:36 -0500)]
Fix build error signed/unsigned comparison

*buildrun.cxx - change const int severely_limited to const unsigned int

10 years agoPR16276: tolerate low --rlimit=nproc, especially in stap-server context
Frank Ch. Eigler [Fri, 29 Nov 2013 23:45:41 +0000 (18:45 -0500)]
PR16276: tolerate low --rlimit=nproc, especially in stap-server context

10 years agoRemoved (unused) consult_symtab and kernel_symtab_path session variables
Lukas Berk [Fri, 29 Nov 2013 22:03:46 +0000 (17:03 -0500)]
Removed (unused) consult_symtab and kernel_symtab_path session variables

* session.cxx - remove consult_symtab
* session.h   - remove consult_symtab and kernel_symtab_path
* tapsets.cxx - remove consult_symtab

10 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
Lukas Berk [Fri, 29 Nov 2013 21:46:05 +0000 (16:46 -0500)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

10 years agoPR10208 Support probing weak symbols
Lukas Berk [Fri, 29 Nov 2013 21:34:11 +0000 (16:34 -0500)]
PR10208 Support probing weak symbols

*tapsets.cxx - Now always query the symtab (unless there is a pending interrupt
       or dwarf callback error) on a function probe.  We need to be careful
       to check probe point's we've already resolved which will already
       have full debug information and to not place another probe there.
       We've removed the case of probing the symbol table on a statement probe,
       as that code was written specifically for the kernel without userspace
       in mind and was resolving the function the statement resided in (causing
       errors in some cases).

*list.exp    - Added testcase for weak symbols
*last_100_frees.stp   - we use @defined($mem) here because on 64 bit systems, the
        wildcard search takes us through both 64 bit and 32 bit libc
        (which doesn't have debuginfo), this means the probe point
        resolved from the 32 bit library has no context info
*mutex-contention.stp - ditto but for @defined($mutex) and @defined($rwlock)

10 years agostap-report: also report running stap processes
Frank Ch. Eigler [Fri, 29 Nov 2013 16:32:50 +0000 (11:32 -0500)]
stap-report: also report running stap processes

10 years agostapdyn: Use plain CLOCK_MONOTONIC for -t timing
Josh Stone [Tue, 26 Nov 2013 19:57:40 +0000 (11:57 -0800)]
stapdyn: Use plain CLOCK_MONOTONIC for -t timing

CLOCK_MONOTONIC_RAW has immunity to adjtime and NTP, but CLOCK_MONOTONIC
is often implemented in vdso.  For simple timing, it's worth trading a
little accuracy for lower overhead.

10 years agostapdyn: Batch _stp_strncpy_from_user reads
Josh Stone [Tue, 26 Nov 2013 18:40:48 +0000 (10:40 -0800)]
stapdyn: Batch _stp_strncpy_from_user reads

In order to reduce the number of syscalls required, this strncpy now
opportunistically reads larger blocks before checking for '\0'.  Reads
are kept within page boundaries to avoid running into invalid memory.

10 years agoloadavg tapset: add to generated docs, tweak docs wording
Frank Ch. Eigler [Tue, 26 Nov 2013 17:47:44 +0000 (12:47 -0500)]
loadavg tapset: add to generated docs, tweak docs wording

10 years agoAdd loadavg tapset
Aaron Tomlin [Tue, 26 Nov 2013 17:00:40 +0000 (17:00 +0000)]
Add loadavg tapset

Provide a tapset to obtain the load average.

Sample usage via a timer probe:

probe timer.s(1) {
printf("%s: Load average: %s",
ctime(gettimeofday_s()),
sprint_loadavg())
}

$ sudo stap ./show_loadavg.stp
Tue Nov 26 16:54:04 2013: Load average: 0.12 0.33 0.30
Tue Nov 26 16:54:05 2013: Load average: 0.11 0.33 0.30
Tue Nov 26 16:54:06 2013: Load average: 0.11 0.33 0.30
Tue Nov 26 16:54:07 2013: Load average: 0.11 0.33 0.30
Tue Nov 26 16:54:08 2013: Load average: 0.11 0.33 0.30
Tue Nov 26 16:54:09 2013: Load average: 0.11 0.33 0.30
Tue Nov 26 16:54:10 2013: Load average: 0.18 0.34 0.30
Tue Nov 26 16:54:11 2013: Load average: 0.18 0.34 0.30

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
10 years agoexamples: Print header once in interrupts-by-dev.stp
Aaron Tomlin [Wed, 13 Nov 2013 20:26:59 +0000 (20:26 +0000)]
examples: Print header once in interrupts-by-dev.stp

Trivial change. Avoid printing the header multiple times.
For instance:

  DEVICE   NUMBER OF INTERRUPTS
        virtio0-input :      2
        virtio0-input :      1
        virtio0-input :      1
        virtio0-input :      2
     virtio3-requests :      4

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
10 years agoPR16207 partial fix: Fix the 'pipe' [nd_]syscall.exp tests on rawhide.
David Smith [Tue, 26 Nov 2013 16:58:22 +0000 (10:58 -0600)]
PR16207 partial fix: Fix the 'pipe' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stp: Handle syscall nesting in syscall.pipe.
* tapset/linux/nd_syscalls.stp: Handle syscall nesting in
  nd_syscall.pipe.
* runtime/linux/compat_unistd.h: Add __NR_compat_pipe2.
* tapset/linux/aux_syscalls.stp (_sys_pipe2_flag_str): Handle a flags
  value of 0.
* testsuite/systemtap.syscall/pipe.c: Add a new test.

10 years agoMinor fix.
David Smith [Mon, 25 Nov 2013 22:11:33 +0000 (16:11 -0600)]
Minor fix.

10 years agoPR16207 partial fix: Fix the 'net1' [nd_]syscall.exp tests on rawhide.
David Smith [Mon, 25 Nov 2013 22:10:40 +0000 (16:10 -0600)]
PR16207 partial fix: Fix the 'net1' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stp: On rawhide, all sys_accept calls don't go
  through sys_accept4.
* tapset/linux/nd_syscalls.stp: Similar changes.

10 years agofutexes2.meta: mark UNTESTED if not supported
Jonathan Lebon [Mon, 25 Nov 2013 21:09:54 +0000 (16:09 -0500)]
futexes2.meta: mark UNTESTED if not supported

10 years agoPR16207 partial fix: Fix the 'inotify' [nd_]syscall.exp tests on rawhide.
David Smith [Mon, 25 Nov 2013 21:08:27 +0000 (15:08 -0600)]
PR16207 partial fix: Fix the 'inotify' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stp: Handle syscall nesting in syscall.inotify_init.
* tapset/linux/nd_syscalls.stp: Handle syscall nesting in
  nd_syscall.inotify_init.
* runtime/linux/compat_unistd.h: Added the __NR_compat_inotify_init1 define.

10 years agoPR16207 partial fix: Fix the 'dup' [nd_]syscall.exp tests on rawhide.
David Smith [Mon, 25 Nov 2013 20:00:51 +0000 (14:00 -0600)]
PR16207 partial fix: Fix the 'dup' [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stp: Split the syscall.dup2 probe into
  syscall.dup2 and syscall.dup3.
* tapset/linux/nd_syscalls.stp: Split the nd_syscall.dup2 probe into
  nd_syscall.dup2 and nd_syscall.dup3.
* runtime/linux/compat_unistd.h: Added the __NR_compat_dup3 define.
* testsuite/buildok/syscalls-detailed.stp: Added dup3 test.
* testsuite/buildok/nd_syscalls-detailed.stp: Ditto.

10 years agoPR16207 partial fix: Fix the link [nd_]syscall.exp tests on rawhide.
David Smith [Mon, 25 Nov 2013 17:03:24 +0000 (11:03 -0600)]
PR16207 partial fix: Fix the link [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stp: Add @__syscall_compat_gate() macro call to
  syscall.linkat probe.
* tapset/linux/syscalls2.stp: Add @__syscall_compat_gate() macro call to
  syscall.readlinkat and syscall.symlinkat probes.
* tapset/linux/nd_syscalls.stp: Add @__syscall_compat_gate() macro call to
  nd_syscall.linkat probe.
* tapset/linux/nd_syscalls2.stp: Add @__syscall_compat_gate() macro call
  to nd_syscall.readlinkat and nd_syscall.symlinkat probes.
* runtime/linux/compat_unistd.h: Added the __NR_compat_linkat,
  __NR_compat_readlinkat, and __NR_compat_symlinkat defines.
* testsuite/systemtap.syscall/link.c: Updated testcase to handle syscall
  probes no longer being a wrapper around other syscall probes.

10 years agoelaborate.cxx: remove extra space
Jonathan Lebon [Mon, 25 Nov 2013 13:57:33 +0000 (08:57 -0500)]
elaborate.cxx: remove extra space

10 years agofix various issues coverity unearthed
Jonathan Lebon [Fri, 22 Nov 2013 22:04:03 +0000 (17:04 -0500)]
fix various issues coverity unearthed

Most of these were 'CHECKED_RETURN' type errors.

10 years agoPR16207 partial fix: Fix the chmod [nd_]syscall.exp tests on rawhide.
David Smith [Mon, 25 Nov 2013 15:30:49 +0000 (09:30 -0600)]
PR16207 partial fix: Fix the chmod [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stp: Add @__syscall_compat_gate() macro call to
  syscall.fchmodat, syscall.fchmodat.return, syscall.fchownat, and
  syscall.fchownat.return probes.
* tapset/linux/syscalls.stp: Add @__syscall_compat_gate() macro call to
  nd_syscall.fchmodat, nd_syscall.fchmodat.return, nd_syscall.fchownat,
  and nd_syscall.fchownat.return probes.
* runtime/linux/compat_unistd.h: Added __NR_compat_fchmodat and
  __NR_compat_fchownat defines.
* testsuite/systemtap.syscall/chmod.c: Updated testcase to handle
  syscall probes no longer being a wrapper around other syscall probes.

10 years agoPR16207 partial fix: Fix the access [nd_]syscall.exp tests on rawhide.
David Smith [Fri, 22 Nov 2013 22:41:54 +0000 (16:41 -0600)]
PR16207 partial fix: Fix the access [nd_]syscall.exp tests on rawhide.

* tapset/linux/syscalls.stpm: Add @__syscall_compat_gate() macro.
* tapset/linux/syscalls.stp: Add @__syscall_compat_gate() macro call to
  syscall.faccessat and syscall.faccess.return.
* tapset/linux/nd_syscalls.stp: Add @__syscall_compat_gate() macro call to
  nd_syscall.faccessat and nd_syscall.faccess.return.
* testsuite/systemtap.syscall/access.c: Updated testcase to handle
  access() no longer being a wrapper around faccessat().
* runtime/linux/compat_unistd.h: New file.
* tapset/linux/aux_syscalls.stp: Include compat_unistd.h.

10 years agoPR15219 partial fix. The [nd_]syscall.timer_settime probes no longer nest.
David Smith [Fri, 22 Nov 2013 20:51:50 +0000 (14:51 -0600)]
PR15219 partial fix. The [nd_]syscall.timer_settime probes no longer nest.

* tapset/linux/syscalls2.stp: Add compat function support to
  'syscall.timer_settime' and 'syscall.timer_settime.return' probes.
* tapset/linux/nd_syscalls2.stp: Add compat function support to
  'nd_syscall.timer_settime' and 'nd_syscall.timer_settime.return'
  probes.
* tapset/linux/aux_syscalls.stp (_struct_compat_itimerspec_u): New
  function.

10 years agoAdd STAP_ERROR macro
Aaron Tomlin [Fri, 22 Nov 2013 15:03:02 +0000 (15:03 +0000)]
Add STAP_ERROR macro

Instead of CONTEXT->last_error = "foo"; goto out; in an embedded-C
function, a newly defined macro STAP_ERROR(str) should be used.
The script can catch the exception with try { } catch { }.

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
10 years agoTighten -Wno-format-nonliteral to just where it's needed
Josh Stone [Wed, 20 Nov 2013 21:01:10 +0000 (13:01 -0800)]
Tighten -Wno-format-nonliteral to just where it's needed

We only have one function, stap_strfloctime(), which actually requires
relaxing this warning; the rest can and should be checked.  Split this
function into its own file, and give just that the relaxed option.

10 years agoFix retstr in __nd_syscall.clock_settime.return
Josh Stone [Wed, 20 Nov 2013 19:44:30 +0000 (11:44 -0800)]
Fix retstr in __nd_syscall.clock_settime.return

Probably just a copy-paste typo, but nd_syscalls can't use $return.

10 years agoparse: Let pp1_activation own the token rather than copying
Josh Stone [Wed, 20 Nov 2013 19:36:26 +0000 (11:36 -0800)]
parse: Let pp1_activation own the token rather than copying

This works around the RHEL4 compiler, which apparently doesn't see
parser::pp1_activation as a friend of token, even though parser is.
So it was failing to invoke the now-restricted copy-constructor, but
there's not really any reason for it to make a copy anyway.

10 years agoDon't check kernel "utrace" support for dyninst
Josh Stone [Wed, 20 Nov 2013 19:19:19 +0000 (11:19 -0800)]
Don't check kernel "utrace" support for dyninst

This regressed after commit d0923e365964097a2209cfc23568d5770f596bad,
which stopped reading kernel CONFIG variables at all for --dyninst.
We don't need them, but it didn't hurt much to check before.

10 years agoFix PR16187 by improving the syscall.sendfile/nd_syscall.sendfile probes.
David Smith [Mon, 18 Nov 2013 20:22:36 +0000 (14:22 -0600)]
Fix PR16187 by improving the syscall.sendfile/nd_syscall.sendfile probes.

* tapset/linux/syscalls2.stp (syscall.sendfile): Added
  'compat_sys_sendfile' and 'compat_sys_sendfile64' support.
* tapset/linux/nd_syscalls2.stp (nd_syscall.sendfile): Similar changes.

10 years agoPR16184: Fix sigmask decoding in the presence of TRACESYSGOOD
Josh Stone [Mon, 18 Nov 2013 19:20:02 +0000 (11:20 -0800)]
PR16184: Fix sigmask decoding in the presence of TRACESYSGOOD

Commit f1e0e63bb6992df4127bc7ae7ba89be478b9c250 added SIGTRAP|0x80 to
indicate PTRACE_O_TRACESYSGOOD signals.  However, _stp_sigset_str became
unpredictable, because it checks sigismember for all known signals, but
SIGTRAP|0x80 is out of the bitrange possible in a sigmask.

Now _stp_sigset_str only checks sigismember for values <= _NSIG.

10 years ago(Re)Fix PR16175 by updating mmap.c test program.
David Smith [Mon, 18 Nov 2013 19:17:13 +0000 (13:17 -0600)]
(Re)Fix PR16175 by updating mmap.c test program.

* testsuite/systemtap.syscall/mmap.c: Avoid mmap ulimit by only mmap'ing a
  maximum of 4K.

10 years agoPR16176: Fix 'nd_syscall.truncate' probe alias on ia32.
David Smith [Mon, 18 Nov 2013 15:38:28 +0000 (09:38 -0600)]
PR16176: Fix 'nd_syscall.truncate' probe alias on ia32.

* tapset/linux/nd_syscalls2.stp (__nd_syscall.truncate): Add
  'asmlinkage()' call.
  (__nd_syscall.truncate64): Ditto.

10 years agoPR10574: Fix a few pc=0 that escaped this old bug
Josh Stone [Sat, 16 Nov 2013 01:56:41 +0000 (17:56 -0800)]
PR10574: Fix a few pc=0 that escaped this old bug

We already checked for pc=0 in dwflpp::die_entrypc, but a couple places
didn't check the return value to notice COMDAT rejection.  We also need
to check this in the simpler dwflpp::function_entrypc, and both
functions are now marked warn_unused_result.

The new testsuite/semok/nullpc.stp makes sure we don't have any pc=0 in
stap itself, which is a large enough C++ binary to sometimes have these
COMDAT-eliminated null functions.

10 years agoPR15999 with symbol-table fallback, fill in empty $$parms, $$vars, etc
Lukas Berk [Fri, 15 Nov 2013 22:05:53 +0000 (17:05 -0500)]
PR15999 with symbol-table fallback, fill in empty $$parms, $$vars, etc

*tapsets.cxx - format empty symbol context, a few whitespace fixes

10 years agoFix PR16175 by upping offsets in mmap.c test program.
David Smith [Fri, 15 Nov 2013 21:54:40 +0000 (15:54 -0600)]
Fix PR16175 by upping offsets in mmap.c test program.

* testsuite/systemtap.syscall/mmap.c (main): Upped offsets to 64k, since
  ppc64 has a 64k page size.

10 years agolevenshtein: half substitution penalty if same case
Jonathan Lebon [Fri, 15 Nov 2013 20:11:46 +0000 (15:11 -0500)]
levenshtein: half substitution penalty if same case

We tweak the penalties so that if they differ only by their casing, then
the substitution penalty is halved.

Example of the effect:

Equal weights:
SYS_close --> SYSC_close, SyS_close, SYSC_clone, SyS_clone, con_close

Half penalty for diff casing
SYS_close --> SyS_close, SYSC_close, SyS_clone, sys_close, SYSC_clone

The 'SYSC' versions rank lower. But more importantly, we see 'sys_close'
become higher rank than 'con_close'.

10 years agoPR15219 partial fix. Several syscall.clock_* probes longer nest.
David Smith [Fri, 15 Nov 2013 19:52:03 +0000 (13:52 -0600)]
PR15219 partial fix. Several syscall.clock_* probes longer nest.

* tapset/linux/syscalls.stp: Add __syscall_get() macro calls to
  syscall.clock_nanosleep and syscall.clock_nanosleep.return to reject
  nested syscalls. Added compat_sys_clock_settime support to
  syscall.clock_settime and syscall.clock_settime.return.
* tapset/linux/nd_syscalls.stp: Similar changes as above.
* tapset/linux/syscalls.stpm: New file.
* tapset/linux/aux_syscalls.stp (_stp_syscall_nr): New function.

10 years agoalso suggest function aliases on unresolved dwarf probes
Jonathan Lebon [Fri, 15 Nov 2013 19:35:43 +0000 (14:35 -0500)]
also suggest function aliases on unresolved dwarf probes

This patch does two things:
1. It removes sym_seen and replaces it with inlined_funcs, which only
   picks up inlined functions.
2. suggest_dwarf_functions() now aggregates functions from both
   inlined_funcs and the module_info symtab function cache.

The net result is that (1) we're no longer storing duplicate
information, and (2) we now also suggest function aliases (which are in
the cache).

10 years agoPR16165: make token ctors private and befriend only the necessary
Jonathan Lebon [Thu, 14 Nov 2013 16:17:36 +0000 (11:17 -0500)]
PR16165: make token ctors private and befriend only the necessary

10 years agoPR16165: extend print_format::create
Jonathan Lebon [Wed, 13 Nov 2013 22:34:56 +0000 (17:34 -0500)]
PR16165: extend print_format::create

In an effort to restrict token creation, we change the
print_format::create() function to accept a string to denote the type of
print statement we want, rather than always deriving it from the token's
content. This allows us to skip the creation of tokens in a few places
that synthesize print statements.

- staptree.h: update print_format::create() declaration to accept new
  parameter and add new member print_format_type
- staptree.cxx: update print_format::create() and use print_format_type
  in print_format::print()
- elaborate.cxx: don't create token, use new parameter instead
- tapset-mark.cxx: ditto
- tapset-utrace.cxx: ditto
- tapsets.cxx: ditto

10 years agotestsuite: Support prelink even on NFS paths
Josh Stone [Thu, 14 Nov 2013 01:46:22 +0000 (17:46 -0800)]
testsuite: Support prelink even on NFS paths

We had an issue that prelink would fail trying to restore selinux
context if the file is on NFS, e.g. for someone working in NFS $HOME.
It turns out prelink see nfs_t on the source, but isn't allowed to set
nfs_t on the destination (even though it will already be nfs_t).

Now we have a [prelink] proc for test to run prelink though a mktemp
file.  The source is copied to tmp, prelinked, and copied back.

10 years agoPR16162: Support .plt probes on prelinked libraries
Josh Stone [Thu, 14 Nov 2013 01:04:19 +0000 (17:04 -0800)]
PR16162: Support .plt probes on prelinked libraries

There were a few bias issues in how plt addresses were handled, which
broke in the face of prelink offsets.  This patch tries to standardize
how these addresses are handled.

* tapsets.cxx (query_plt_statement): New function to fix plt addresses,
  both adding dwfl's elf bias and subtracting the dw bias, so it will
  work with dwflpp::relocate_address like everything else.
  (base_query::base_query): Leave session::consult_symtab alone!
  (dwarf_query::query_module_symtab): PLT doesn't fake a path through
  the symbol table anymore.
  (dwarf_query::handle_query_module): Direct PLT to query_plt_statement.
  (dwarf_query::add_probe_point): Remove the relocate exemption for plt.
* testsuite/systemtap.base/plt.exp: Update with a prelink test, and
  refactor a lot of the test on the way.

10 years agoPR16165: re-use perf_op token when expanding
Jonathan Lebon [Wed, 13 Nov 2013 18:20:00 +0000 (13:20 -0500)]
PR16165: re-use perf_op token when expanding

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