]> sourceware.org Git - systemtap.git/log
systemtap.git
5 years agoFix aarch64 to properly access arguments for wrapped syscalls
William Cohen [Tue, 23 Jul 2019 18:24:14 +0000 (14:24 -0400)]
Fix aarch64 to properly access arguments for wrapped syscalls

Linux 4.18 added wrappers for aarch64 syscalls that pass a pointer to
a struct pt_regs holding the values for the actual arguments.  The
syscall tapsets initialize CONTEXT->sregs to point at this data
structure.  However, the aarch64 specific register access code was
using the CONTEXT->kregs and just getting the processor register state
when the kprobe triggered rather than the expected arguments in the
data structure being passed into the syscall.  The aarch64 specific
register code now gets the syscall arguments from the correct pt_regs
structure.

5 years agoruntime: adapt to inconsistent export of task_work_add and task_work_cancel
Frank Ch. Eigler [Sat, 20 Jul 2019 17:11:54 +0000 (13:11 -0400)]
runtime: adapt to inconsistent export of task_work_add and task_work_cancel

Ubuntu user <walac> reports their kernel 5.0.0-17-generic #18-Ubuntu
SMP encounters pass-5 errors with an unresolved task_work_cancel()
symbol.  It turns out this is due to a ubuntu-specific
(android-related) kernel commit that exports only task_work_add().
Updated buildrun.cxx and relevant runtime files to separately check
for exportedness of task_work_cancel().

commit 2cc291a463c42641b4146b2507fa4499da35d335
Author: Christian Brauner <christian@brauner.io>
Date:   Wed Jan 16 23:13:25 2019 +0100

    UBUNTU: SAUCE: binder: turn into module

5 years agoEliminate ambiguous python shebangs
William Cohen [Fri, 19 Jul 2019 14:46:59 +0000 (10:46 -0400)]
Eliminate ambiguous python shebangs

Fedora rawhide (31) now throws errors for ambiguous python shebangs.
The systemtap.spec has been modified as outlined in the Fedora feature
wiki page to avoid those ambiguities:

https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error

5 years agoAdd mmwriteback.stp to the list of examples that BPF can run.
William Cohen [Thu, 18 Jul 2019 18:52:47 +0000 (14:52 -0400)]
Add mmwriteback.stp to the list of examples that BPF can run.

5 years agoAdd a test for the BPF raw tracepoints functionality. (PR23866)
William Cohen [Thu, 18 Jul 2019 15:57:50 +0000 (11:57 -0400)]
Add a test for the BPF raw tracepoints functionality. (PR23866)

5 years agoPR23866: Make the bpf backend use BPF raw tracepoints for kernel.trace("*")
William Cohen [Thu, 18 Jul 2019 15:37:37 +0000 (11:37 -0400)]
PR23866: Make the bpf backend use BPF raw tracepoints for kernel.trace("*")

The BPF raw tracepoints provide arguments that better match the
Systemtap lkm kernel tracepoint probes than regular BPF tracepoints.
The BPF backend will use the BPF raw tracepoints unless the user
specifies the old behavior with a --compatible=4.1 option on the
commandline to address.

The new BPF raw tracepoints and their argument are discovered in the
same way as the old BPF tracepoints.  A number of small machine
generated C files are generated with macros are compiled to query the
available tracepoints in the kernel. Debug information describing the
data structures passed into the BPF tracepoints is examined to
determine the type and location of the tracepoint arguments.

Each probe handler BPF code for BPF raw tracepoints is put into a
raw_trace section as the method of registering the BPF raw tracepoints
is different than the regular BPF tracepoints.

The bpf tests have been revised to include the --compatible=4.1 option
for the tests where it makes a difference.

5 years agostapbpf pr24811 bugfix :: don't pop keys.back() on first iteration
Serhei Makarov [Mon, 15 Jul 2019 17:14:25 +0000 (13:14 -0400)]
stapbpf pr24811 bugfix :: don't pop keys.back() on first iteration

If key == NULL, the sorted data for the current foreach loop
has not yet been created. Hence if limit == 0, keys.back() shouldn't
be popped.

* stapbpf/bpfinterp.cxx (map_get_next_key): bugfix for limit == 0.

5 years agostapbpf PR24811 test :: unveil a nasty lurking segfault case in foreach loops
Serhei Makarov [Mon, 15 Jul 2019 16:53:29 +0000 (12:53 -0400)]
stapbpf PR24811 test :: unveil a nasty lurking segfault case in foreach loops

5 years agoAdd some minor tweaks to backtracing add-ons and mention in NEWS
Jafeer Uddin [Thu, 11 Jul 2019 20:20:13 +0000 (16:20 -0400)]
Add some minor tweaks to backtracing add-ons and mention in NEWS

* NEWS: mention new backtracing add-ons
* runtime/regs.h: fix bug with REG_LINK macro for __aarch64__
* tapset/linux/ucontext-unwind.stp: tweak the register-taking backtraces to be more general and work
  with other archs

5 years agoFix errors with new backtrace functions missed in backtracing patch
Jafeer Uddin [Tue, 2 Jul 2019 15:57:07 +0000 (11:57 -0400)]
Fix errors with new backtrace functions missed in backtracing patch

5 years agostapbpf/bpfinterp.cxx pr24758 :: add error info to abort() calls
Serhei Makarov [Tue, 2 Jul 2019 15:26:13 +0000 (11:26 -0400)]
stapbpf/bpfinterp.cxx pr24758 :: add error info to abort() calls

