]> sourceware.org Git - systemtap.git/log
systemtap.git
8 years agotestsuite plt.c: correct compiler warnings
Frank Ch. Eigler [Tue, 29 Sep 2015 13:44:13 +0000 (09:44 -0400)]
testsuite plt.c: correct compiler warnings

8 years agoSet up kfails for testsuite/buildok/stap_staticmarkers-detailed.stp.
David Smith [Fri, 25 Sep 2015 17:25:41 +0000 (12:25 -0500)]
Set up kfails for testsuite/buildok/stap_staticmarkers-detailed.stp.

* testsuite/systemtap.pass1-4/buildok.exp: For
  buildok/stap_staticmarkers-detailed.stp, kfail if we don't have uprobes
  or if we're not running as root. Only root can read "staprun".

8 years agoAdd '-g' switch to testsuite/buildok/task-embedded.stp.
David Smith [Fri, 25 Sep 2015 17:23:54 +0000 (12:23 -0500)]
Add '-g' switch to testsuite/buildok/task-embedded.stp.

8 years agoFix PR19000 by making task.stp functions handle invalid addresses.
David Smith [Fri, 25 Sep 2015 15:04:25 +0000 (10:04 -0500)]
Fix PR19000 by making task.stp functions handle invalid addresses.

* tapset/linux/task.stp (task_ns_pid): Make sure the task_struct pointer
  is valid before using it.
  (task_ns_tid): Ditto.
  (task_gid): Ditto.
  (task_ns_gid): Ditto.
  (task_egid): Ditto.
  (task_ns_egid): Ditto.
  (task_uid): Ditto.
  (task_ns_uid): Ditto.
  (task_euid): Ditto.
  (task_ns_euid): Ditto.
* testsuite/buildok/task-embedded.stp: Add missing functions.

8 years agoAdd explicit typecasts ensuring buildability of json_set_prefix().
Martin Cermak [Fri, 25 Sep 2015 14:20:20 +0000 (16:20 +0200)]
Add explicit typecasts ensuring buildability of json_set_prefix().

Without this update json_set_prefix() doesn't compile on rhel[56]
i686 systems due to "format ‘%lu’ expects type ‘long unsigned int’,
but argument 4 has type ‘size_t’". The reproducer is as follows:
`stap -wge 'probe oneshot {println(json_set_prefix("blah"))}'`

8 years agoRefix PR18999 by changing the way we check last_error.
David Smith [Thu, 24 Sep 2015 21:01:57 +0000 (16:01 -0500)]
Refix PR18999 by changing the way we check last_error.

* tapsets.cxx (common_probe_entryfn_epilogue): Only check to see if
  'last_error' isn't NULL, don't check to see if it isn't empty.
* tapset/logging.stp (error): Don't provide a default error message.

8 years agoFix PR18999 by giving the 'error()' function a default error message.
David Smith [Thu, 24 Sep 2015 18:41:57 +0000 (13:41 -0500)]
Fix PR18999 by giving the 'error()' function a default error message.

* tapset/logging.stp (error): If 'msg' is empty, put in a default error
  message. Otherwise the function won't cause an error.

8 years agoexamples index: wrap version note in <p> for css coloring
Frank Ch. Eigler [Thu, 24 Sep 2015 14:53:53 +0000 (10:53 -0400)]
examples index: wrap version note in <p> for css coloring

8 years agoexamples index: note systemtap version
Frank Ch. Eigler [Thu, 24 Sep 2015 14:47:56 +0000 (10:47 -0400)]
examples index: note systemtap version

lberk noticed that our examples, and especially their listings at
sourceware.org/systemtap/examples/ may mislead people who run older
versions of systemtap that can't run all modern samples.  We now
add a brief version header to tip people off.

8 years agoFix the scheduler tapset on rawhide systems.
David Smith [Thu, 24 Sep 2015 13:39:09 +0000 (08:39 -0500)]
Fix the scheduler tapset on rawhide systems.

* tapset/linux/scheduler.stp (scheduler.process_fork): Fix the
  krpobes-based probe variant for rawhide systems by also probing
  '_do_fork'.

8 years agosemok/optimize.stp: remove string+long portion
Abegail Jakop [Wed, 23 Sep 2015 20:43:52 +0000 (16:43 -0400)]
semok/optimize.stp: remove string+long portion

work for PR18455 now produces a mismatch error in the case that
some binary expression has a long expression and a string expression,
meaning the string+long binary expression no longer gets optimized out.

8 years agoPR18455: avoid duplicate type mismatch errors
Abegail Jakop [Wed, 23 Sep 2015 16:00:01 +0000 (12:00 -0400)]
PR18455: avoid duplicate type mismatch errors

