tools/bootconfig/scripts/ftrace2bconf.sh
Source file repositories/reference/linux-study-clean/tools/bootconfig/scripts/ftrace2bconf.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/bootconfig/scripts/ftrace2bconf.sh- Extension
.sh- Size
- 5908 bytes
- Lines
- 261
- 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
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
usage() {
echo "Dump boot-time tracing bootconfig from ftrace"
echo "Usage: $0 [--debug] [ > BOOTCONFIG-FILE]"
exit 1
}
DEBUG=
while [ x"$1" != x ]; do
case "$1" in
"--debug")
DEBUG=$1;;
-*)
usage
;;
esac
shift 1
done
if [ x"$DEBUG" != x ]; then
set -x
fi
TRACEFS=`grep -m 1 -w tracefs /proc/mounts | cut -f 2 -d " "`
if [ -z "$TRACEFS" ]; then
if ! grep -wq debugfs /proc/mounts; then
echo "Error: No tracefs/debugfs was mounted."
exit 1
fi
TRACEFS=`grep -m 1 -w debugfs /proc/mounts | cut -f 2 -d " "`/tracing
if [ ! -d $TRACEFS ]; then
echo "Error: ftrace is not enabled on this kernel." 1>&2
exit 1
fi
fi
######## main #########
set -e
emit_kv() { # key =|+= value
echo "$@"
}
global_options() {
val=`cat $TRACEFS/max_graph_depth`
[ $val != 0 ] && emit_kv kernel.fgraph_max_depth = $val
if grep -qv "^#" $TRACEFS/set_graph_function $TRACEFS/set_graph_notrace ; then
cat 1>&2 << EOF
# WARN: kernel.fgraph_filters and kernel.fgraph_notrace are not supported, since the wild card expression was expanded and lost from memory.
EOF
fi
}
kprobe_event_options() {
cat $TRACEFS/kprobe_events | while read p args; do
case $p in
r*)
cat 1>&2 << EOF
# WARN: A return probe found but it is not supported by bootconfig. Skip it.
EOF
continue;;
esac
p=${p#*:}
event=${p#*/}
group=${p%/*}
if [ $group != "kprobes" ]; then
cat 1>&2 << EOF
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.