]> sourceware.org Git - systemtap.git/commit
PR26665: relayfs-on-procfs megapatch
authorFrank Ch. Eigler <fche@redhat.com>
Tue, 10 Nov 2020 00:18:19 +0000 (19:18 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 10 Nov 2020 01:17:22 +0000 (20:17 -0500)
commit7615cae790c899bc8a82841c75c8ea9c6fa54df3
tree51704d8fde48aaaf367a03e292684e6caf019af3
parentafe0acfac54a3c0c329f8d42a6dc1a028a3d1bda
PR26665: relayfs-on-procfs megapatch

On platforms/configurations where debugfs is inaccessible (I'm
side-eyeing at you, secureboot + kernel_lockdown), the stap runtime
needs another way to hook up the relayfs / .cmd files to talk to
staprun/stapio in userspace.  kernel relayfs users all rely on
debugfs (tied closely to struct dentry*), and filesystems where
dentry*'s are not immediately available are SOL.

Until now.  This gigapatch forks pieces of runtime/transport/transport.c
into debugfs and procfs alternatives. The debugfs fork is just like
before. The procfs fork is new, and uses a proc_dir_entry <-> struct
path look-up table to map between procfs objects and the dentry*'s
that relayfs so loves.

The debugfs alternative is default, except when lockdown mode is
detected; then the runtime chooses procfs_p at the strategic moment.
stap -DSTAP_TRANS_PROCFS or -DSTAP_TRANS_DEBUGFS lets the user
override this heuristic.  (Going to a procfs default is worth
considering at some point.)

The staprun/stapio userspace is updated to search both
/sys/kernel/debug/systemtap and /proc/systemtap for the relay/.cmd
file endpoints.

Most of this gigapatch is moving code around in runtime/transport/ so
relay_v2 is agnostic to its enclosing filesystem, going through hooks
in transport.c to either procfs.c or debugfs.c.  The old
runtime/procfs.c file is stripped down to move common bits around a
little.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
13 files changed:
buildrun.cxx
runtime/linux/autoconf-lockdown-debugfs.c [new file with mode: 0644]
runtime/procfs.c
runtime/transport/control.c
runtime/transport/debugfs.c
runtime/transport/procfs.c
runtime/transport/relay_v2.c
runtime/transport/transport.c
runtime/transport/transport.h
staprun/ctl.c
staprun/relay.c
testsuite/buildok/trans-debugfs.stp [new file with mode: 0755]
testsuite/buildok/trans-procfs.stp [new file with mode: 0755]
This page took 0.028675 seconds and 5 git commands to generate.