change post file

This commit is contained in:
gameloader 2022-03-08 15:00:03 +08:00
parent 47af22b888
commit 785af69d80

View File

@ -46,3 +46,8 @@ Minimal程序使用了SEC宏展开后结果分析如下
#### __attribute\_\_ {#attribute}
__attribute__也是一种编译器指令用于在声明函数变量类型时帮助声明对象向编译器告知某些编译特性。在gnu网站上可以查知<font color="blue"> **[可用的属性](https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html)** </font> ,在此处的含义为将对应的函数放入指定的name段中并且即使该函数没有被引用也不允许将该自定义的段优化掉used
#### SEC整体功能 {#SEC整体功能}
博客中给出的解释为
> libbpf is able to automatically determine where to attach BPF program to by looking at its special SEC() annotation. This doesn't work for all possible BPF program types, but it does for lots of them: tracepoints, kprobes, and quite a few others. Additionally, libbpf provides extra APIs to do the attachment programmatically.