diff options
author | Maciej Żenczykowski <maze@google.com> | 2021-10-22 19:27:10 -0700 |
---|---|---|
committer | Maciej Żenczykowski <maze@google.com> | 2021-11-18 05:45:21 +0000 |
commit | 3adb1d5569f430f26fc1b865f90fd16e1a39c957 (patch) | |
tree | 4037fe291e6959c83110b543c677690052d35158 /libbpf_android | |
parent | 5460527c74262b77a7d38732f0fce34efd24dd68 (diff) | |
download | bpf-3adb1d5569f430f26fc1b865f90fd16e1a39c957.tar.gz |
rename SEC() to SECTION()
The only purpose of this is to break cut-and-paste of examples
that use SEC() causing people to think things through, look
at Android bpf program examples and use a better macro.
In particular programs with SEC("license") / SEC("maps") need to be
changed to use LICENSE("license") and the map helpers or the map
section is wrong and cannot be correctly parsed by the bpfloader.
Generated via:
git grep 'SEC\(' | cut -d: -f1-2 | while read i; do mcedit $i; done
and manually editting found locations
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idb333967e054e096fe74f910a5f8aaf1d6c5dc81
Diffstat (limited to 'libbpf_android')
-rw-r--r-- | libbpf_android/Loader.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libbpf_android/Loader.cpp b/libbpf_android/Loader.cpp index b7f38ce..529c69c 100644 --- a/libbpf_android/Loader.cpp +++ b/libbpf_android/Loader.cpp @@ -81,10 +81,13 @@ typedef struct { /* * Map section name prefixes to program types, the section name will be: - * SEC(<prefix>/<name-of-program>) + * SECTION(<prefix>/<name-of-program>) * For example: - * SEC("tracepoint/sched_switch_func") where sched_switch_funcs + * SECTION("tracepoint/sched_switch_func") where sched_switch_funcs * is the name of the program, and tracepoint is the type. + * + * However, be aware that you should not be directly using the SECTION() macro. + * Instead use the DEFINE_(BPF|XDP)_(PROG|MAP)... & LICENSE/CRITICAL macros. */ sectionType sectionNameTypes[] = { {"kprobe", BPF_PROG_TYPE_KPROBE}, |