elaborate.cxx: stop analyzing the script if an error was generated in
the initial type pass to avoid generating a duplicate error in the
main type resolution pass

8 years agoPR18455: add type mismatch checks in const_folder
Abegail Jakop [Wed, 23 Sep 2015 14:14:53 +0000 (10:14 -0400)]
PR18455: add type mismatch checks in const_folder

elaborate.cxx: in const_folder::visit_binary_expression() if one
side is a literal number and the other is not pe_long or pe_unkown,
produce a type mismatch

8 years agoPR18455: include early check for type mismatches
Abegail Jakop [Wed, 9 Sep 2015 21:01:00 +0000 (17:01 -0400)]
PR18455: include early check for type mismatches

elaborate.cxx: during the initial typeres pass, we'll check for early type
mismatches (ignoring unresolved types), and produce errors (if verbose).

8 years agoPR18455: globals type_details are null in initial typres
Abegail Jakop [Wed, 9 Sep 2015 19:53:48 +0000 (15:53 -0400)]
PR18455: globals type_details are null in initial typres

elaborate.cxx: in the intial type pass, follow semantic_pass_types()
and set globals' type_details to null, since globals are not supposed
to have detailed types. this fixes the semko/autocast05.stp failure.

8 years agoPR18455: use an initial_typeres_info visitor
Abegail Jakop [Wed, 2 Sep 2015 21:54:44 +0000 (17:54 -0400)]
PR18455: use an initial_typeres_info visitor

elaborate.cxx: since some visit* functions in the typeresolution_info visitor
just throw errors, create an initial_typeresolution_info visitor that
overwrites those functions to account for substitutions/replacements not being
done. semko tests autocast05 and binexpr_infer_type fail with theses changes.

8 years agoPR18455: use an initial type resolution pass
Abegail Jakop [Wed, 26 Aug 2015 21:36:31 +0000 (17:36 -0400)]
PR18455: use an initial type resolution pass

elaborate.cxx: for the const_folder visitor attempt to resolve some
times before the const_foler visitor is called. this is to try to
propogate an expression's type that is implied by what expression it's
in, up to the vardecl, to avoid unresolved type errors in cases like:
{println(i*0)}

8 years agoPR18455: testcases for type inference changes
Abegail Jakop [Tue, 25 Aug 2015 15:09:39 +0000 (11:09 -0400)]
PR18455: testcases for type inference changes

semok/*: if some part of a binary expresion is elided in the const_folder
visitor, the type inference is still passed on.
semko/*: if some part of a binary expression, where one expression is a
string and the other is a long, gets elided in the const_folder visitor,
the type inference is still passed on, and stap reports a type mismatch.

8 years agoPR18455: suggest type in const_folder binary expr
Abegail Jakop [Tue, 25 Aug 2015 15:00:51 +0000 (11:00 -0400)]
PR18455: suggest type in const_folder binary expr

elaborate.cxx: within const_folder::visit_binary_expression(), for cases
like {println(i+0)} where part of the binary expression is elided, suggest
what the type (pe_long) should be to the remaining part of the expression.

8 years agoFix BZ1264678 by updating the networking tapset for the 4.1 kernel.
Mikhail Kulemin [Wed, 23 Sep 2015 17:10:50 +0000 (12:10 -0500)]
Fix BZ1264678 by updating the networking tapset for the 4.1 kernel.

* tapset/linux/networking.stp (netdev.transmit): Prefer
  __dev_queue_xmit() if available.
  (netdev.hard_transmit): Handle the change in argument name from 'skb' to
  'first'.

8 years agoActually test nfsdtop.stp by fixing its 'meta' file.
David Smith [Mon, 21 Sep 2015 21:21:23 +0000 (16:21 -0500)]
Actually test nfsdtop.stp by fixing its 'meta' file.

* testsuite/systemtap.examples/network/nfsdtop.meta (test_installcheck):
  Fix typo so that we actually test nfsdtop.stp instead of nfsd_unlink.stp.

8 years agotapset: remove unnecessary casts in rlimit_from_str()
Josh Stone [Fri, 18 Sep 2015 19:22:04 +0000 (12:22 -0700)]
tapset: remove unnecessary casts in rlimit_from_str()

8 years agoPR18885: Use /* unmodified-fnargs */ in tapsets
Martin Cermak [Fri, 18 Sep 2015 09:41:58 +0000 (11:41 +0200)]
PR18885: Use /* unmodified-fnargs */ in tapsets