This is still not a proper error reporting scheme but it lets me debug
things in the meantime without having to fire up a debugger just to
understand which place in the code called abort().

* bpfinterp.cxx (stapbpf_abort): New macro, prints reason + aborts.
  (stapbpf_just_abort): New macro, aborts for unspecified reason,
  but still prints the location of the abort() call.
  (stapbpf_stat_get): use stapbpf_abort().
  (bpf_handle_transport_msg): ditto.
  (bpf_interpret): ditto.

5 years agoAdd more capabilities to systemtap backtracing
Jafeer Uddin [Tue, 25 Jun 2019 20:23:41 +0000 (16:23 -0400)]
Add more capabilities to systemtap backtracing

* runtime/sym.c: simplified logic in _stp_snprint_addr because it doesn't need to be that verbose,
  also added ability to have file names and line numbers print in backtraces
* runtime/sym.h: added new symbol flag to generate a more "fuller" backtrace (includes file names
  and line numbers)
* tapset/linux/context-unwind.stp: added new backtrace tapset function that also prints file names
* tapset/linux/ucontext-unwind.stp: added new backtrace tapset function that also prints file names
  and functions to allow backtraces using a user provided pc & sp.

5 years agoMake use of dwarf_aggregate_size to find size attr of types
Jafeer Uddin [Tue, 25 Jun 2019 19:14:26 +0000 (15:14 -0400)]
Make use of dwarf_aggregate_size to find size attr of types

When trying to probe go lang structure pointers, was getting
"cannot find byte_size attribute" errors. This patch fixes
that issue by using the dwarf_aggregate_size function in
elfutils.

5 years agoruntime: stp_tracepoint_module_notifier rc change
Frank Ch. Eigler [Mon, 24 Jun 2019 21:05:53 +0000 (17:05 -0400)]
runtime: stp_tracepoint_module_notifier rc change

Some LKML traffic indicates NOTIFY_OK may be better than NOTIFY_DONE (0)
to return in a routine success case.  Following suit for this site.
OTOH leaving another instance in runtime/linux/symbols.c alone for now.

https://lkml.org/lkml/2019/6/24/880

Reported-By: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 years agoPR11353: enable probe elision optimization
Sagar Patel [Fri, 7 Jun 2019 15:36:07 +0000 (11:36 -0400)]
PR11353: enable probe elision optimization

Previously, the compiler only issued warnings for probes with empty
handlers. With the new implementation, the compiler additionally
elides probes with empty handlers. The joining of probes to their
groups has been delayed until after this optimization is performed.

Many tests in the testsuite were built under the assumption that
probes with empty handlers are not elided. Consequently, many of
them stopped working and were fixed.

1) Removed probes with empty handlers from session.
2) Issued warnings whenever a probe is elided.
3) Added tests which check for correct probe elision.
4) Fixed tests affected by probe elision.
5) Updated NEWS.

5 years agostapbpf pr24528 :: new bpf embeddedcode /* userspace */ annotation
Serhei Makarov [Wed, 26 Jun 2019 20:26:20 +0000 (16:26 -0400)]
stapbpf pr24528 :: new bpf embeddedcode /* userspace */ annotation

* bpf-translate.cxx (bpf_unparser::visit_embeddedcode): guard against
  using embeddedcode blocks marked /* userspace */ in in-kernel BPF.

* tapset/bpf/context.stp (_stp_get_target): mark userspace-only.
* tapset/bpf/timestamp_gtod.stp (__gtod_get_ns): mark userspace-only.

5 years agostapbpf PR24543 oops in previous commit (mark_active_cpus)
Serhei Makarov [Mon, 24 Jun 2019 18:42:30 +0000 (14:42 -0400)]
stapbpf PR24543 oops in previous commit (mark_active_cpus)

5 years agoPR24543 just-in-case fix :: stapbpf breaks when cpu0 is disabled
Serhei Makarov [Mon, 24 Jun 2019 18:19:16 +0000 (14:19 -0400)]
PR24543 just-in-case fix :: stapbpf breaks when cpu0 is disabled

Certain perf_events constructs created by stapbpf must be pinned to
one cpu, it doesn't matter which. Previously cpu0 was used.

