Alan Maguire
c78911e5b1
UPSTREAM: bpf: Add bpf_snprintf_btf helper
...
A helper is added to support tracing kernel type information in BPF
using the BPF Type Format (BTF). Its signature is
long bpf_snprintf_btf(char *str, u32 str_size, struct btf_ptr *ptr,
u32 btf_ptr_size, u64 flags);
struct btf_ptr * specifies
- a pointer to the data to be traced
- the BTF id of the type of data pointed to
- a flags field is provided for future use; these flags
are not to be confused with the BTF_F_* flags
below that control how the btf_ptr is displayed; the
flags member of the struct btf_ptr may be used to
disambiguate types in kernel versus module BTF, etc;
the main distinction is the flags relate to the type
and information needed in identifying it; not how it
is displayed.
For example a BPF program with a struct sk_buff *skb
could do the following:
static struct btf_ptr b = { };
b.ptr = skb;
b.type_id = __builtin_btf_type_id(struct sk_buff, 1);
bpf_snprintf_btf(str, sizeof(str), &b, sizeof(b), 0, 0);
Default output looks like this:
(struct sk_buff){
.transport_header = (__u16)65535,
.mac_header = (__u16)65535,
.end = (sk_buff_data_t)192,
.head = (unsigned char *)0x000000007524fd8b,
.data = (unsigned char *)0x000000007524fd8b,
.truesize = (unsigned int)768,
.users = (refcount_t){
.refs = (atomic_t){
.counter = (int)1,
},
},
}
Flags modifying display are as follows:
- BTF_F_COMPACT: no formatting around type information
- BTF_F_NONAME: no struct/union member names/types
- BTF_F_PTR_RAW: show raw (unobfuscated) pointer values;
equivalent to %px.
- BTF_F_ZERO: show zero-valued struct/union members;
they are not displayed by default
Change-Id: Ic45d195264ae573cc1b2e1e49304edd4c91a1c65
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/1601292670-1616-4-git-send-email-alan.maguire@oracle.com
2026-01-14 18:12:37 -08:00
..
atomic
basic
coccinelle
scripts: add dummy report mode to add_namespace.cocci
2020-08-11 15:33:35 +02:00
dtc
Merge android11-5.4.180+ ( 598165f) into msm-5.4
2022-04-21 10:51:21 +05:30
gcc-plugins
Merge tag 'ASB-2025-10-06_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
2025-10-08 15:17:54 +03:00
gdb
Revert "PM: domains: Fix up terminology with parent/child"
2023-06-16 09:26:26 +00:00
genksyms
genksyms: fix memory leak when the same symbol is read from *.symref file
2025-03-13 12:43:00 +01:00
gki
scripts: gki: Disable DEBUG_FS for user variant builds
2020-07-21 15:30:57 -07:00
kconfig
Merge branch 'android11-5.4-lts' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
2025-12-11 01:41:51 -08:00
ksymoops
mod
Merge tag 'LA.UM.9.14.r1-25800-LAHAINA.QSSI15.0' of https://git.codelinaro.org/clo/la/kernel/msm-5.4 into android13-5.4-lahaina
2025-02-14 02:42:56 +02:00
package
kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables
2020-09-03 11:27:10 +02:00
selinux
selinux: Chain up tool resolving errors in install_policy.sh
2025-04-10 14:29:39 +02:00
tracing
ftrace/scripts: Update the instructions for ftrace-bisect.sh
2023-02-06 07:52:44 +01:00
.gitignore
adjust_autoksyms.sh
Merge android11-5.4.86+ ( 7d99cf8) into msm-5.4
2021-06-07 15:17:29 +05:30
asn1_compiler.c
ASN.1: Fix check for strdup() success
2023-04-26 11:24:06 +02:00
bin2c.c
bloat-o-meter
scripts: switch explicitly to Python 3
2021-05-22 11:38:30 +02:00
bootgraph.pl
bpf_helpers_doc.py
UPSTREAM: bpf: Add bpf_snprintf_btf helper
2026-01-14 18:12:37 -08:00
build-all.py
cc-can-link.sh
check-config-debug-exemptions
check-config-perf-exemptions
check-config.py
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl
Merge android11-5.4.259+ ( 70db018) into msm-5.4
2024-01-31 01:01:26 -08:00
checkstack.pl
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config
kbuild: fix argument parsing in scripts/config
2025-06-04 14:32:31 +02:00
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh
scripts/decode_stacktrace: strip basepath from all paths
2020-07-29 10:18:35 +02:00
decodecode
depmod.sh
depmod: handle the case of /sbin/depmod without /sbin in PATH
2021-01-12 20:16:10 +01:00
diffconfig
scripts: switch explicitly to Python 3
2021-05-22 11:38:30 +02:00
documentation-file-ref-check
export_report.pl
extract-cert.c
Merge tag 'ASB-2023-02-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
2023-02-08 18:28:38 +02:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
scripts/faddr2line: Fix regression in name resolution on ppc64le
2022-12-08 11:23:02 +01:00
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
kbuild: Fix '-S -c' in x86 stack protector scripts
2024-08-19 05:33:53 +02:00
gcc-x86_64-has-stack-protector.sh
kbuild: Fix '-S -c' in x86 stack protector scripts
2024-08-19 05:33:53 +02:00
gen_autoksyms.sh
ABI: Update section name in script and internal allowed list
2020-09-30 13:12:21 -07:00
gen_compile_commands.py
gen_ksymdeps.sh
kbuild: Fix 'no symbols' warning when CONFIG_TRIM_UNUSD_KSYMS=y
2021-09-22 12:26:26 +02:00
generate_initcall_order.pl
ANDROID: generate_initcall_order.pl: Use two dash long options for llvm-nm
2021-07-21 20:41:37 -07:00
get_abi.pl
tweewide: Fix most Shebang lines
2021-05-22 11:38:30 +02:00
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
Merge android-5.4-stable.50 ( a200ad5) into msm-5.4
2020-07-20 19:22:16 -07:00
insert-sys-cert.c
kallsyms.c
ANDROID: kallsyms: increase KSYM_NAME_LEN
2020-08-04 19:33:41 +00:00
Kbuild.include
Merge tag 'ASB-2025-10-06_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
2025-10-08 15:17:54 +03:00
Kconfig.include
UPSTREAM: kbuild: Add support for 'as-instr' to be used in Kconfig files
2022-11-14 03:04:02 +02:00
kernel-doc
ld-version.sh
leaking_addresses.pl
leaking_addresses: Always print a trailing newline
2021-11-17 09:48:31 +01:00
Lindent
link-vmlinux.sh
BACKPORT: bpf: Resolve BTF IDs in vmlinux image
2026-01-14 18:12:02 -08:00
Makefile
scripts: set proper OpenSSL include dir also for sign-file
2021-02-26 10:10:27 +01:00
Makefile.asm-generic
Makefile.build
kbuild: add infrastructure to build userspace programs
2025-09-28 10:00:32 +02:00
Makefile.clean
kbuild: add infrastructure to build userspace programs
2025-09-28 10:00:32 +02:00
Makefile.dtbinst
Makefile.dtbo
Makefile.extrawarn
kbuild: Move -Wenum-enum-conversion to W=2
2025-03-13 12:43:09 +01:00
Makefile.gcc-plugins
gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file
2022-08-25 11:18:31 +02:00
Makefile.headersinst
Makefile.host
kbuild: use -MMD instead of -MD to exclude system headers from dependency
2025-07-17 18:24:51 +02:00
Makefile.kasan
Makefile.kcov
Makefile.lib
Merge tag 'ASB-2025-09-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
2025-09-12 18:48:05 +03:00
Makefile.modbuiltin
Makefile.modfinal
Makefile.modinst
Makefile.modpost
This is the 5.4.212 stable release
2022-09-21 12:34:35 +02:00
Makefile.modsign
Makefile.package
kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables
2020-09-03 11:27:10 +02:00
Makefile.ubsan
Makefile.userprogs
kbuild: add infrastructure to build userspace programs
2025-09-28 10:00:32 +02:00
makelst
markup_oops.pl
mkcompile_h
Merge 5.4.287 into android11-5.4-lts
2024-12-16 10:50:16 +00:00
mkmakefile
mksysmap
mksysmap: Fix the mismatch of 'L0' symbols in System.map
2022-09-28 11:03:59 +02:00
mkuboot.sh
module-common.lds
module-lto.lds
ANDROID: kbuild: don't preprocess module-lto.lds
2020-08-19 09:15:50 -07:00
modules-check.sh
namespace.pl
nsdeps
scripts: add dummy report mode to add_namespace.cocci
2020-08-11 15:33:35 +02:00
objdiff
parse-maintainers.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c
This is the 5.4.244 stable release
2023-06-20 11:07:18 +00:00
recordmcount.h
Linux 5.4.129
2021-06-30 19:19:07 +02:00
recordmcount.pl
recordmcount.pl: fix typo in s390 mcount regex
2022-01-05 12:37:44 +01:00
setlocalversion
ANDROID: setlocalversion: make KMI_GENERATION optional
2021-11-17 22:45:14 +00:00
show_delta
tweewide: Fix most Shebang lines
2021-05-22 11:38:30 +02:00
sign-file.c
sign-file: Fix incorrect return values check
2023-12-20 15:41:17 +01:00
sortextable.c
sortextable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install
tweewide: Fix most Shebang lines
2021-05-22 11:38:30 +02:00
split-man.pl
tweewide: Fix most Shebang lines
2021-05-22 11:38:30 +02:00
stackdelta
stackusage
subarch.include
tags.sh
scripts/tags.sh: Resolve gtags empty index generation
2023-07-27 08:37:03 +02:00
tools-support-relr.sh
Makefile: fix GDB warning with CONFIG_RELR
2021-07-14 16:53:12 +02:00
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh
kbuild: add variables for compression tools
2020-09-03 11:27:10 +02:00