* Fix the check of the existence of module BTFs
* Initialize the global variable
Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
#define MAX_ENTRIES 10240
-struct hist hists[__MAX_FOP_TYPE];
+struct hist hists[__MAX_FOP_TYPE] = {};
struct {
__uint(type, BPF_MAP_TYPE_HASH);
* we can use fentry to get better performance, otherwise we need
* to fall back to use kprobe to be compatible with the old kernel.
*/
- if (is_kernel_module("ext4") && !access("/sys/kernel/btf/ext4", R_OK))
+ if (is_kernel_module("ext4") && access("/sys/kernel/btf/ext4", R_OK))
return true;
return false;
}