*Very rarely* it's possible for cpu0 to be disabled.
(It's not recommended,

In that case stapbpf will fail with a super confusing error.

This patch improves readability and allows stapbpf to use a fallback cpu.
cpu0 is still preferred whenever available.

* stapbpf/stapbpf.cxx (default_cpu): New global.
  (mark_active_cpus): Set default_cpu, prefer cpu0 whenever possible.
  (create_group_fds): Use default_cpu, not cpu0.
  (register_uprobes): Ditto.
  (register_kprobes): Ditto.
  (register_tracepoints): Ditto.
  (register_timers): Ditto.
  (register_perf): Ditto.
  (load_bpf_file): Clarifying comment on when active cpu info is checked,
    use default_cpu for uctx bpf_transport_context.

5 years agoPR10280 :: revert prior fix as it does not work for all kernel configs
Serhei Makarov [Fri, 21 Jun 2019 22:02:32 +0000 (18:02 -0400)]
PR10280 :: revert prior fix as it does not work for all kernel configs

Will replace with a better fix only if I find a better solution.

5 years agostapbpf PR24528 housekeeping :: check for userspace-only constructs
Serhei Makarov [Fri, 21 Jun 2019 15:06:08 +0000 (11:06 -0400)]
stapbpf PR24528 housekeeping :: check for userspace-only constructs

And signal an error if they're used in the wrong locations.

* bpf-translate.cxx (bpf_unparser::visit_embeddedcode): comment
  noting future checking (we could mark tapset functions userspace-only).
  (bpf_unparser::visit_for_loop): userspace-only feature.
  (bpf_unparser::visit_foreach_loop): userspace-only feature.
  (bpf_unparser::emit_print_format): sprintf is userspace-only.
  (bpf_unparser::visit_stat_op): stats extraction is userspace-only.

* bpf-internal.h (enum bpf_target): clarify comment.

5 years agostap-prep: adapt to ubuntu 18.04
Frank Ch. Eigler [Fri, 21 Jun 2019 14:39:19 +0000 (10:39 -0400)]
stap-prep: adapt to ubuntu 18.04

The /proc/version_signature file has disappeared there; copying
Debian parse of /proc/version instead.

5 years agostapbpf PR24528 housekeeping :: introduce enum bpf_target
Serhei Makarov [Thu, 20 Jun 2019 17:14:39 +0000 (13:14 -0400)]
stapbpf PR24528 housekeeping :: introduce enum bpf_target

Some housekeeping work to allow generating different code for the
less-restrictive userspace BPF interpreter vs. the more-restrictive
in-kernel BPF JIT interpreter.

* bpf-internal.h (enum bpf_target): New enum to track target BPF version.
  (struct program::target): New field,
  tracks the BPF version this program is intended for.
  (struct program::program): Require target to be specified on creation.
* bpf-base.cxx (struct program::program): Initialize target field.

* bpf-translate.cxx (translate_bpf_pass): Specify targets of each program,
  for now begin/end probes are being emitted for userspace BPF,
  all other probes are being emitted for in-kernel BPF.

Down the line we may have a userspace timer probe (PR23477)..

5 years agoAdd ansi_colors and ansi_colors2 to list of bpf compatible examples.
William Cohen [Tue, 18 Jun 2019 16:44:21 +0000 (12:44 -0400)]
Add ansi_colors and ansi_colors2 to list of bpf compatible examples.

5 years agostapbpf PR23559 :: handle octal and hex escape codes
Serhei Makarov [Tue, 18 Jun 2019 16:28:30 +0000 (12:28 -0400)]
stapbpf PR23559 :: handle octal and hex escape codes

* bpf-translate.cxx (translate_escapes): handle numeric escapes.

5 years agostap hash.cxx PR10280 related fix :: also hash guru mode flag
Serhei Makarov [Mon, 17 Jun 2019 20:05:03 +0000 (16:05 -0400)]
stap hash.cxx PR10280 related fix :: also hash guru mode flag

Since PR10280 introduces the idea that guru-mode modules may be
built differently, we need to cache them separately from
non-guru-mode modules.

* hash.cxx (get_base_hash): Add guru-mode flag to hashed info.

5 years agostapbpf next.stp :: add diagnostic print for PR24659
Serhei Makarov [Mon, 10 Jun 2019 17:17:02 +0000 (13:17 -0400)]
stapbpf next.stp :: add diagnostic print for PR24659

5 years agoPR12025: use the decimal or hex format specifier respectively in
Sagar Patel [Wed, 5 Jun 2019 17:10:05 +0000 (13:10 -0400)]
PR12025: use the decimal or hex format specifier respectively in
the automatic printing of integers and pointers

Previously, the detailed types structures were not propagated to
global variables. Consequently, integers and pointers were both
printed using the hex format specifier. With the new implementation,
pointer and integer types can be differentiated.

1) Propagated detailed type structures to global variables.
2) Applied warning for potential type mismatch.
3) Added tests which check for hex and decimal format specifiers.

5 years agoAdd mmfilepage.stp to the list of examples that work with the bpf backend. wcohen/bpf_target
William Cohen [Fri, 7 Jun 2019 19:44:46 +0000 (15:44 -0400)]
Add mmfilepage.stp to the list of examples that work with the bpf backend.

5 years ago@count() and @sum() should provide 0 for empty entries
William Cohen [Fri, 7 Jun 2019 19:15:27 +0000 (15:15 -0400)]
@count() and @sum() should provide 0 for empty entries

When compiled with the bpf backend mmfilepage.stp would have a
segmentation fault when printing out recorded information in the probe
end.  This was cause by a foreach using an index from one global array
for other global arrays that did not have entries for some of those
indices.  The code computing the @count() and @sum() values did not
handle the situation where there were no statistics for that
particular index in the global array.  The proper default is that
@count() and @sum() in those cases should be 0.

5 years agoAdd support for the target() function and -x option for bpf backend.
William Cohen [Thu, 6 Jun 2019 18:28:47 +0000 (14:28 -0400)]
Add support for the target() function and -x option for bpf backend.

5 years agostapbpf PR24639 :: basic support for next statement
Serhei Makarov [Wed, 5 Jun 2019 20:28:12 +0000 (16:28 -0400)]
stapbpf PR24639 :: basic support for next statement

Only support next statement in probes (terminate probe),
not in functions (relates to not-supported overloading).

* bpf-translate.cxx (bpf_unparser::visit_next_statement): New method.
* testsuite/systemtap.bpf/bpf_tests/next_stp: New testcase.

