]> sourceware.org Git - systemtap.git/log
systemtap.git
2 years agoUpdate syscall_any number<->name maps to include syscallent-common.h entries. wcohen/bpf_syscall_any_v2
William Cohen [Mon, 25 Oct 2021 15:32:46 +0000 (11:32 -0400)]
Update syscall_any number<->name maps to include syscallent-common.h entries.

Some syscalls information had been moved to syscallent-common.h in
the strace code.  Need to use the #include in the syscallent*.h files
to get those entries.

2 years agoPull in the includes to get strace syscall info from syscallent-common.h
William Cohen [Mon, 25 Oct 2021 15:23:47 +0000 (11:23 -0400)]
Pull in the includes to get strace syscall info from syscallent-common.h

There are now a number of syscall in strace that are described in
src/linux/generic/syscall-common.h which is pulled into a number of
different architecture syscallent*.h includes.  Don't want to miss
those additional syscalls in the mappings.

2 years agoAllow stopwatch example to run with bpf backend.
William Cohen [Mon, 11 Oct 2021 20:52:24 +0000 (16:52 -0400)]
Allow stopwatch example to run with bpf backend.

2 years agoAdd various tapset/bpf files (and links) to support syscall_any for BPF
William Cohen [Mon, 11 Oct 2021 20:46:02 +0000 (16:46 -0400)]
Add various tapset/bpf files (and links) to support syscall_any for BPF

2 years agoUpdate syscall_num.stp mappings between syscall number and name
William Cohen [Mon, 11 Oct 2021 20:26:06 +0000 (16:26 -0400)]
Update syscall_num.stp mappings between syscall number and name

Need to generate new versions of syscall_num.stp files that include
the preprocessor architecture guards so multiple syscall_num.stp
can be used by BPF code at the same time.

This is also using a more recent version of strace-code (ommit
940f7c9f71dd0514b933874c7b02230e0dd7dfd1) to include newer syscalls
in the mappings.

2 years agoAllow multiple architecture syscall_num.stp files to be used by bpf backend
William Cohen [Mon, 11 Oct 2021 20:17:41 +0000 (16:17 -0400)]
Allow multiple architecture syscall_num.stp files to be used by bpf backend

Systemtap's BPF still has the concept of target architecture and isn't
write once run anywhere for BPF code.  Thus, to make the syscall_any
tapset work the tapset needs to have all the different architecture
initialization code available and select the appropriate one based on
the architecture.  Thus, each syscalls_num.stp file has preprocessing
guards to make them empty unless the architecture matches.

2 years agoUpdate dump-syscalls.sh to work with newer strace-code
William Cohen [Mon, 11 Oct 2021 19:49:33 +0000 (15:49 -0400)]
Update dump-syscalls.sh to work with newer strace-code