* runtime/stp_string.[ch]: Make _stp_text_str's "in" parameter const.
* tapset/dyninst/context-envvar.stp: Optimize env_var().
* tapset/linux/context-caller.stp: Optimize _caller_match().
* tapset/linux/kretprobe.stp: Optimize _set_kretprobe_string().
* tapset/linux/panic.stp: Speed up the panic().
* tapset/linux/rlimit.stp: Optimize rlimit_from_str().
* tapset/string.stp: Optimize strlen(), substr(), stringat(), isinstr(),
text_str(), text_strn(), strtol(), isdigit().
* tapset/tokenize.stp: Optimize tokenize().
* tapset/uconversions.stp: Optimize user_string_n2(), user_string2_n_warn().

8 years agoPR18885: drop sensitivity of error() to /* unmodifed-fnargs */
Frank Ch. Eigler [Thu, 17 Sep 2015 18:33:06 +0000 (14:33 -0400)]
PR18885: drop sensitivity of error() to /* unmodifed-fnargs */

Switch to a less tricky implementation that uses explicit
string copies operations rather than char*-sharing to preserve
the incoming error message.

8 years agoprocess_by_pid.exp: Known failures marked as KFAIL per PR18971.
Martin Cermak [Thu, 17 Sep 2015 05:29:41 +0000 (07:29 +0200)]
process_by_pid.exp: Known failures marked as KFAIL per PR18971.

8 years agokretprobe.stp: sanity check the probe_type
Josh Stone [Wed, 16 Sep 2015 21:59:40 +0000 (14:59 -0700)]
kretprobe.stp: sanity check the probe_type

8 years agosystemtap-service.exp: Testcase update for modern developer toolset.
Martin Cermak [Wed, 16 Sep 2015 09:52:12 +0000 (11:52 +0200)]
systemtap-service.exp: Testcase update for modern developer toolset.

8 years agoFix PR18944 by updating runtime/linux/autoconf-blk-types.c.
David Smith [Mon, 14 Sep 2015 15:35:36 +0000 (10:35 -0500)]
Fix PR18944 by updating runtime/linux/autoconf-blk-types.c.

* runtime/linux/autoconf-blk-types.c: Add linux/blkdev.h that hopefully
  includes linux/rh_kabi.h. We can't include it directly since it doesn't
  exist on non-RHEL kernels.

8 years agoFix s390 [nd_]syscall.fallocate argstr.
Martin Cermak [Fri, 11 Sep 2015 07:12:31 +0000 (09:12 +0200)]
Fix s390 [nd_]syscall.fallocate argstr.

* tapset/linux/s390/nd_syscalls.stp: Remove 'mode' from argstr.
* tapset/linux/s390/syscalls.stp: Ditto.

8 years agobz1252436.exp: Only run the testcase within installcheck under root.
Martin Cermak [Fri, 11 Sep 2015 06:58:47 +0000 (08:58 +0200)]
bz1252436.exp: Only run the testcase within installcheck under root.

8 years agoPR17921: add testcase
Felix Lu [Thu, 10 Sep 2015 15:21:46 +0000 (11:21 -0400)]
PR17921: add testcase

8 years agoPR17921 - /proc/kallsyms symbols
Felix Lu [Wed, 9 Sep 2015 13:30:49 +0000 (09:30 -0400)]
PR17921 - /proc/kallsyms symbols

* translate.cxx: allow translator to read /proc/kallsyms when
  debuginfo is not available.

8 years agoNew regression test for rhbz1252436
Martin Cermak [Wed, 9 Sep 2015 17:19:46 +0000 (19:19 +0200)]
New regression test for rhbz1252436

8 years agoNew regression test for rhbz1214176.
Martin Cermak [Wed, 9 Sep 2015 16:25:30 +0000 (18:25 +0200)]
New regression test for rhbz1214176.

8 years agoFixed PR18942 by avoiding the inclusion of unused global variables.
David Smith [Wed, 9 Sep 2015 15:47:57 +0000 (10:47 -0500)]
Fixed PR18942 by avoiding the inclusion of unused global variables.

* tapset/linux/aux_syscalls.stp (__count_envp): Changed the name of the
  'argc' local variable to '__argc' to avoid confusing the translator with
  the global 'argc' variable from tapset/argv.stp.
  (__count_compat_envp): Ditto.

8 years agoPR18936: extend the lifetime of synthesized DW_OP_addr
Josh Stone [Tue, 8 Sep 2015 21:24:36 +0000 (14:24 -0700)]
PR18936: extend the lifetime of synthesized DW_OP_addr

In dwflpp::literal_stmt_for_local(), a fake addr_loc is created for
variables we find in the symbol table.  But this addr_loc had tight
scope on the stack, and its contents were clobbered by the time the
pointer was read by emit_header().

Just extending the lifetime to the whole function scope is enough.

8 years agoFix missing exec perm on parseko/cmdline23.stp and parseok/cmdline03.stp.
Martin Cermak [Mon, 7 Sep 2015 05:51:46 +0000 (07:51 +0200)]
Fix missing exec perm on parseko/cmdline23.stp and parseok/cmdline03.stp.