5 years agoPR24343: fix uninitialized variable warning and empty output of stap -L for return...
Sagar Patel [Wed, 22 May 2019 20:09:19 +0000 (16:09 -0400)]
PR24343: fix uninitialized variable warning and empty output of stap -L for return probes

The uninitialized variable warning was caused by exit syscalls as they don't have
conventional return strings. The incorrect output of stap -L was caused by synthetic
probes created from @entry variables which resulted in miscalculation of the set
intersection check.

1) Set 'never' filters for exit syscalls.
2) Applied synthetic probe flag to filter out synthetic probes from the set intersection.
3) Added tests which check for correct flagging of synethic probes.

5 years agoAdd aarch64 stapdyn support.
Stan Cox [Wed, 29 May 2019 02:53:14 +0000 (22:53 -0400)]
Add aarch64 stapdyn support.

* runtime/dyninst/regs.c (_stp_print_regs): New for aarch64
* runtime/dyninst/stapdyn.h (struct pt_regs): New for aarch64 since
  asm/ptrace.h does not define it.
* runtime/dyninst/uprobes-regs.c (enter_dyninst_uprobe_regs):  Add aarch64.
* stapdyn/mutatee.cxx (get_dwarf_registers):  Add aarch64.

5 years agoAdd a couple more examples that now work with the bpf code generation:
William Cohen [Thu, 23 May 2019 20:41:18 +0000 (16:41 -0400)]
Add a couple more examples that now work with the bpf code generation:

  apps/libguestfs_log.stp
  network/sk_stream_wait_memory.stp

5 years agoProvide gettimeofday_* functions for bpf backend
William Cohen [Thu, 23 May 2019 18:46:34 +0000 (14:46 -0400)]
Provide gettimeofday_* functions for bpf backend

BPF has a helper function ktime_get_ns() that provides a nanosecond
time from the time that the machine was booted.  When working across
machines really want to have a timestamp based on gettimeofday.  This
new BPF backend tapset computes an offset and scaling to convert the
ktime_get_ns() values into gettimeofday_*().  This will allow easier
comparison of timestamped traces between machines.

5 years agoRHBZ1613157: support powerpc64 sdt.h rN,rM operand syntax
Frank Ch. Eigler [Tue, 21 May 2019 23:28:58 +0000 (19:28 -0400)]
RHBZ1613157: support powerpc64 sdt.h rN,rM operand syntax

This syntax appears in some ppc64le binaries, including of stap
itself.  It means the same thing as "0(rN,rM)" on other architectures.

5 years agoconfigury: make python*-config work on rhel6 again
Frank Ch. Eigler [Fri, 17 May 2019 15:32:15 +0000 (11:32 -0400)]
configury: make python*-config work on rhel6 again

commit 5dabffcf0e77d7479ad stopped searching for all hypothetical
variants of "python{2,}-config".  RHEL6 sports python2 binaries
but only a python-config, which was missed by that change.  Let's
return to searching for all these aliases.

Reported-By: <mcermak@redhat.com>
5 years agoMark helloworld as another test that can run as bpf.
William Cohen [Fri, 17 May 2019 14:37:20 +0000 (10:37 -0400)]
Mark helloworld as another test that can run as bpf.

5 years agotestsuite/systemtap.examples :: merge cachestat and cachestat_bpf
Serhei Makarov [Thu, 16 May 2019 21:27:43 +0000 (17:27 -0400)]
testsuite/systemtap.examples :: merge cachestat and cachestat_bpf

5 years agotestsuite/systemtap.examples :: add test_{,install}check_bpf tag to check.exp
Serhei Makarov [Thu, 16 May 2019 21:27:05 +0000 (17:27 -0400)]
testsuite/systemtap.examples :: add test_{,install}check_bpf tag to check.exp

5 years agostapbpf/bpfinterp.cxx (map_get_next_key) :: try to pass all warnings
Serhei Makarov [Wed, 15 May 2019 20:48:34 +0000 (16:48 -0400)]
stapbpf/bpfinterp.cxx (map_get_next_key) :: try to pass all warnings

turns out RHEL7 gcc did not understand __attribute__ ((nonstring)).
This code has extra paranoia in adding a NUL beyond the area
overwritten by strncpy. Switch from strncpy to memcpy since bpf
syscall is treating everything as opaque memory.

5 years agospin-rawhide: usability tweaks
Frank Ch. Eigler [Tue, 14 May 2019 01:44:34 +0000 (21:44 -0400)]
spin-rawhide: usability tweaks

Print & clean up the tmp directory, and tolerate absent changelog changes

5 years agoPR gdb/24541: tweak i386 sys/sdt.h register operand options
Frank Ch. Eigler [Tue, 14 May 2019 01:26:33 +0000 (21:26 -0400)]
PR gdb/24541: tweak i386 sys/sdt.h register operand options

PR gcc/80115 and gdb/24541 had a fight about how values stored in
registers with aliases (e.g. al, ax, rax) should be named.  We all
lost.  :-O

This patch tweaks the i386 controls to bias gcc toward wider aliases,
and adds a comment block explaining the situation.  Unfortunately,
cases still exist where a sys/sdt.h note consumer has to use
arch-specific heuristics to decode gcc's intent.

5 years agostapbpf fix for GCC9 :: use ((nonstring)) attr for map key buffers
Serhei Makarov [Mon, 13 May 2019 18:55:30 +0000 (14:55 -0400)]
stapbpf fix for GCC9 :: use ((nonstring)) attr for map key buffers

Newer gcc9 raises suspicions on copying BPF_MAXSTRINGLEN to
BPF_MAXSTRINGLEN_PLUS sized buffer. Tentative fix, worth reviewing
these issues further.

* stapbpf/bpfinterp.cxx (map_get_next_key): add
  __attribute__ ((nonstring)) to signal how buffers will be used.

5 years agosystemtap-service.8 man page typo
Carlos O'Donell [Mon, 13 May 2019 21:07:07 +0000 (17:07 -0400)]
systemtap-service.8 man page typo

conf.d files are named foo.conf

5 years agostapbpf.cxx: typo fix
Frank Ch. Eigler [Fri, 10 May 2019 12:21:29 +0000 (08:21 -0400)]
stapbpf.cxx: typo fix

5 years agostapbpf/stapbpf.cxx :: fix perf_fds packing code for non-contiguous CPUs
Serhei Makarov [Thu, 9 May 2019 20:47:22 +0000 (16:47 -0400)]
stapbpf/stapbpf.cxx :: fix perf_fds packing code for non-contiguous CPUs

Spotted an error, not the same error that Coverity thinks is happening.
Validity of perf_fds[cpu] (not perf_fds[i]) is indicated by cpus_active[cpu].
There are some additional issues I missed in new code since I first fixed the
code to work with noncontiguous CPUs.

* stapbpf/stapbpf.cxx (perf_event_loop): assign perf_fds[cpu], not perf_fds[i] !!,
maintain i -> cpu mapping to retrieve correct perf_header and transport_context.

5 years agostapbpf/stapbpf.cxx :: placate the gods of Coverity
Serhei Makarov [Thu, 9 May 2019 20:45:11 +0000 (16:45 -0400)]
stapbpf/stapbpf.cxx :: placate the gods of Coverity

* stapbpf/stapbpf.cxx (instantiate_maps): UNUSED_VALUE #if0 out unused code;
NEGATIVE_RETURNS handle error return from sysconf(_SC_NPROCESSORS_CONF),
previous sysconf fix was valid but it might make sense to print a warning.
(register_tracepoints): RESOURCE_LEAK close fd on read failure.

5 years agostapbpf/bpfinterp.cxx :: placate the gods of Coverity
Serhei Makarov [Thu, 9 May 2019 20:43:36 +0000 (16:43 -0400)]
stapbpf/bpfinterp.cxx :: placate the gods of Coverity

* bpf-internal.h (BPF_MAXSTRINGLEN_PLUS): new define, BPF_MAXSTRINGLEN+1.
* stapbpf/bpfinterp.cxx (map_get_next_key): BUFFER_SIZE_WARNING use bigger buffer.
(bpf_interpret): UNUSED_VALUE memset regs to 0x0,
OVERFLOW_BEFORE_WIDEN indicate in 32-bit LSH operation that widening is inappropriate.

5 years agoPR23074: fix guru mode issue with generated calls to register get/set
Jafeer Uddin [Thu, 9 May 2019 20:18:46 +0000 (16:18 -0400)]
PR23074: fix guru mode issue with generated calls to register get/set

5 years agostapbpf.cxx sysconf() coverity nit
Frank Ch. Eigler [Thu, 9 May 2019 13:22:08 +0000 (09:22 -0400)]
stapbpf.cxx sysconf() coverity nit

5 years agoupdate-docs pass
Frank Ch. Eigler [Tue, 7 May 2019 22:35:02 +0000 (18:35 -0400)]
update-docs pass

5 years agobegin next release work: bump version to Ultimate Answer
Serhei Makarov [Tue, 7 May 2019 21:21:39 +0000 (17:21 -0400)]
begin next release work: bump version to Ultimate Answer

5 years agosystemtap.spec: inconsequential(?) typo
Serhei Makarov [Tue, 7 May 2019 18:59:39 +0000 (14:59 -0400)]
systemtap.spec: inconsequential(?) typo

5 years agoNEWS, systemtap.spec :: bump release by 1d release-4.1
Serhei Makarov [Tue, 7 May 2019 14:36:41 +0000 (10:36 -0400)]
NEWS, systemtap.spec :: bump release by 1d

5 years agoNEWS :: 4.1 release is go
Serhei Makarov [Mon, 6 May 2019 18:21:12 +0000 (14:21 -0400)]
NEWS :: 4.1 release is go

5 years agoruntime: on kernels >= 4.0, multiple concurrent systemtap scripts
Frank Ch. Eigler [Mon, 6 May 2019 22:27:09 +0000 (22:27 +0000)]
runtime: on kernels >= 4.0, multiple concurrent systemtap scripts

This old kernel commit:

commit 190afd81e4a5f24d1db6c774ca7f18acde2fca30
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Sun Jan 25 13:55:55 2015 -0500

    debugfs: split the beginning and the end of __create_file() off

appears to have encoded duplicate $debugfs/systemtap directory
existence into an -EEXIST error code, which we didn't handle.
We now treat it as though it were NULL.  Tested on 5.1-rc7.

5 years agoexamples index regen
Frank Ch. Eigler [Mon, 6 May 2019 16:38:40 +0000 (12:38 -0400)]
examples index regen

5 years agoprerelease docs regen
Frank Ch. Eigler [Mon, 6 May 2019 16:35:58 +0000 (12:35 -0400)]
prerelease docs regen