There have been some changes in the strace-code:
-Header files now in strace-code/src/linux/*/syscallent.h
-mips headers use BASE_NR and file needs to be massaged to get numeric value
-corrected the name of riscv architecture name to riscv64

2 years agostaprun: don't colorize the space following the warning/error tags
Sultan Alsawaf [Mon, 4 Oct 2021 21:15:58 +0000 (14:15 -0700)]
staprun: don't colorize the space following the warning/error tags

Brings the colorization back in line with the old behavior.

2 years agostaprun: make the previous commit obey the color_errors switch again
Sultan Alsawaf [Mon, 4 Oct 2021 20:53:59 +0000 (13:53 -0700)]
staprun: make the previous commit obey the color_errors switch again

The color_errors check inside print_color() was not preserved. Fix it.

2 years agostaprun: fix warning/error/dbug eprintf() races causing garbled output
Sultan Alsawaf [Mon, 4 Oct 2021 19:09:32 +0000 (12:09 -0700)]
staprun: fix warning/error/dbug eprintf() races causing garbled output

There are lots of races when printing warnings/errors/dbugs in staprun
because multiple eprintf() calls are used to print a single message and
stderr is not line-buffered. As a result, warnings/errors/dbugs race with
the relayfs reader threads printing to stdout and with other stap scripts
running concurrently in the same PTY. This causes the messages printed to
stderr and stdout to be garbled.

Fix all of this by using a single eprintf() for each warning/error/dbug
message, and by making stderr line-buffered so that we don't need to worry
about differing libc implementations potentially flushing a single message
in chunks rather than flushing the whole message in one go.

2 years agoruntime: make _stp_vlog() more robust to avoid truncating log messages
Sultan Alsawaf [Thu, 30 Sep 2021 02:42:26 +0000 (19:42 -0700)]
runtime: make _stp_vlog() more robust to avoid truncating log messages

Currently, _stp_vlog() very readily drops or truncates warnings, errors,
and debug messages. In the case of warnings and errors, this is quite
problematic because these messages are of high importance and, as such,
are even sent to stapio via the control channel rather than the relay
transport.

The reason why _stp_vlog() truncates and even drops these messages so
easily is twofold: the normal print buffer is used directly without any
attempt to flush it when there isn't enough space and it's used as
temporary storage for warnings and errors.

When warnings and errors are sent to the control channel, they are
copied into a new buffer, which is wasteful due to the copy operation
and the effort put into scrounging for space in the print buffer.
Instead of using a temporary buffer to construct warnings and errors,
it's more reliable and efficient to construct the message in one of the
control channel's buffers that would've been used anyway to send the
message.

In the case of debug messages, the print buffer can take appropriate
steps to ensure there's enough space via _stp_reserve_bytes(). Now, the
length of a debug message is calculated before it's generated, making it
possible to use _stp_reserve_bytes().

Altogether, this makes _stp_vlog() very resistant to losing both normal
debug messages and high-priority warning and error messages.

2 years agoPR27829: Support floating point values passed through sdt.h markers
Stan Cox [Thu, 30 Sep 2021 20:11:29 +0000 (16:11 -0400)]
PR27829: Support floating point values passed through sdt.h markers

Add the type to the individual arg entries in the .notes.stapsdt section;
currently SP@A, where S is optional '-' sign, P is precision of type and A is
address.  Revised format is SPT@A where T is optional 'f' for float variables.
Add x8664 float registers xmm8 - xmm15 and aarch64 float registers v8 - v31.
Parse the type field; result is currently ignored.  asm statements are
restricted to 30 arguments; sdt probes can have up to 12 arguments.  To fit
this into a single asm statement, precision and type are encoded into a single
field: 0xSSTT where SS is the precision and TT is the type as encoded by
__builtin_classify_type.  The sign S, precision P, and type T are decoded by
_SDT_SIGN, _SDT_SIZE, and _SDT_TYPE.  Test that the revised
.notes.stapsdt section interacts correctly with eu-elfutils and gdb.

2 years agotestsuite traceaio.c
Nir Soffer [Wed, 29 Sep 2021 19:31:13 +0000 (15:31 -0400)]
testsuite traceaio.c

Add simple test program calling io_submit() with several iocbs, testing
handling or PWRITE, PREAD, PWRITEV, and PREADV.

The test can be run manually by compiling the program, running it with
"stap -c", and inspecting the generated trace.

With more work, this can be used in "make installcheck", and verified
using expected output file.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2 years agoFix traceaio with IO_CMD_{PREAD,PWRITE}
Nir Soffer [Wed, 29 Sep 2021 10:14:31 +0000 (06:14 -0400)]
Fix traceaio with IO_CMD_{PREAD,PWRITE}

IOCB_CMD_PREADV was used twice, skipping logging of iovecs for
IOCB_CMD_PWRITEV.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2 years agotraceaio example: tweak @cast and IOCB_CMD_*
Frank Ch. Eigler [Wed, 29 Sep 2021 08:48:22 +0000 (04:48 -0400)]
traceaio example: tweak @cast and IOCB_CMD_*

Make this test case operable without kernel debuginfo by using
@cast( ..., "kernel<header>") to extract iocb / iovec decls
from headers.  Rename IO_CMD_* values to IOCB_CMD_* to match
linux aio_abi.h

2 years agoFix traceaio with IO_CMD_{PREAD,PWRITE}
Nir Soffer [Wed, 29 Sep 2021 08:06:53 +0000 (04:06 -0400)]
Fix traceaio with IO_CMD_{PREAD,PWRITE}

When using IO_CMD_{PREAD,PWRITE} aio_nbytes is the size of a single
buffer aio_buf.

Previously the script logged unrelated memory contents from userspace:

[     0 sanlock(8214):] io_submit(140589225578496, 1, 0x7fdd5fefc718)
    iocb[   0]=0x7fdd58000b70, fd=16, opcode=0, offset=0, nbytes=1048576, buf=0x7fdd5c5f6000
        iovec[   0]=0x7fdd5c5f6000, base=0x3000412212010, len=16
        iovec[   1]=0x7fdd5c5f6010, base=0x0, len=1
        iovec[   2]=0x7fdd5c5f6020, base=0x1, len=16
        ...

Now we trace iovecs only when using IO_CMD_{PREADV,PWITEV}:

[     0 sanlock(8397):] io_submit(140589225566208, 1, 0x7fdd5e6f9718)
    iocb[   0]=0x7fdd48000b70, fd=19, opcode=0, offset=0, nbytes=1048576, buf=0x7fdd5c3f2000
[     0 sanlock(8397):] io_submit(140589225566208, 1, 0x7fdd5e6f9718)
    iocb[   0]=0x7fdd48000b70, fd=19, opcode=1, offset=512, nbytes=512, buf=0x7fdd4810a000

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2 years agoPR28384: convert more nfs_proc.stp server_ip to string
Frank Ch. Eigler [Fri, 24 Sep 2021 19:54:34 +0000 (15:54 -0400)]
PR28384: convert more nfs_proc.stp server_ip to string

This tapset variable has been changed in stap version 4.3
to a string.  Finish covering all instances in various
probe aliases.

2 years agoAdd traceaio example
Nir Soffer [Thu, 23 Sep 2021 00:28:03 +0000 (20:28 -0400)]
Add traceaio example

Show how to trace arguments to io_submit. This is useful to debug EINVAL
errors, for example when number of iovecs exceeds limits.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2 years agoCorrect RISC-V handling of SDT markers and document their format.
William Cohen [Tue, 14 Sep 2021 02:01:41 +0000 (10:01 +0800)]
Correct RISC-V handling of SDT markers and document their format.

2 years agoFix races in perf probe task finder callback
Sultan Alsawaf [Fri, 17 Sep 2021 21:17:16 +0000 (14:17 -0700)]
Fix races in perf probe task finder callback

The task finder callback for a perf probe can run concurrently across
different tasks' workers, resulting in redundant registrations since
_stp_perf_init() and _stp_perf_del() lack synchronization. This results
in the redundant perf events never being removed and a use-after-free
scenario occurring in the kernel's core perf code after the stap module
is unloaded. Adding a mutex lock to the task finder callback fixes the
issue.

This fixes the following crash:
BUG: unable to handle page fault for address: ffffffffc045a777
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 2a15067 P4D 2a15067 PUD 2a17067 PMD 1c4a96067 PTE 0
Oops: 0010 [#1] SMP NOPTI
CPU: 5 PID: 78029 Comm: cat Tainted: G           OE     5.13.9 #78
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ArchLinux 1.14.0-1 04/01/2014
RIP: 0010:0xffffffffc045a777
Code: Unable to access opcode bytes at RIP 0xffffffffc045a74d.
RSP: 0018:ffffc900001d8d80 EFLAGS: 00010046
RAX: ffffffffc045a777 RBX: ffff8881e60f2ee0 RCX: ffffc9000403fc18
RDX: ffffc9000403fc18 RSI: ffffc900001d8dc0 RDI: ffff8881e60f2ee0
RBP: ffffc900001d8db0 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000000 R11: ffffc900001d8ff8 R12: ffffc900001d8dc0
R13: 0000000000000000 R14: ffffc9000403fc18 R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff888237b40000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffc045a74d CR3: 0000000002a10005 CR4: 0000000000370ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 ? __perf_event_overflow+0x60/0xd7
 ? __perf_event_overflow+0xd7/0xd7
 perf_swevent_hrtimer+0xd3/0x147
 ? nohz_balancer_kick+0x35/0x221
 ? tick_sched_do_timer+0x5a/0x5a
 ? trigger_load_balance+0x41/0x54
 ? scheduler_tick+0x132/0x153
 ? __pv_queued_spin_lock_slowpath+0x115/0x1c1
 ? timerqueue_del+0x24/0x49
 ? __remove_hrtimer+0x3c/0x6c
 __run_hrtimer+0xd3/0x166
 __hrtimer_run_queues+0x67/0x76
 hrtimer_interrupt+0xea/0x21e
 local_apic_timer_interrupt+0x2e/0x54
 __sysvec_apic_timer_interrupt+0x6e/0xb2
 sysvec_apic_timer_interrupt+0x73/0x83
 </IRQ>
 asm_sysvec_apic_timer_interrupt+0x12/0x20

2 years agoThe /* pc=0x... */ is no longer printed by "stap -v -L 'kernel.function("*")'
Di Chen [Thu, 2 Sep 2021 04:52:47 +0000 (12:52 +0800)]
The /* pc=0x... */ is no longer printed by "stap -v -L 'kernel.function("*")'

