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
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 @@
/*
* 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},