Commit fa103457 authored by Gary Lin's avatar Gary Lin

tools/slabratetop: detect the current memory allocator

Currently, slabratetop always included slub_def.h. For the system uses
SLAB, the definition of 'struct kmem_cache' is different and the eBPF
program would fetch the wrong field and print garbages.
Signed-off-by: default avatarGary Lin <glin@suse.com>
parent 7cfb73b5
......@@ -63,7 +63,11 @@ bpf_text = """
#include <uapi/linux/ptrace.h>
#include <linux/mm.h>
#include <linux/slab.h>
#ifdef CONFIG_SLUB
#include <linux/slub_def.h>
#else
#include <linux/slab_def.h>
#endif
#define CACHE_NAME_SIZE 32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment