tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
Source file repositories/reference/linux-study-clean/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc- Extension
.tc- Size
- 2356 bytes
- Lines
- 116
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
PROBEFUNC="vfs_read"
GOODREG=
BADREG=
GOODSYM="_sdata"
if ! grep -qw ${GOODSYM} /proc/kallsyms ; then
GOODSYM=$PROBEFUNC
fi
BADSYM="deaqswdefr"
SYMADDR=0x`grep -w ${GOODSYM} /proc/kallsyms | cut -f 1 -d " "`
GOODTYPE="x16"
BADTYPE="y16"
case `uname -m` in
x86_64|i[3456]86)
GOODREG=%ax
BADREG=%ex
;;
aarch64)
GOODREG=%x0
BADREG=%ax
;;
arm*)
GOODREG=%r0
BADREG=%ax
;;
ppc*)
GOODREG=%r3
BADREG=%msr
;;
s390*)
GOODREG=%r2
BADREG=%s2
;;
mips*)
GOODREG=%r4
BADREG=%r12
;;
loongarch*)
GOODREG=%r4
BADREG=%r12
;;
riscv*)
GOODREG=%a0
BADREG=%a8
;;
*)
echo "Please implement other architecture here"
exit_untested
esac
test_goodarg() # Good-args
{
while [ "$1" ]; do
echo "p ${PROBEFUNC} $1" > kprobe_events
shift 1
done;
}
test_badarg() # Bad-args
{
while [ "$1" ]; do
! echo "p ${PROBEFUNC} $1" > kprobe_events
shift 1
done;
}
echo > kprobe_events
: "Register access"
test_goodarg ${GOODREG}
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.