Missing the 'execute' perm on parse{ok,ko} files causes `ERROR: tcl error
sourcing ...` during make installcheck.

8 years agoSwitch to SSL_GetImplementedCiphers()
Josh Stone [Fri, 4 Sep 2015 18:11:53 +0000 (11:11 -0700)]
Switch to SSL_GetImplementedCiphers()

When nss rebases, the size of SSL_ImplementedCiphers[] may change.  If
we have a copy relocation, this could mean we'll get an incomplete copy
of the array.  Use the accessor function instead for a simple pointer.

See also: https://bugzilla.mozilla.org/show_bug.cgi?id=496993

8 years agoPR18649: Add tests for the new --prologue-searching option
Martin Cermak [Fri, 4 Sep 2015 07:38:45 +0000 (09:38 +0200)]
PR18649: Add tests for the new --prologue-searching option

* NEWS: Add entry describing the new option.
* hash.cxx: Add the option index into the script hash.
* testsuite/parseko/cmdline23.stp: New testcase.
* testsuite/parseok/cmdline03.stp: Ditto.
* testsuite/systemtap.base/pr18649.exp: Ditto.

8 years agoPR18889 testing: already done by modules_out_of_tree.exp
Frank Ch. Eigler [Wed, 2 Sep 2015 15:52:31 +0000 (11:52 -0400)]
PR18889 testing: already done by modules_out_of_tree.exp

Ditch bz6503, given that it wasn't reliable.

8 years agoPR18889: switch to STP_TRACEPOINT* frontend for kernel tracepoint registration
Frank Ch. Eigler [Wed, 2 Sep 2015 15:16:46 +0000 (11:16 -0400)]
PR18889: switch to STP_TRACEPOINT* frontend for kernel tracepoint registration

jistone kindly reminded that the runtime/stp_tracepoint.[ch] machinery
allows us to attach to kernel tracepoints, whether on string- or
tp*-based kernel APIs, and whether or not the tp* objects are
EXPORT_TRACEPOINT_SYMBOL_GPL'd.  Let's use those; presto we get
module-init probing back on kernels oldish and newish.

8 years agoFix PR18649 by adding --prologue-searching[=WHEN] command line switch.
Martin Cermak [Tue, 1 Sep 2015 07:08:25 +0000 (09:08 +0200)]
Fix PR18649 by adding --prologue-searching[=WHEN] command line switch.

Add --prologue-searching[=WHEN] command line switch with '-P' being
its short counterpart.  Add respective man page and usage entries.

Using --prologue-searching=never turns prologue searching off
working around issue PR18649.

8 years agoFix PR18827 by adding a new testcase and correcting issues it found.
Martin Cermak [Tue, 1 Sep 2015 06:35:08 +0000 (08:35 +0200)]
Fix PR18827 by adding a new testcase and correcting issues it found.

* NEWS: Deprecate powerpc variant of nd_syscall.compat_sysctl.
* scripts/update-syscall-docs: Filter underscore prefixed locals per PR18827#c1.
* tapset/linux/powerpc/nd_syscalls.stp: Deprecation per NEWS.
* tapset/linux/powerpc/syscalls.stp: Remove systemtap_v <= "1.4" deprecated bit.
* tapset/linux/s390/nd_syscalls.stp: Add locals to align to resp. syscall.
* tapset/linux/s390/syscalls.stp: Use existing locals in argstr.
* tapset/linux/syscalls.stp: Fix probe syscall.mq_timedsend.
* testsuite/systemtap.syscall/syscall_consistency.exp: New testcase.

8 years agoPR18889 part: module-init notification via module_{load,free} tracepoints
Frank Ch. Eigler [Mon, 31 Aug 2015 21:46:43 +0000 (17:46 -0400)]
PR18889 part: module-init notification via module_{load,free} tracepoints

Investigating RHBZ1257399 et al., we found that module_notifier is
being called too early after kernel commit #4982223e51.  This
precludes normal module section-address computation and thus kprobe
emplacement.  This patch adds hooking into the module_{load,free}
tracepoints in parallel, because on some kernels (RHEL7.1.Z+) they
occur at just the right time.

On the downside, on recent LKML kernels, attaching to those
tracepoints requires EXPORT_TRACEPOINT_SYMBOL_GPL's, so until that is
done (or another workaround made), LKML kernels will still miss out on
module-init probing.

8 years agoPR18889 part: improve module-notification related debug tracing
Frank Ch. Eigler [Mon, 31 Aug 2015 15:17:33 +0000 (11:17 -0400)]
PR18889 part: improve module-notification related debug tracing

-DDEBUG_KPROBES -DDEBUG_SYMBOLS -DDEBUG_STP_ON_THE_FLY recommended.