5 years agoPRERELEASE content bump
Frank Ch. Eigler [Mon, 6 May 2019 16:25:09 +0000 (12:25 -0400)]
PRERELEASE content bump

5 years agocopyright year updates
Frank Ch. Eigler [Mon, 6 May 2019 16:18:06 +0000 (12:18 -0400)]
copyright year updates

5 years agoNEWS :: mention ktime_get_real_fast_ns() from commit e2e13220fb
Serhei Makarov [Mon, 6 May 2019 15:48:54 +0000 (11:48 -0400)]
NEWS :: mention ktime_get_real_fast_ns() from commit e2e13220fb

5 years agoNEWS :: mention BPF tapset functions
Serhei Makarov [Sat, 4 May 2019 20:41:07 +0000 (16:41 -0400)]
NEWS :: mention BPF tapset functions

5 years agoadd recent AUTHORS
Serhei Makarov [Sat, 4 May 2019 17:14:00 +0000 (13:14 -0400)]
add recent AUTHORS

5 years agoNEWS: document added support for unhandled DW_OP_GNU_parameter_ref
Jafeer Uddin [Fri, 3 May 2019 19:35:36 +0000 (15:35 -0400)]
NEWS: document added support for unhandled DW_OP_GNU_parameter_ref

5 years agostapbpf/stapbpf.8 :: update based on recent stapbpf work
Serhei Makarov [Fri, 3 May 2019 19:00:44 +0000 (15:00 -0400)]
stapbpf/stapbpf.8 :: update based on recent stapbpf work

5 years agoNEWS :: document recent stapbpf additions
Serhei Makarov [Fri, 3 May 2019 18:52:56 +0000 (14:52 -0400)]
NEWS :: document recent stapbpf additions

5 years agoNEWS :: fxi tyops
Serhei Makarov [Fri, 3 May 2019 18:46:03 +0000 (14:46 -0400)]
NEWS :: fxi tyops

5 years agoAllow preprocessor.exp test to work with 5.x kernels
William Cohen [Fri, 3 May 2019 18:44:31 +0000 (14:44 -0400)]
Allow preprocessor.exp test to work with 5.x kernels

5 years agostapbpf fixup for 4.1 :: typo in error message
Serhei Makarov [Fri, 3 May 2019 15:54:35 +0000 (11:54 -0400)]
stapbpf fixup for 4.1 :: typo in error message

5 years agostapbpf PR23476 fixup :: typo in stat2.stp testcase
Serhei Makarov [Fri, 3 May 2019 15:42:19 +0000 (11:42 -0400)]
stapbpf PR23476 fixup :: typo in stat2.stp testcase

5 years agostapbpf PR23476 :: add tests for stat array and foreach
Serhei Makarov [Fri, 3 May 2019 15:33:03 +0000 (11:33 -0400)]
stapbpf PR23476 :: add tests for stat array and foreach

5 years agostapbpf PR23476 :: enable foreach iteration for stat arrays
Serhei Makarov [Fri, 3 May 2019 15:32:20 +0000 (11:32 -0400)]
stapbpf PR23476 :: enable foreach iteration for stat arrays

5 years agopr23476 fixup for 4.1 :: fix interned_aggregates layout
Serhei Makarov [Fri, 3 May 2019 15:29:56 +0000 (11:29 -0400)]
pr23476 fixup for 4.1 :: fix interned_aggregates layout

5 years agopr23476 fixup for 4.1 :: remove not-yet-supported tests
Serhei Makarov [Thu, 2 May 2019 21:37:51 +0000 (17:37 -0400)]
pr23476 fixup for 4.1 :: remove not-yet-supported tests

5 years agopr23476 fixup for 4.1 :: typo fix in array stat map auto-naming
Serhei Makarov [Thu, 2 May 2019 21:36:51 +0000 (17:36 -0400)]
pr23476 fixup for 4.1 :: typo fix in array stat map auto-naming

5 years agopr23476 fixup for 4.1 :: catch map_id < 0 in unexpected places
Serhei Makarov [Thu, 2 May 2019 21:20:06 +0000 (17:20 -0400)]
pr23476 fixup for 4.1 :: catch map_id < 0 in unexpected places

5 years agopr23476 fixup for 4.1 :: include bpf-shared-globals outside namespace
Serhei Makarov [Thu, 2 May 2019 21:19:27 +0000 (17:19 -0400)]
pr23476 fixup for 4.1 :: include bpf-shared-globals outside namespace

5 years agostapbpf PR23476 WIP (4/6) :: proof-of-concept statistic aggregates
Serhei Makarov [Fri, 12 Apr 2019 19:41:12 +0000 (15:41 -0400)]
stapbpf PR23476 WIP (4/6) :: proof-of-concept statistic aggregates

This is a preview version of the statistics aggregate feature
for inclusion in the stap 4.1 release. Only @sum, @count, @avg
operations are supported for the time being.

5 years agostapbpf PR23476 (3/6) :: add testcases
Serhei Makarov [Wed, 10 Apr 2019 17:16:50 +0000 (13:16 -0400)]
stapbpf PR23476 (3/6) :: add testcases

* testsuite/systemtap.bpf/bpf_tests/stat1.stp: Basic test (<<<, @count, @sum, @avg).
* testsuite/systemtap.bpf/bpf_tests/stat2.stp: Test stat arrays and foreach.
* testsuite/systemtap.bpf/bpf_tests/stat3.stp: Test delete and array-in.