The disappeared /* pc=0x... */ resulted from the missing implementation
of the function "dwarf_derived_probe::printsig_nonest".
Which makes "p->printsig_nonest(sig)" in main.cxx end up calling
"derived_probe::printsig_nonest", and the type of "p" is

(gdb) ptype /m p
type = /* real type = dwarf_derived_probe * */

This patch added "dwarf_derived_probe::printsig_nonest" for PC value
print.

https://sourceware.org/bugzilla/show_bug.cgi?id=27940

Signed-off-by: Di Chen <dichen@redhat.com>
2 years agoUse task_state tapset function to avoid task_struct changes
William Cohen [Tue, 14 Sep 2021 01:32:38 +0000 (21:32 -0400)]
Use task_state tapset function to avoid task_struct changes

The Linux 5.14 kernel's task_struct changed the state field to
__state.  The task_state tapset function selects the appropriate
version.  Make the scheduler.stp tapset and schedtimes.stp example use
the task_state function rather than directly trying to access the
task_struct state field (and get it wrong for newer kernels).

2 years agotapset: start adopting kernel netif_* tracepoints in netdev.* tapset
Frank Ch. Eigler [Fri, 10 Sep 2021 01:22:31 +0000 (21:22 -0400)]
tapset: start adopting kernel netif_* tracepoints in netdev.* tapset

Start with netdev.receive.

2 years agodwflpp.h: add conditional EM_RISCV define
Frank Ch. Eigler [Tue, 7 Sep 2021 13:50:43 +0000 (09:50 -0400)]
dwflpp.h: add conditional EM_RISCV define

.... for use on older elfutils

2 years agoAdd dwarfless register access for RISC-V
William Cohen [Sun, 15 Aug 2021 15:50:40 +0000 (23:50 +0800)]
Add dwarfless register access for RISC-V

2 years agoAdd bactrace support for RISC-V
William Cohen [Fri, 13 Aug 2021 00:58:07 +0000 (08:58 +0800)]
Add bactrace support for RISC-V

2 years agoRISC-V dwarf register number to pt_reg mappings
William Cohen [Thu, 12 Aug 2021 00:57:54 +0000 (08:57 +0800)]
RISC-V dwarf register number to pt_reg mappings

2 years agoEliminate the sa_restorer field in sigaction struct for RISC-V.
William Cohen [Sun, 27 Jun 2021 21:18:42 +0000 (05:18 +0800)]
Eliminate the sa_restorer field in sigaction struct for RISC-V.

2 years agoAvoid generating problematic asynchronous unwind tables on RISC-V
William Cohen [Mon, 17 May 2021 01:00:14 +0000 (09:00 +0800)]
Avoid generating problematic asynchronous unwind tables on RISC-V

By default SystemTap turns on the generations of asynchronous
unwind tables for all processor.  When this was enabled for RISC-V
kernel modules would be generated, but the resulting kernel modules
would fail to load because the kernel's module loader could not
handle the R_RISCV_32_PCREL relocations in the .ko files.
Disabling the asynchronous unwind tables for RISC-V is a
work around to get things functioning for RISC-V.

2 years agoAdd RISC-V 64-bit processor support
William Cohen [Mon, 17 May 2021 00:59:00 +0000 (08:59 +0800)]
Add RISC-V 64-bit processor support

2 years agoAdd the actual RISC-V syscall-number mappings to the tapsets.
William Cohen [Sun, 16 May 2021 23:16:31 +0000 (07:16 +0800)]
Add the actual RISC-V syscall-number mappings to the tapsets.

2 years agoAdd creation of mappings between syscall names and numbers for RISC-V
William Cohen [Sun, 16 May 2021 23:14:59 +0000 (07:14 +0800)]
Add creation of mappings between syscall names and numbers for RISC-V

2 years agoRISC-V doesn't have crash available, disable it for rpmbuilds.
William Cohen [Thu, 13 May 2021 21:29:16 +0000 (05:29 +0800)]
RISC-V doesn't have crash available, disable it for rpmbuilds.

2 years agoUpdate to newer config.guess to support RISC-V
William Cohen [Thu, 24 Jun 2021 14:27:05 +0000 (22:27 +0800)]
Update to newer config.guess to support RISC-V

2 years agoUse lex_cast instead of to_string when shortening function names.
Stan Cox [Mon, 30 Aug 2021 20:53:51 +0000 (16:53 -0400)]
Use lex_cast instead of to_string when shortening function names.

2 years agoRevert "runtime: unregister the control channel before cleaning up"
Sultan Alsawaf [Fri, 27 Aug 2021 21:00:26 +0000 (14:00 -0700)]
Revert "runtime: unregister the control channel before cleaning up"

This reverts commit dbe08f1acbdf47718a5f4c2a965b246c778eaac6.

There's a circular dependency because _stp_cleanup_and_exit() may send a
message over the control channel to indicate an issue, like with
_stp_warn(). The reordering thus causes this crash:

BUG: unable to handle kernel paging request at ffff8800ffffffff
IP: [<ffffffff81436c39>] __list_del_entry+0x29/0xd0
PGD 385f067 PUD 0
Oops: 0000 [#1] SMP
CPU: 14 PID: 28496 Comm: staprun-d Kdump: loaded Tainted: GF          OE  ------------ T 3.10.0-1127.19.1.el7.x86_64.debug #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20180531_142017-buildhw-08.phx2.fedoraproject.org-1.fc28 04/01/2014
task: ffff88016f948000 ti: ffff880055a88000 task.ti: ffff880055a88000
RIP: 0010:[<ffffffff81436c39>]  [<ffffffff81436c39>] __list_del_entry+0x29/0xd0
RSP: 0018:ffff880055a8bd18  EFLAGS: 00010006
RAX: ffff8800ffffffff RBX: ffff8800364d8b40 RCX: dead000000000200
RDX: ffff8800364d8cc0 RSI: ffffffffc116e204 RDI: ffff8800364d8b40
RBP: ffff880055a8bd18 R08: 0000000000000002 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8800364d8660
R13: ffff8800364d8678 R14: 0000000000000092 R15: 0000000000000000
FS:  00007fcdb6ff7780(0000) GS:ffff880237200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff8800ffffffff CR3: 000000015ed98000 CR4: 0000000000360fe0
DR0: ffffffffc044a0e0 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
 [<ffffffffc116e218>] _stp_mempool_alloc+0x38/0x80 [stap_b0934ab5a589458489ec9c296ca81d66_20480]
 [<ffffffffc1173114>] _stp_ctl_send+0xc4/0x350 [stap_b0934ab5a589458489ec9c296ca81d66_20480]
 [<ffffffffc1172ef3>] _stp_vlog.constprop.133+0xf3/0x1d0 [stap_b0934ab5a589458489ec9c296ca81d66_20480]
 [<ffffffffc1173034>] _stp_warn+0x64/0x80 [stap_b0934ab5a589458489ec9c296ca81d66_20480]
 [<ffffffffc1177b87>] _stp_cleanup_and_exit+0x367/0x410 [stap_b0934ab5a589458489ec9c296ca81d66_20480]
 [<ffffffffc117ea0a>] cleanup_module+0x1a/0xe0 [stap_b0934ab5a589458489ec9c296ca81d66_20480]
 [<ffffffff8115420e>] SyS_delete_module+0x19e/0x310
 [<ffffffff81895d3e>] tracesys+0xa6/0xcc

The original bug that the reorder attempted to fix is already fixed by
166a95089 ("runtime: fix panics when polling on the control channel
while unloading"). That commit doesn't allow delete_module() to run when
there are open file descriptors to the control channel, which guarantees
that the control channel cannot be in use during module cleanup. Thus,
we can simply restore the old ordering.

2 years agoruntime: fix panics when polling on the control channel while unloading
Sultan Alsawaf [Wed, 25 Aug 2021 02:27:43 +0000 (19:27 -0700)]
runtime: fix panics when polling on the control channel while unloading

When the stapio pselect() runs while the given stap module is unloading,
there's a use-after-free opportunity in do_select(). This occurs because
the control channel's poll function, _stp_ctl_poll_cmd(), passes a
pointer to a global variable along to do_select(), which can then
dereference the pointer after the stap module is unloaded.

Normally, this wouldn't be a problem because do_select() uses get_file()
and fput(), which respectively grab and release references to the module
owner specified in `file->f_op->owner`. However, procfs doesn't provide
any interface to pass in a module owner, and instead all procfs files
use an internal `struct file_operations` declared in fs/proc/inode.c.
As a result, we cannot bolster procfs files with module reference
count protection through any normal means, so we must inject a module
owner the hard way.

A module owner is now patched into the control channel's file ops when
the file is opened by making a copy of the existing file ops and then
setting the module owner inside the copy, which then replaces the old
`file->f_op` pointer. This neatly fixes the race because procfs *does*
guarantee that none of the procfs callback functions are still running
after an entry is removed, and because _stp_ctl_poll_cmd() cannot be
reached without first passing through _stp_ctl_open_cmd().

Since delete_module() can now return EWOULDBLOCK, we must make staprun
aware that it's not a fatal error and that the module deletion should
be retried. EWOULDBLOCK simply indicates that a pselect() on the control
channel has yet to finish, so it will go away after a brief wait.

This fixes the following panic:
BUG: unable to handle kernel paging request at ffffffffc0914030
PGD 79820c067 P4D 79820c067 PUD 79820e067 PMD 3f9ee6067 PTE 0
Oops: 0002 [#1] SMP PTI
CPU: 6 PID: 1636475 Comm: stapio Kdump: loaded Tainted: G           OE     4.19.91-22.2.al7.x86_64 #1
RIP: 0010:_raw_spin_lock_irqsave+0x1e/0x40
RSP: 0018:ffffb9fb0e45f980 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000246 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffb9fb0e45faf0 RDI: ffffffffc0914030
RBP: ffffffffc0914030 R08: 0000000000000001 R09: ffff973fa8924000
R10: 0000000000000104 R11: 0000000000000041 R12: 0000000000000000
R13: ffffb9fb0e45fab0 R14: 000000000000000f R15: 000000000000000f
FS:  00007effdcf53740(0000) GS:ffff97409fb80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffc0914030 CR3: 0000000522d42003 CR4: 00000000003606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 remove_wait_queue+0x14/0x60
 poll_freewait+0x37/0xa0
 do_select+0x650/0x740
 ? compat_poll_select_copy_remaining+0x110/0x110
 ? kvm_sched_clock_read+0xd/0x20
 ? sched_clock+0x5/0x10
 ? sched_clock_cpu+0xc/0xa0
 ? select_idle_sibling+0x28/0x400
 ? account_entity_enqueue+0x9c/0xd0
 ? enqueue_entity+0x71f/0xc80
 ? __switch_to_asm+0x35/0x70
 ? enqueue_task_fair+0xd2/0x9b0
 ? remove_entity_load_avg+0x27/0x70
 ? check_preempt_curr+0x6b/0x90
 ? ttwu_do_wakeup+0x19/0x150
 ? try_to_wake_up+0x219/0x580
 core_sys_select+0x1e2/0x320
 ? audit_filter_inodes+0x1f/0xf0
 ? audit_filter_syscall.constprop.11+0x8c/0xd0
 ? __audit_syscall_exit+0x1fd/0x290
 ? kvm_clock_get_cycles+0xd/0x10
 ? ktime_get_ts64+0x46/0xf0
 __se_sys_pselect6+0xf6/0x1b0
 do_syscall_64+0x5b/0x1b0
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

2 years agoShorten function names that will exceed the kernel's objtool limit of 128
Stan Cox [Thu, 26 Aug 2021 13:46:20 +0000 (09:46 -0400)]
Shorten function names that will exceed the kernel's objtool limit of 128

translate.cxx (c_unparser::emit_global_init_type,emit_function) Shorten
 (c_unparser::c_funcname)  Add funcname_shortened parm, shorten
 name if length limit exceeded

testsuite/systemtap.base/func_definition.{exp,stp}  Add shorten funcname test.

2 years agoruntime/transport: add a comment blurb for ordering invariant at shutdown
Frank Ch. Eigler [Wed, 25 Aug 2021 23:00:42 +0000 (19:00 -0400)]
runtime/transport: add a comment blurb for ordering invariant at shutdown

2 years agoruntime: unregister the control channel before cleaning up
Sultan Alsawaf [Wed, 25 Aug 2021 22:46:26 +0000 (15:46 -0700)]
runtime: unregister the control channel before cleaning up

The control channel can still be in use when clean-up occurs, resulting
in a race that's made apparent by these warnings:
------------[ cut here ]------------
double register detected
WARNING: CPU: 10 PID: 47720 at kernel/notifier.c:27 notifier_chain_register+0x35/0x50
 [last unloaded: stap_7cfd458d8a2c43a8bc8489143978f8_47593]
CPU: 10 PID: 47720 Comm: stapio Tainted: G        W  OE     5.12.13-200.fc33.x86_64 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ArchLinux 1.14.0-1 04/01/2014
RIP: 0010:notifier_chain_register+0x35/0x50
RSP: 0018:ffffc26e4316be58 EFLAGS: 00010092
RAX: 0000000000000018 RBX: 0000000000027348 RCX: ffff9fd837c985c8
RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff9fd837c985c0
RBP: ffffffffae531550 R08: 0000000000000000 R09: ffffc26e4316bc88
R10: ffffc26e4316bc80 R11: ffffffffadb45f68 R12: ffffffffc08bf1c0
R13: 0000000000000286 R14: 0000000000000000 R15: 0000000000000001
FS:  00007f1414a23740(0000) GS:ffff9fd837c80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f13ff4e1ef8 CR3: 000000000d92e005 CR4: 0000000000370ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 atomic_notifier_chain_register+0x24/0x40
 _stp_ctl_write_cmd+0x55c/0x9b0 [stap_7cfd458d8a2c43a8bc8489143978f8_47720]
 ? proc_reg_write+0x51/0x90
 ? vfs_write+0xc3/0x270
 ? ksys_write+0x4f/0xc0
 ? do_syscall_64+0x33/0x40
 ? entry_SYSCALL_64_after_hwframe+0x44/0xae
---[ end trace 5a8ca3c0eab5e3b6 ]---

This can be easily reproduced by having a background thread quickly loop
on trying to rmmod any stap modules, resulting in the module's exit
routine running concurrently with the STP_START command from stapio.

Closing the control channel before attempting clean-up fixes this race.

2 years agobpf pr23478 :: test non-unique key/val iteration
Serguei Makarov [Tue, 24 Aug 2021 16:44:30 +0000 (12:44 -0400)]
bpf pr23478 :: test non-unique key/val iteration

2 years agobpf pr23478 :: test multi-key associative array iteration
Serguei Makarov [Tue, 24 Aug 2021 16:15:19 +0000 (12:15 -0400)]
bpf pr23478 :: test multi-key associative array iteration

2 years agorhbz1938312: un-disable bpf.exp after kernel bugfix
Serguei Makarov [Fri, 6 Aug 2021 15:00:55 +0000 (11:00 -0400)]
rhbz1938312: un-disable bpf.exp after kernel bugfix

Some overzealous audit checking caused kernel deadlock when probing
sensitive tracepoints. The rhbz lists the problem as fixed in 5.12.10.

2 years agopr23478 WIP: fixes for existing foreach testcases
Serguei Makarov [Thu, 5 Aug 2021 16:10:32 +0000 (12:10 -0400)]
pr23478 WIP: fixes for existing foreach testcases

2 years agopr23478 WIP: rework bpf foreach to handle multi-key array
Serhei Makarov [Fri, 30 Jul 2021 17:07:31 +0000 (13:07 -0400)]
pr23478 WIP: rework bpf foreach to handle multi-key array

The major addition is a new ELF section giving details on each
foreach loop in the program, including where the sort column
is located within a composite key.

Previously all the foreach info was packed into a uint64_t
flags parameter to stapbpf's map_get_next_key userspace-only
helper function, which would not work for this nor for future
foreach work (sort_aggr, array slicing).

* bpf-internal.h (BPF_MAXKEYLEN,BPF_MAXKEYLEN_PLUS): new const.
(SORT_FLAGS etc): deprecate, but still read from old .bo files.
(globals::foreach_info): new struct with info for bpfinterp.cxx.
(globals::foreach_loop_info): vector of foreach_info structs.
(typedef interned_foreach_info): serialized foreach_info.
({intern,deintern}_loop_info): [de]serialize foreach_info.
(loop_idx): alias for index into foreach_loop_info vector.
* bpf-shared-globals.h ({intern,deintern}_loop_info): crudely
[de]serialize foreach_info by putting the fields in a vector.

* bpf-translate.cxx (bpf_unparser::visit_foreach_loop): change
to generate foreach_info, handle multi-key array iteration.
(output_foreach_info): serialize foreach_loop_info into a
new 'stapbpf_foreach_loop_info' ELF section.
(translate_bpf_pass): add 'stapbpf_foreach_loop_info' ELF section.

* stapbpf/stapbpf.cxx (foreach_loop_info): global table
of foreach loop information.
(load_bpf_file): load 'stapbpf_foreach_loop_info' ELF section.
(init_perf_transport): add foreach_loop_info to bpf_transport_context.
(main): add foreach_loop_info to bpf_transport_context.
* stapbpf/bpfinterp.h (struct bpf_transport_context): add
field for storing foreach_loop_info data.
(bpf_transport_context::bpf_transport_context): add
field for storing foreach_loop_info data.

* stapbpf/bpfinterp.cxx (struct foreach_state): represent an
in-progress foreach loop iteration including sorted values.
(foreach_info): alias for bpf::globals::foreach_info.
(foreach_state_add): new function.
(foreach_cmp_{str,int}): new functions.
(foreach_state_sort): new function.
(foreach_state_empty): new function.
(convert_key): new function.
(_foreach_state_next,foreach_state_next): new functions.
(foreach_state_cleanup): new function. Avoid C++ destructor.
(typedef foreach_stack): stack of foreach_state, used for
handling nested foreach loop iteration.
(map_get_next_key): rewrite to use foreach_info,foreach_state
and handle multi-key arrays (storing large keys in map_values).
(bpf_interpret): pass map_values to map_get_next_key, to be
used for storing composite keys in addition to values.
(struct map_keys): replaced by struct foreach_state.
(convert_{int,str}_{key,kp}): deleted functions.
(convert_{key,kp}): deleted functions.
(computed_key_size): deleted function.
(map_sort,map_next): deleted functions.

2 years agoRun task_fd_lookup.exp with --compatible 4.0
Stan Cox [Thu, 19 Aug 2021 15:25:53 +0000 (11:25 -0400)]
Run task_fd_lookup.exp with --compatible 4.0

Running in --compatible 4.0 mode forces @cast(0, "mount")->mnt_parent
to focus on the kernel module.

2 years agoPR28184: Adapt to kernel rename __fcheck_files to files_lookup_fd_raw
Junlong Li [Fri, 6 Aug 2021 21:41:53 +0000 (17:41 -0400)]
PR28184: Adapt to kernel rename __fcheck_files to files_lookup_fd_raw

The 5.11 kernel renamed __fcheck_files to files_lookup_fd_raw

2 years agoPR28184: Adapt to kernel rename __fcheck_files to files_lookup_fd_raw
Junlong Li [Fri, 6 Aug 2021 18:24:12 +0000 (14:24 -0400)]
PR28184: Adapt to kernel rename __fcheck_files to files_lookup_fd_raw

The 5.11 kernel renamed __fcheck_files to files_lookup_fd_raw

2 years agotestsuite: time-limit auxiliary child processes
Frank Ch. Eigler [Fri, 6 Aug 2021 16:16:21 +0000 (12:16 -0400)]
testsuite: time-limit auxiliary child processes

The testsuite has been observed to intermittently hang on 5.13+
generation kernels.  This is caused by some test binaries (especially
recv*.c) suffering a segv and terminating, but their forked child
process pals still hanging around (indefinitely).  This patch adds an
alarm(30) to each such test, so the children will burn twice as
bright, but half as long, or something.

2 years agostapbpf bugfix: missing in_block() in try-catch code
Serguei Makarov [Fri, 30 Jul 2021 20:22:53 +0000 (16:22 -0400)]
stapbpf bugfix: missing in_block() in try-catch code

After emit_stmt(), we may not be in a block, e.g. if we do

try { return 0 } catch { return 1 }

Also added an assert to make the error more obvious
if it's missed anywhere else. Was a non obvious segfault.

2 years agoreleng: ditch custom pie/ssp CFLAGS engine in configure.ac
Frank Ch. Eigler [Mon, 26 Jul 2021 19:49:15 +0000 (15:49 -0400)]
releng: ditch custom pie/ssp CFLAGS engine in configure.ac

Just inherit the desired c*flags from autoconf via environment
variables from the distro spec files.  This lets us automatically
benefit from centralized hardening flags on some distros.  OTOH
distros without that now will need to add such settings to the build
scripts that invoke this configure script.

2 years agoPR28079: Adapt to kernel 5.14 task_struct.__state change
Frank Ch. Eigler [Mon, 19 Jul 2021 01:32:51 +0000 (21:32 -0400)]
PR28079: Adapt to kernel 5.14 task_struct.__state change

In tapset, use @choose_defined() for old & new field names.

2 years agoruntime: adapt to -Werror=implicit-fallthrough=5, dyninst runtime
Frank Ch. Eigler [Mon, 26 Jul 2021 02:35:59 +0000 (22:35 -0400)]
runtime: adapt to -Werror=implicit-fallthrough=5, dyninst runtime

The runtime/dyninst/runtime.h also needs a fallthrough macro def'n.

2 years agoPR28140: kernel 5.14-rc adaptation, jump_label_patch
Frank Ch. Eigler [Mon, 26 Jul 2021 02:09:18 +0000 (22:09 -0400)]
PR28140: kernel 5.14-rc adaptation, jump_label_patch

Linux commit ab3257042c2 makes it necessary for us to stop overriding
CONFIG_STACK_VALIDATION= (originally a workaround for a 2016 rawhide
bug).  This fixes the tracepoints.stp test case.

2 years agoruntime: adapt to -Werror=implicit-fallthrough=5
Frank Ch. Eigler [Thu, 22 Jul 2021 23:16:12 +0000 (19:16 -0400)]
runtime: adapt to -Werror=implicit-fallthrough=5

Linux kbuild commit d936eb23874 sets $subject CFLAGS, so to play
catch-up, we also need to use gcc attribute(fallthrough) to label such
spots in switch() statements in our runtime / tapset.  Tested on
linux5.14 gcc11 rawhide and linux3.10 gcc4 rhel7.

2 years agoRevert to using test_tsk_thread_flag for uprobes2
Stan Cox [Thu, 22 Jul 2021 11:39:10 +0000 (07:39 -0400)]
Revert to using test_tsk_thread_flag for uprobes2

_stp_is_compat_task is not required for uprobes2 since uprobes2 is only used
for rhel6 and rhel7.

2 years agoPR27984: Adjust the address so dwfl_module_addrinfo finds correct function name
William Cohen [Tue, 20 Jul 2021 15:32:27 +0000 (11:32 -0400)]
PR27984: Adjust the address so dwfl_module_addrinfo finds correct function name

PR27984 discovered that the logic to determine when a location was
part of a partially inlined function was not operating correctly for
shared libraries.  The existing systemtap.base/partial-inline.exp
verified that the test worked for executables, but shared libraries
include a non-zero bias that needs to be added in. Added code to get
the required bias and add it to the address so the correct name is
returned by dwfl_module_addrinfo.

3 years agoPR28079: Adapt to kernel 5.14 task_struct.__state change
Stan Cox [Mon, 19 Jul 2021 01:32:51 +0000 (21:32 -0400)]
PR28079: Adapt to kernel 5.14 task_struct.__state change

Use signal_wake_up_state for the 5.14 kernel which changed volatile long state to unsigned int __state.

3 years agotestsuite item typo fix
Frank Ch. Eigler [Fri, 16 Jul 2021 15:49:12 +0000 (11:49 -0400)]
testsuite item typo fix

3 years agoPR27934: give fuller diagnosis for pass-5 probe-registration errors
Frank Ch. Eigler [Wed, 14 Jul 2021 20:44:46 +0000 (16:44 -0400)]
PR27934: give fuller diagnosis for pass-5 probe-registration errors

While we cannot solve or prevent runtime probe registration errors, we
can help users understand them.  Add a new warning::pass5 man page,
and point registration error messages at it.

3 years agoPR27820 tapset/bpf/logging.stp: implement abort() tapset function
Serhei Makarov [Wed, 14 Jul 2021 15:52:11 +0000 (11:52 -0400)]
PR27820 tapset/bpf/logging.stp: implement abort() tapset function

A more obsessively accurate implementation would add a check
equivalent to if (c->aborted) to the start of each probe,
but it would be an imperfect solution in any case.

3 years agoPR27820 tapset/bpf/logging.stp: move bpf versions of functions
Serhei Makarov [Tue, 13 Jul 2021 19:56:37 +0000 (15:56 -0400)]
PR27820 tapset/bpf/logging.stp: move bpf versions of functions

Follows the same scheme as what I instituted earlier for the
uconversions.stp tapsets: toplevel has functions common to
all 3 backends or common to lkm+dyninst (guarded by a
runtime != "bpf" conditional). BPF implementations are
moved to tapset/bpf.

* tapset/bpf/logging.stp: New file.
* logging.stp: Move bpf versions of functions.

3 years agoruntime: linux 5.14 compat: <linux/panic_notifier.h>
Frank Ch. Eigler [Tue, 13 Jul 2021 23:34:50 +0000 (19:34 -0400)]
runtime: linux 5.14 compat: <linux/panic_notifier.h>

Linux commit f39650de687e3 moved some kernel decls around.

3 years agoruntime: fix unintended compile error with autoconf-x86-uniregs.c
Du Zhe [Tue, 13 Jul 2021 23:11:55 +0000 (19:11 -0400)]
runtime: fix unintended compile error with autoconf-x86-uniregs.c

Adding a #include <linux/sched.h> restores this test on the gentoo
linux-5.10.47-gentoo kernel.

3 years agoRevert "systemtap.spec: don't buildrequire emacs"
Frank Ch. Eigler [Tue, 13 Jul 2021 18:46:29 +0000 (14:46 -0400)]
Revert "systemtap.spec: don't buildrequire emacs"

We need an emacs package - just for the RPM directory-setting macros.

3 years agospin-rawhide: ok tweak the git-archive top level path too
Frank Ch. Eigler [Tue, 13 Jul 2021 18:34:31 +0000 (14:34 -0400)]
spin-rawhide: ok tweak the git-archive top level path too

3 years agospin-rawhide: switch to ~ versioning for Source: file names too
Frank Ch. Eigler [Tue, 13 Jul 2021 18:27:27 +0000 (14:27 -0400)]
spin-rawhide: switch to ~ versioning for Source: file names too

3 years agospin-rawhide: switch to ~ versioning for n-v-r
Frank Ch. Eigler [Tue, 13 Jul 2021 17:52:53 +0000 (13:52 -0400)]
spin-rawhide: switch to ~ versioning for n-v-r

The previous scheme used systemtap-V-0.STUFF numbering.
Now instead systemtap-V~preSTUFF-1 numbering, with a little less stuff.

3 years agotask_finder_vma: add autoconf check for hlist_add_tail_rcu()
Sultan Alsawaf [Mon, 12 Jul 2021 20:31:36 +0000 (15:31 -0500)]
task_finder_vma: add autoconf check for hlist_add_tail_rcu()

The 3.10 version check for hlist_add_tail_rcu() only works for RHEL
kernels. Kernels older than 4.7 that lack the hlist_add_tail_rcu() backport
won't compile (such as Debian kernels). Add an autoconf stub to know for
certain if hlist_add_tail_rcu() is present.

3 years agoDon't fail vma tracking mmap callback if module is already known.
Sultan Alsawaf [Mon, 12 Jul 2021 20:01:57 +0000 (16:01 -0400)]
Don't fail vma tracking mmap callback if module is already known.

An -EEXIST returned by stap_add_vma_map_info() just indicates that the
module is currently in stap's vma cache; it isn't a real issue. Calling
_stp_error() when this occurs causes stap to exit when there isn't a
real bug. Ignore the -EEXIST error to avoid breakage.

3 years agoUse the path instead of the module for vma tracking mmap callback.
Junlong Li [Mon, 12 Jul 2021 19:48:42 +0000 (15:48 -0400)]
Use the path instead of the module for vma tracking mmap callback.

Use the path instead of the module for vma tracking mmap callback
since the module is usually NULL.

3 years agoupdate READMEs + man pages for freenode -> oftc move
Serguei Makarov [Thu, 8 Jul 2021 15:47:00 +0000 (11:47 -0400)]
update READMEs + man pages for freenode -> oftc move

This was done for the website, now do this in the actual codebase.

3 years agoUpdate list of reasons for latencytap.stp example
William Cohen [Tue, 6 Jul 2021 02:56:09 +0000 (22:56 -0400)]
Update list of reasons for latencytap.stp example

Backtraces change over time.  Added additional function names to
monitor in the backtrace and map to reasons.  This should reduce the
number of lines with blank reasons when using newer Linux kernels.

3 years agorhbz1972805: add basic syscall-in-ptregs support for s390x
Frank Ch. Eigler [Thu, 1 Jul 2021 18:41:06 +0000 (14:41 -0400)]
rhbz1972805: add basic syscall-in-ptregs support for s390x

Akin to commit 7be7af0fda36 for ARM, add basic syscalls via
tracepoints / CONTEXT->sregs support for s390x.  The argno=6 case is
funny because for syscalls they travel in registers, whereas normally
they hop onto the stack.

3 years agosystemtap.spec: don't Require: libvirt
Frank Ch. Eigler [Thu, 24 Jun 2021 20:03:50 +0000 (16:03 -0400)]
systemtap.spec: don't Require: libvirt

Remove unnecessary dependency.  The -runtime-virthost subrpm just
needs the libvirt shared libraries, and not the libvirt server
machinery.

3 years agorhbz1972828: tapsets: iommu tracepoints
Frank Ch. Eigler [Thu, 24 Jun 2021 17:30:38 +0000 (13:30 -0400)]
rhbz1972828: tapsets: iommu tracepoints

Disable detection of intel-iommu tracepoint family on non-x86
platforms, because the 5.13ish kernel headers for this tracepoint
include references to functions like clcache_flush_range which don't
exist on all non-x86.

3 years agoppc64 runtime: FULL_REGS() gone
Frank Ch. Eigler [Thu, 24 Jun 2021 00:16:52 +0000 (20:16 -0400)]
ppc64 runtime: FULL_REGS() gone

Adapt to kernel commit 8dc7f0229b78, which dropped the titular macro
from ppc64 ptrace.h header.

3 years agoc++ buildability: util.cxx - unique_ptr
Frank Ch. Eigler [Fri, 18 Jun 2021 19:17:02 +0000 (15:17 -0400)]
c++ buildability: util.cxx - unique_ptr

Add a #include <memory> that may be necessary on some unusual c++ compilers.

3 years agosystemtap.spec: don't buildrequire emacs
Frank Ch. Eigler [Fri, 11 Jun 2021 16:30:26 +0000 (12:30 -0400)]
systemtap.spec: don't buildrequire emacs

We don't run emacs during the build, so don't BuildRequire: it.

3 years agoAllow for adjacent segments belonging to different modules.
Junlong Li [Wed, 9 Jun 2021 13:49:14 +0000 (09:49 -0400)]
Allow for adjacent segments belonging to different modules.

Do not merge adjacent memory segments if they are from different
shared libraries that happen to be loaded adjacent to each other.

3 years agoNote that Python is a requirement.
Sevan Janiyan [Sun, 30 May 2021 23:17:12 +0000 (23:17 +0000)]
Note that Python is a requirement.

3 years agoGet the enumerator's enumeration type
Stan Cox [Thu, 3 Jun 2021 21:19:49 +0000 (17:19 -0400)]
Get the enumerator's enumeration type

Enumeration values are ultimately treated as constants but the path:
literal_stmt_for_local -> find_variable_and_frame_base (-> dwarf_get_enum)
-> translate_final_fetch_or_store often assume there is a
type die. Have dwarf_get_enum also get the type from the enumeration
type and percolate it along.

3 years agotestsuite/systemtap.base/perf.sh drop bashism
Sevan Janiyan [Wed, 2 Jun 2021 18:55:53 +0000 (14:55 -0400)]
testsuite/systemtap.base/perf.sh drop bashism

You don't need to use == to check for equality in a test statement, a
single equals sign is sufficient. The use of double equals sign is a
bashism which doesn't always translate as intended on other shells.

[fche checked other scripts in the source tree that used [ == ]; they
are all marked /bin/bash so can stay as is.]

3 years agoAdd hlist macros for use by hlist_add_tail_rcu
Stan Cox [Wed, 2 Jun 2021 17:37:45 +0000 (13:37 -0400)]
Add hlist macros for use by hlist_add_tail_rcu

3 years agoparse.cxx: Initialize functioncall synthetic field
Alexandra Hájková [Wed, 2 Jun 2021 17:01:26 +0000 (13:01 -0400)]
parse.cxx: Initialize functioncall synthetic field

Quieting complaints from:

% valgrind --track-origins=yes stap -v -p2 --example helloworld.stp

3 years agoAdd hlist_add_tail_rcu for rhel 6.
Stan Cox [Tue, 1 Jun 2021 14:03:26 +0000 (10:03 -0400)]
Add hlist_add_tail_rcu for rhel 6.

hlist_add_tail_rcu is not present in rhel 6

3 years agoDon't assume ISO C99
Stan Cox [Thu, 27 May 2021 20:38:23 +0000 (16:38 -0400)]
Don't assume ISO C99

3 years agoExtend vma mapped entries when the address is adjacent.
Junlong Li [Thu, 27 May 2021 14:31:20 +0000 (10:31 -0400)]
Extend vma mapped entries when the address is adjacent.

When two segments are adjacent, extend the first to contain the second
instead of adding another entry.

3 years agostap-prep: switch to using main vmlinuz file as debuginfod test download
Frank Ch. Eigler [Sun, 23 May 2021 18:12:32 +0000 (14:12 -0400)]
stap-prep: switch to using main vmlinuz file as debuginfod test download

Using the vdso* files only as the debuginfod tests gives us false
positives on platforms where the install vmlinuz files cannot be used
as a basis for debuginfod queries, because they're not elf nor
compressed-elf.  This new stap-prep tries to download the vmlinuz
debuginfo itself.  It's large, but at least once it's here, it's here!
And if it fails (as it will on those few platforms), the user is
advised to do full platform package-manager debuginfo download.

3 years agoPR27903: grok more glibc dwarf
Frank Ch. Eigler [Sun, 23 May 2021 17:13:20 +0000 (13:13 -0400)]
PR27903: grok more glibc dwarf

Some entry-value / parameter-ref combinations needed better error
resilience in the translator (set ->tok fields, not assuming
matches exist, etc.)

3 years agoc++11 hygiene: use cxx_override macro for pre-4.7 g++
Frank Ch. Eigler [Fri, 21 May 2021 00:45:15 +0000 (20:45 -0400)]
c++11 hygiene: use cxx_override macro for pre-4.7 g++

3 years agoFix more -Wformat-nonliteral and -Wmismatched-tags when compiling with clang
Aaron Merey [Wed, 19 May 2021 21:43:18 +0000 (17:43 -0400)]
Fix more -Wformat-nonliteral and -Wmismatched-tags when compiling with clang

3 years agodtrace: Use -o option to specify output file for CPP
Timm Bäder [Wed, 19 May 2021 21:00:43 +0000 (17:00 -0400)]
dtrace: Use -o option to specify output file for CPP

3 years agoFix -Wformat-nonliteral and -Wformat warnings with clang
Timm Bäder [Wed, 19 May 2021 20:59:35 +0000 (16:59 -0400)]
Fix -Wformat-nonliteral and -Wformat warnings with clang

3 years agoFix -Woverloaded-virtual warnings when building with clang
Timm Bäder [Wed, 19 May 2021 20:38:30 +0000 (16:38 -0400)]
Fix -Woverloaded-virtual warnings when building with clang

Satisfy clang by removing option for non-nested signature printing from
implementations of printsig and declare derived_probe::printsig with 'override'.

Add function derived_probe::printsig_nonest to perform non-nested signature
printing.

3 years agoset2: Return this from assignment operator
Timm Bäder [Wed, 19 May 2021 20:29:30 +0000 (16:29 -0400)]
set2: Return this from assignment operator

This should return something but didn't.

3 years agoAdd missing copy constructors to set1_ref and set1_const_ref
Timm Bäder [Wed, 19 May 2021 20:28:29 +0000 (16:28 -0400)]
Add missing copy constructors to set1_ref and set1_const_ref

Clang complains about the missing copy constructors if a user-defined
copy assignment operator exists, e.g.:

./bpf-bitset.h:108:19: error: definition of implicit copy constructor for 'set1_const_ref' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  set1_const_ref& operator= (const set1_const_ref &);   // not present
                  ^
./bpf-bitset.h:256:12: note: in implicit copy constructor for 'bpf::bitset::set1_const_ref' first required here
    return set1_const_ref(data + w2 * i, w2);

3 years agoAdd some override specifiers where missing
Timm Bäder [Wed, 19 May 2021 20:25:21 +0000 (16:25 -0400)]
Add some override specifiers where missing

3 years agoutil.cxx: Use abs() instead of labs()
Timm Bäder [Wed, 19 May 2021 20:23:06 +0000 (16:23 -0400)]
util.cxx: Use abs() instead of labs()

Taking the absolute value of unsigned values is pointless, as reported
by clang:

util.cxx:1545:28: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
      unsigned min_score = labs(target.size() - it->size());
                           ^
util.cxx:1545:28: note: remove the call to 'labs' since unsigned values cannot be negative
      unsigned min_score = labs(target.size() - it->size());

3 years agosystemtap.spec: python3 tweaks
Frank Ch. Eigler [Wed, 19 May 2021 01:03:17 +0000 (21:03 -0400)]
systemtap.spec: python3 tweaks

Embrace build configurations where python3 is not installed by
default, so needs an explicit BuildRequires; also ones where
python3-probes are not built, ergo stap-exporter isn't packaged.
(The latter is automake-conditionalized on the wrong parameter,
HAVE_PYTHON3_PROBES rather than HAVE_PYTHON3, but this doesn't
matter on normal distro builds.)

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