8 years agoPR18885: use unmodified-fnargs in logging.stp
Josh Stone [Fri, 28 Aug 2015 20:36:54 +0000 (13:36 -0700)]
PR18885: use unmodified-fnargs in logging.stp

8 years agoarm/registers.stp: correct the assert condition
Josh Stone [Fri, 28 Aug 2015 16:49:48 +0000 (09:49 -0700)]
arm/registers.stp: correct the assert condition

The offset condition was not fully inverted in its transition to assert.
(The same checks for other architectures were all done correctly.)

8 years agoInclude assert parameters in document comment
Felix Lu [Fri, 28 Aug 2015 13:58:27 +0000 (09:58 -0400)]
Include assert parameters in document comment

8 years agoMove assert function
Felix Lu [Fri, 28 Aug 2015 13:47:29 +0000 (09:47 -0400)]
Move assert function

Move assertion function into logging.stp.

8 years agoPR18876: modify existing tapset and testcases to use assert()
Felix Lu [Thu, 27 Aug 2015 20:35:38 +0000 (16:35 -0400)]
PR18876: modify existing tapset and testcases to use assert()

8 years agoPR18876: new assert tapset function
Felix Lu [Thu, 27 Aug 2015 18:54:43 +0000 (14:54 -0400)]
PR18876: new assert tapset function

* new file: tapset/assert.stp

8 years agotapset: add fullpath_struct_{nameidata,path}() and probe vfs.open*
Frank Ch. Eigler [Thu, 27 Aug 2015 20:36:29 +0000 (16:36 -0400)]
tapset: add fullpath_struct_{nameidata,path}() and probe vfs.open*

Fill little gaps in the tapset.
Includes new sample script io/slowvfs.stp.

8 years agoLet STAP_PRINTF work with no format args
Josh Stone [Thu, 27 Aug 2015 16:36:46 +0000 (09:36 -0700)]
Let STAP_PRINTF work with no format args

With ##__VA_ARGS__, cpp will remove the prior comma when there are no
args at all.  This way you avoid syntax errors like 'printf("fmt",)'.

Also #undef STAP_PRINTF at the function end, like other macros.

8 years agoEscape backslashes on some man pages
Felix Lu [Thu, 27 Aug 2015 14:12:32 +0000 (10:12 -0400)]
Escape backslashes on some man pages

Some instances of \n were not escaped.

8 years agoPR18751: STAP_PRINTF macro
Felix Lu [Thu, 27 Aug 2015 13:29:50 +0000 (09:29 -0400)]
PR18751: STAP_PRINTF macro

* translate.cxx: new macro for embedded-c functions

8 years agoPR10977: new address size tapset functions
Felix Lu [Wed, 26 Aug 2015 16:45:18 +0000 (12:45 -0400)]
PR10977: new address size tapset functions

- new tapset functions get arch_bytes() and uarch_bytes() to obtain
  address size for kernel and user space.

8 years agoPR16968: update probe help page
Felix Lu [Tue, 25 Aug 2015 19:41:10 +0000 (15:41 -0400)]
PR16968: update probe help page

* ioblock.stp: update comments so generated pages are correct

8 years agoPR16493: Remove command line processing and bug fix
Felix Lu [Mon, 24 Aug 2015 19:29:33 +0000 (15:29 -0400)]
PR16493: Remove command line processing and bug fix

* bkl.stp: use stap -G flag instead of manual processing arguments
  also fixed a logic error where backtrace is always turned on.

8 years agoAdd a new command line option to enable print backtraces under some conditions.
Jose Castillo [Wed, 22 Jan 2014 10:40:27 +0000 (10:40 +0000)]
Add a new command line option to enable print backtraces under some conditions.

Most of the times, when we use bkl.stp to investigate BKL issues, we've found useful to have
the backtrace of the function that holds the BKL. This patch adds a new command line option,
"backtrace=N", that when used enables the use of print_backtrace(). The value of <N>, if present,
is taken as useconds, and it is the limit of time the task or tasks have been waiting to acquire
the lock i.e.:

  # stap blk.stp backtrace=100

That would enable printing of backtrace on all tasks holding the kernel
big lock for more than 100us.

Signed-off-by: Jose Castillo <jcastillo@redhat.com>
8 years agoPR10487: Include testcase
Felix Lu [Mon, 24 Aug 2015 15:39:55 +0000 (11:39 -0400)]
PR10487: Include testcase

* switch_file.exp: test that switch_file() works

8 years agoPR10487: check process id before signal
Felix Lu [Mon, 24 Aug 2015 15:11:19 +0000 (11:11 -0400)]
PR10487: check process id before signal

Make sure the entire process group is not signaled