5 years agostapbpf PR23476 (2/7) :: generate scalar+array stat aggregate declarations
Serhei Makarov [Tue, 9 Apr 2019 16:38:54 +0000 (12:38 -0400)]
stapbpf PR23476 (2/7) :: generate scalar+array stat aggregate declarations

* bpf-translate.cxx (translate_globals): Add a case for scalar pe_stats (init scalar stat maps),
add a case for array pe_stats (init a set of array stat maps),
pull out some duplicate code between stat and non-stat cases.
(output_maps): Add a separate case to give snazzy names to stat maps.

5 years agostapbpf PR23476 (1/7) :: redesign struct globals for stat aggregates
Serhei Makarov [Mon, 8 Apr 2019 16:46:04 +0000 (12:46 -0400)]
stapbpf PR23476 (1/7) :: redesign struct globals for stat aggregates

Modify struct globals to allow stats map slots (map_id = -1) and track a
set of percpu maps for each stat aggregate -- one map per field from struct stat_data.

* bpf-internal.h (struct globals): General redesign.
(globals::map_idx): New typedef to identify index of a map.
(globals::map_slot): New type (replacing pair<short,short>) with support for
marking a value's 'slot' as non-scalar (no index) and/or stats (no single map).
(globals::globals_map): Use map_slot type.
(globals::stat_field): New typedef to identify a stats field name.
(globals::stat_fields): The set of supported stats fields.
(globals::stat_iter_field): Stat field to use to obtain keys for foreach, in, &c.
(globals::stats_map): New typedef to identify one map per stats field.
(globals::scalar_stats): One map per stats field to represent scalar stats.
(globals::array_stats): One map per stats field per array to represent stats arrays.
(globals::internal_map_idx): Change type to globals::map_idx.
(globals::perf_event_map_idx): Change type to globals::map_idx.

Also take the first step to supporting stats map slots in bpf-translate.cxx:

* bpf-base.cxx (program::load_map): Guard against unimplemented uses of stats map slots.
* bpf-translate.cxx (bpf_unparser::emit_store): Use new map_slot type from globals_map.
(bpf_unparser::visit_foreach_loop): Ditto.
(bpf_unparser::visit_delete_statement): Ditto.
(bpf_unparser::visit_assignment): For now, explicitly mark <<< as unimplemented.
(bpf_unparser::visit_symbol): Use new map_slot type from globals_map.
(bpf_unparser::visit_arrayindex): Ditto.
(bpf_unparser::visit_array_in): Ditto.
(globals::stat_fields): Initialize globals::stat_fields with count, sum for now.
(globals::stat_iter_field): Initialize globals::stat_iter_field.
(output_maps): Use new map_slot type from globals_map, note requirement to support stats map slots.

NOTE: All of the above bpf-translate.cxx uses of map_slot will change
to also handle stats arrays in the next patches.

5 years agoForce correct order of evaluation of macro arguments in check_*register macros
William Cohen [Thu, 2 May 2019 14:41:59 +0000 (10:41 -0400)]
Force correct order of evaluation of macro arguments in check_*register macros

Noted that a number of tests were failing on x86 machines with errors
like the following:

ERROR: register access fault [man error::fault] near identifier 'module_name' at
 /usr/share/systemtap/tapset/linux/context.stp:392:10

The problem was traced to the maxregno argument for the macro having a
?: operator which has lower precedence than || or >.  This caused the
conditional tests in check_fetch_register and check_store_register for
error reporting to incorrectly trigger.  Used ()'s in the conditionals
to force the correct order of evaluation.

5 years agoruntime task_finder2: allocate large enough array for syscall_get_arguments() output
Frank Ch. Eigler [Wed, 1 May 2019 02:00:00 +0000 (02:00 +0000)]
runtime task_finder2: allocate large enough array for syscall_get_arguments() output

args [3] is too small on 5.1.0-5.rc5

5 years agoNEWS: mention pass-2 speedup
Frank Ch. Eigler [Tue, 30 Apr 2019 15:34:21 +0000 (11:34 -0400)]
NEWS: mention pass-2 speedup

5 years agorhbz1703264: use rpm boolean-dependencies for Recommends: kernel-*devel
Frank Ch. Eigler [Mon, 29 Apr 2019 16:08:24 +0000 (12:08 -0400)]
rhbz1703264: use rpm boolean-dependencies for Recommends: kernel-*devel

5 years agostapbpf test failures fix :: handle empty blocks in output_probe()
Serhei Makarov [Fri, 26 Apr 2019 14:12:37 +0000 (10:12 -0400)]
stapbpf test failures fix :: handle empty blocks in output_probe()

* bpf-translate.cxx (output_probe): Follow forwarder blocks to the
  first block that contains an instruction.

5 years agoPR23074: add support for unhandled DW_OP_GNU_parameter_ref in DWARF expression
Jafeer Uddin [Wed, 3 Apr 2019 19:23:36 +0000 (15:23 -0400)]
PR23074: add support for unhandled DW_OP_GNU_parameter_ref in DWARF expression

5 years agoAdjust syscall_get_arguments to match kernel's implementation
William Cohen [Tue, 23 Apr 2019 19:08:08 +0000 (15:08 -0400)]
Adjust syscall_get_arguments to match kernel's implementation