8 years agoDelete output files for systemtap.examples tests without output.
Felix Lu [Fri, 21 Aug 2015 19:44:49 +0000 (15:44 -0400)]
Delete output files for systemtap.examples tests without output.

8 years agoPR10487: Include example usage script
Felix Lu [Fri, 21 Aug 2015 17:05:29 +0000 (13:05 -0400)]
PR10487: Include example usage script

8 years agoPR10487: New tapset to allow output file switching
Felix Lu [Fri, 21 Aug 2015 15:37:32 +0000 (11:37 -0400)]
PR10487: New tapset to allow output file switching

* tapset/switchfile.stp - new tapset function

8 years agoUpdate _stp_pid value
Felix Lu [Fri, 21 Aug 2015 15:32:23 +0000 (11:32 -0400)]
Update _stp_pid value

* The pid of the stapio process is updated to reflect the pid
  after forking the process.

8 years agoPR10551 continued: grsecurity support in transport/symbols.c
Nicolas Brito [Mon, 24 Aug 2015 13:48:32 +0000 (09:48 -0400)]
PR10551 continued: grsecurity support in transport/symbols.c

A non-grsecism snuck into _stp_module_update_self().

8 years agoPR2111: support $srcdir != $builddir
Frank Ch. Eigler [Mon, 24 Aug 2015 13:33:56 +0000 (09:33 -0400)]
PR2111: support $srcdir != $builddir

Noting that tapsets.tmpl.new is built in the $builddir.

8 years agostaprun: ignore SIGUSR2 when not writing to a file (-o)
Josh Stone [Fri, 21 Aug 2015 21:04:24 +0000 (14:04 -0700)]
staprun: ignore SIGUSR2 when not writing to a file (-o)

8 years agoruntime: clear op_index at DW_LNE_end_sequence
Josh Stone [Thu, 20 Aug 2015 17:28:38 +0000 (10:28 -0700)]
runtime: clear op_index at DW_LNE_end_sequence

8 years agoFix to get the signalfd syscall test working.
David Smith [Thu, 20 Aug 2015 16:43:19 +0000 (11:43 -0500)]
Fix to get the signalfd syscall test working.

* testsuite/systemtap.syscall/signalfd.c: Compile the test if either
  __NR_signalfd or __NR_signalfd4 are defined, both do no need to be
  defined.

8 years agoFix PR18856 by making nfsd.close optional.
David Smith [Thu, 20 Aug 2015 16:27:53 +0000 (11:27 -0500)]
Fix PR18856 by making nfsd.close optional.

* tapset/linux/nfsd.stp: Make nfsd.close optional in nfsd.entries (and add
  it optionally to nfsd.return), since the underlying probe point no
  longer exists in kernels 4.2+. Also add nfsd.proc.commit.return to
  nfsd.proc.return (to match nfsd.proc).
* testsuite/buildok/nfsd-detailed.stp: Make nfsd.close tests optional.

8 years agoTweak several syscall test cases to improve results on rawhide.
David Smith [Thu, 20 Aug 2015 14:39:33 +0000 (09:39 -0500)]
Tweak several syscall test cases to improve results on rawhide.

* testsuite/systemtap.syscall/clock.c: Relax return code check.
* testsuite/systemtap.syscall/seccomp.c: Ditto.
* testsuite/systemtap.syscall/ioperm.c: Only include sys/io.h if
  __NR_ioperm is defined.
* testsuite/systemtap.syscall/remap_file_pages.c: Define _GNU_SOURCE.
* testsuite/systemtap.syscall/lxattr.c: Include extra headers to avoid
  compilation errors.
* testsuite/systemtap.syscall/process_vm.c: Ditto.
* testsuite/systemtap.syscall/setns.c: Ditto.
* testsuite/systemtap.syscall/sigaltstack.c: Ditto.
* testsuite/systemtap.syscall/xattr.c: Ditto.
* testsuite/systemtap.syscall/sigmask.c: Make inlines static to make
  rawhide's compiler happy.
* testsuite/systemtap.syscall/vhangup.c: Define capget/capset.

8 years agoPR18503: testcases
Felix Lu [Thu, 20 Aug 2015 14:01:10 +0000 (10:01 -0400)]
PR18503: testcases

* testsuite/procfs_maxsize.exp - make existing testcases compatible
  by throwing away errors / check correct generated size

8 years agoPR18503: include procfs .maxsize overflow error
Felix Lu [Thu, 20 Aug 2015 13:58:58 +0000 (09:58 -0400)]
PR18503: include procfs .maxsize overflow error

* tapset-procfs.cxx - after writing to buffer, generate an error if
  buffer size is not enough

8 years agoruntime: only compare line records at "commit" states
Josh Stone [Thu, 20 Aug 2015 01:38:08 +0000 (18:38 -0700)]
runtime: only compare line records at "commit" states

The state machine for line records may go through intermediate states
which are not proper to compare address against.  Only at DW_LNS_copy,
DW_LNE_end_sequence, and special opcodes are we supposed to "append a
row to the matrix", as the DWARF specification tells us.

The usymfileline testcase didn't hit problems, because its C target only
outputted a simple sequence of special opcodes.  It's now C++, as that's
a very easy way to get code generated from a lot of different files and
lines.  A simple std::find creates pretty complicated line records, even
in an unoptimized build.

8 years agostringtable.h: add logical ops and to_string if needed
Abegail Jakop [Wed, 19 Aug 2015 22:04:36 +0000 (18:04 -0400)]
stringtable.h: add logical ops and to_string if needed

when it comes to string_ref, boost 1.53 doesn't contain all the
logical operations that we need, nor to_string(). so we'll fill in
the gaps with our own defintions for interned_string.

8 years agoUpdate syscall tapset documentation to use cached content.
Martin Cermak [Wed, 19 Aug 2015 18:20:36 +0000 (20:20 +0200)]
Update syscall tapset documentation to use cached content.

Before this update syscall tapset autodocumentation has been
generated dynamically at the build time using stap -L call.
This way stap requires kernel-devel RPM matching `uname -r`
which is tricky to achieve in koji. For this reason the content
is cached from now on:

* doc/SystemTap_Tapset_Reference/syscalls.xmlpart
* doc/SystemTap_Tapset_Reference/syscalls.3stap

The scripts/update-syscall-docs can be used to update the cached
content.

8 years agostring_ref: correct interned_string substr / c_str conflict
Frank Ch. Eigler [Wed, 19 Aug 2015 18:21:41 +0000 (14:21 -0400)]
string_ref: correct interned_string substr / c_str conflict

jistone pointed out a possible problem in the interned_string
implementation; we break the tie in favour of trivial c_str()
(since commit 3e4547ad096d showed its value).

8 years agostap: sort "enabled features" for easier inspection
Josh Stone [Tue, 18 Aug 2015 21:05:17 +0000 (14:05 -0700)]
stap: sort "enabled features" for easier inspection

8 years agoNEWS: tweak the /* stable */ blurb
Frank Ch. Eigler [Tue, 18 Aug 2015 19:10:08 +0000 (15:10 -0400)]
NEWS: tweak the /* stable */ blurb

8 years agofix typo in NEWS
Abegail Jakop [Tue, 18 Aug 2015 18:59:24 +0000 (14:59 -0400)]
fix typo in NEWS

8 years agoNEWS blurb about interned_string
Abegail Jakop [Tue, 18 Aug 2015 14:49:54 +0000 (10:49 -0400)]
NEWS blurb about interned_string

8 years agoadd string_ref to list of enabled features
Abegail Jakop [Mon, 17 Aug 2015 18:39:08 +0000 (14:39 -0400)]
add string_ref to list of enabled features

when outputting systemtap versions (stap -V), output BOOST_STRING_REF
in the list enabled features

8 years agoalternate interned_string if no boost::string_ref
Abegail Jakop [Fri, 14 Aug 2015 20:42:33 +0000 (16:42 -0400)]
alternate interned_string if no boost::string_ref

string_ref was only introduced in boost 1.53, meaning rhel 5 and 6
might not have a recent enough version. to account for this, if
string_ref is not available, fall back on an alternate definition
of interned_string that uses std::string instead.

8 years agoremove unused lex_cast()-ed args
Abegail Jakop [Wed, 12 Aug 2015 21:00:38 +0000 (17:00 -0400)]
remove unused lex_cast()-ed args

8 years agointerned-string conversion: some more function parameters
Frank Ch. Eigler [Mon, 10 Aug 2015 14:12:17 +0000 (10:12 -0400)]
interned-string conversion: some more function parameters

Saving some std::string round-trips.

8 years agointerned_string: construct from null char*
Frank Ch. Eigler [Sat, 8 Aug 2015 11:39:20 +0000 (07:39 -0400)]
interned_string: construct from null char*

Some of the tapset*cxx functions were used to representing empty
function / file names with NULL char*s.  As these are transitioned to
interned_strings, the latter's ctors must be willing to accept those
NULLs and convert them to empty strings.  (Adjusting all the callers
to pass "" instead of NULL in those slots is also possible.)

8 years agostringtable: turn off the INSTRUMENT option by default
Frank Ch. Eigler [Sat, 8 Aug 2015 03:07:52 +0000 (23:07 -0400)]
stringtable: turn off the INSTRUMENT option by default

8 years agointerned_string: drop magic c_str() implementation
Frank Ch. Eigler [Sat, 8 Aug 2015 02:53:26 +0000 (22:53 -0400)]
interned_string: drop magic c_str() implementation