The syscall_get_argument function arguments changed due to
Linux git commit 32d9258662.  Remove the unused arguments
to match the expect arguments for syscall_get_arguments
when needed.

5 years agoDisable kprobe optimization again
William Cohen [Wed, 10 Apr 2019 18:55:05 +0000 (14:55 -0400)]
Disable kprobe optimization again

On x86 processors running linux 5.0 kernel the uprobes_onthefly.exp
test would trigger a RCU hang (PR24416).  Disable the kprobes
optimization until these problems reported in RHBZ1697531 get fixed in
the kernel.

5 years agodoc/Makefile: Fix command list syntax
David Ward [Mon, 11 Feb 2019 17:25:39 +0000 (12:25 -0500)]
doc/Makefile: Fix command list syntax

5 years agooverload.py: Fix python version 2/3 compatibility
David Ward [Mon, 11 Feb 2019 17:25:38 +0000 (12:25 -0500)]
overload.py: Fix python version 2/3 compatibility

The modified XML tree is outputted either as a bytearray with UTF-8
encoding in python version 3, or as a string in python version 2.
Handle this by writing the bytearray directly to sys.stdout.buffer,
or the string directly to sys.stdout, respectively.

Remove what appears to be "troubleshooting code" that was added in
commit 616ec7a0b, which dumps a large amount of unnecessary output
to stderr.

Call this script using the configured program name for python.

5 years agoconfigure: Fix handling of python versions 2 and 3
David Ward [Mon, 11 Feb 2019 17:25:37 +0000 (12:25 -0500)]
configure: Fix handling of python versions 2 and 3

When python version 2 is not found, AM_PROG_PYTHON sets the output
variable PYTHON to ":" (which is intentional; see "man 1P colon").
Fix incorrect tests that compared PYTHON to an empty string.

Use the same behavior for python version 3: when it is not found,
set the output variable PYTHON3 to ":" and test that accordingly.

Pass the variables "python3" and "py3execdir" to the subconfigure
unconditionally, just like the variables "python" and "pyexecdir".

When a program named "python" exists, fix a conditional that tests
if it is python version 3.

Do not guess the name of the python-config script. Simply append
"-config" to the program name for the python interpreter.

5 years agostapbpf.cxx (instantiate_maps) :: temporary fix for PR24324 pending better ideas
Serhei Makarov [Thu, 4 Apr 2019 15:58:33 +0000 (11:58 -0400)]
stapbpf.cxx (instantiate_maps) :: temporary fix for PR24324 pending better ideas

5 years agoregen po/* with update-po
Frank Ch. Eigler [Wed, 3 Apr 2019 23:55:12 +0000 (23:55 +0000)]
regen po/* with update-po

5 years agoPR24408 @{u,k}register(regno) index/context checking
Frank Ch. Eigler [Wed, 3 Apr 2019 23:51:38 +0000 (23:51 +0000)]
PR24408 @{u,k}register(regno) index/context checking

wcohen discovered that the (guru-mode) @*register operator doesn't
sufficiently check the context it is run in, possibly derefencing
null context->*regs pointers, or going out-of-bounds with register
numbering.  This code adds checking via a generic runtime/**/loc2c*
check_register_{fetch,store} macro.  It is used as a wrapper for
all architectures for both kernel and user register
fetch/store ops.

5 years agosession.cxx: bump kernel-tested version to 5.1-rc2
Frank Ch. Eigler [Mon, 1 Apr 2019 22:16:51 +0000 (18:16 -0400)]
session.cxx: bump kernel-tested version to 5.1-rc2

5 years agoAdd needed arch_syscall0_prefix define for arm64
William Cohen [Mon, 1 Apr 2019 15:25:06 +0000 (11:25 -0400)]
Add needed arch_syscall0_prefix define for arm64

On the x86_64 a functions that implement a syscall with no arguments
is used for both the 32-bit and 64-bit versions of the system call and
there are aliases for the same function.  To avoid having handlers run
twice the arch_syscall0_prefix only instruments the 64-bit versions.
However, this prefix was not being set for arm64 and on the arm64 the
syscalls with no arguments would fall back to the tracepoint versions.
Added the arch_syscall0_prefix define to have the syscall tapsets use
the non-dwarf function probes for those syscalls with no arguments on
arm64.

5 years agostapbpf interpreter improvement
Serhei Makarov [Mon, 1 Apr 2019 14:37:52 +0000 (10:37 -0400)]
stapbpf interpreter improvement

In order to ensure a more welcoming environment for vegans and cows,
all instances of 'deadbeef' in the stapbpf interpreter's memory space
have been replaced by an exhortation to 'ea7bee75' ('eat beets').

(Apr1)

5 years agoUpdate _stp_sockopt_optname_list[] to match current current socket.h defines
William Cohen [Sun, 31 Mar 2019 19:47:36 +0000 (15:47 -0400)]
Update _stp_sockopt_optname_list[] to match current current socket.h defines

There have been a number of updates and additions to the Linux
kernel's include/uapi/asm-generic/socket.h defines since the code in
aux_syscalls.stp for _stp_sockopt_optname_list[] was initially
created.  Defines such as SO_RCVTIMEO, SO_SNDTIMEO, and SO_TIMESTAMP
maybe be replaced by SO_RCVTIMEO_NEW, SO_SNDTIMEO_NEW, and
SO_TIMESTAMP_NEW.  Before this patch systemtap scripts would fail to
build with very new 5.1.0-rc kernels due to the missing defines.

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