It turns out that while it was right for boost::string_ref not to
provide it, we can, because our interned_string's backing stores
are full (read-only) std::strings, which always carry a \0.  This
shrinks down our interned_string to 2*sizeof(void*) bytes.

8 years agotapset-method.cxx: drop unused variable
Frank Ch. Eigler [Sat, 8 Aug 2015 02:53:17 +0000 (22:53 -0400)]
tapset-method.cxx: drop unused variable

8 years agoINTERNALS: update with some words about interned strings and visitors
Frank Ch. Eigler [Sat, 8 Aug 2015 02:05:52 +0000 (22:05 -0400)]
INTERNALS: update with some words about interned strings and visitors

8 years agoerror message formatting
Frank Ch. Eigler [Sat, 8 Aug 2015 01:44:23 +0000 (21:44 -0400)]
error message formatting

With the richer interned_string API, one can return to the previous
way of finding line boundaries in the input string.  While in the
area, we tweak spacing of parse error message lines.

8 years agostringtable: add diagnostic logging mode
Frank Ch. Eigler [Sat, 8 Aug 2015 00:19:50 +0000 (20:19 -0400)]
stringtable: add diagnostic logging mode

With INTERNED_STRING_INSTRUMENT set, a /tmp/hash.log file is written
out to record each string being interned.  Looking through that is a
good way of tuning the hash function, as well as what
staptree/etc. variables are reverted to std::string form.  (The hint
is that if strings are hardly ever interned in the log, then maybe
they are not reused either.  But that could instead be because they're
being reused exclusively in interned string_ref form, so don't need to
be rehashed.)

8 years agostring_ref cont'd, considering token::msg
Frank Ch. Eigler [Fri, 7 Aug 2015 19:43:14 +0000 (15:43 -0400)]
string_ref cont'd, considering token::msg

Experimentation indicates that the sizeof(interned_string)=24
is so much larger than that of an empty sizeof(std::string)=8
that for mostly-empty slots it's a loss!  A 1-byte std::string
causes a 26-byte malloc, so the interned_string is probably
good for nonempty strings.

8 years agoparser: eliminate needless probe-point-component token duplication
Frank Ch. Eigler [Fri, 7 Aug 2015 19:26:31 +0000 (15:26 -0400)]
parser: eliminate needless probe-point-component token duplication

parser::parse_probe_point created a new token unnecessarily, on the
off chance that a component had to be extended due to wildcards like

  probe foo*

Now this is done only if necessary, and even then not by creating
a new token but rewriting the content of a previous one.

8 years agostringtable tuning
Frank Ch. Eigler [Fri, 7 Aug 2015 18:53:03 +0000 (14:53 -0400)]
stringtable tuning

As guided by "perf stat -r ..." runs, a few microoptimizations on the
string table / interned-string facility.

8 years agostring_ref: mass interned_string conversion
Frank Ch. Eigler [Fri, 7 Aug 2015 03:09:33 +0000 (23:09 -0400)]
string_ref: mass interned_string conversion

Converting many many classes' use of std::string to interned_string.
Largely mechanical, and driven by the desire to (a) store long-lived
duplicate strings only once (in the stringtable), and (b) avoid
instantiating std::strings unnecessarily (in temporary variables
or function parameters).

8 years agostring_ref: switch over to interned_string class
Frank Ch. Eigler [Thu, 6 Aug 2015 22:26:27 +0000 (18:26 -0400)]
string_ref: switch over to interned_string class

Motivated by frustratingly easy-to-miss memory corruption errors of
the direct boost::string_ref model, switching gears to a new derived
class interned_string.  This one performs proper interning when
converting in from a std::string for all copy/assignment operations.
In many cases, it can simply replace std::string through automatic
conversions in/out, naturally paying a CPU / temporary-memory cost.

8 years agostring_ref cont'd: exploiting all over the place
Frank Ch. Eigler [Wed, 5 Aug 2015 19:32:01 +0000 (15:32 -0400)]
string_ref cont'd: exploiting all over the place

Replacing many std::string types, focusing on those stored in
high-cardinality data structures, with boost::string_ref.
Largely mechanical work, with valgrind runs identifying some
persistent trouble-spots of the form

      string_ref FOO = (some_temp_string_value);

which makes them dangle the moment the temp goes out of scope.

8 years agostring_ref usage correction: drop string_ref->to_string()->c_str() chain
Frank Ch. Eigler [Wed, 5 Aug 2015 17:37:10 +0000 (13:37 -0400)]
string_ref usage correction: drop string_ref->to_string()->c_str() chain

This construct generates stale char* pointers that valgrind notices.
We use a first-class temporary string object for these uses.  (They
should probably be rewritten in terms of string_ref native
operations.)

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