You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since commit 40f3bf0cb04c ("mm: Convert struct page to struct slab in functions used by other subsystems"), slab_def.h and slub_def.h refers to structures (slab) and functions (slab_address) defined in the internal header mm/slab.h.
It makes slabratetop tool fail with the following error:
$ slabratetop
In file included from /virtual/main.c:13:
include/linux/slub_def.h:162:26: warning: call to undeclared function 'slab_address'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
void *object = x - (x - slab_address(slab)) % cache->size;
^
include/linux/slub_def.h:162:46: error: invalid operands to binary expression ('void *' and 'unsigned int')
void *object = x - (x - slab_address(slab)) % cache->size;
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
include/linux/slub_def.h:164:8: error: incomplete definition of type 'struct slab'
(slab->objects - 1) * cache->size;
~~~~^
include/linux/kasan.h:13:8: note: forward declaration of 'struct slab'
struct slab;
^
In file included from /virtual/main.c:13:
include/linux/slub_def.h:184:31: warning: call to undeclared function 'slab_address'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
return __obj_to_index(cache, slab_address(slab), obj);
^
include/linux/slub_def.h:184:31: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'void *' [-Wint-conversion]
return __obj_to_index(cache, slab_address(slab), obj);
^~~~~~~~~~~~~~~~~~
include/linux/slub_def.h:173:14: note: passing argument to parameter 'addr' here
void *addr, void *obj)
^
include/linux/slub_def.h:190:13: error: incomplete definition of type 'struct slab'
return slab->objects;
~~~~^
include/linux/kasan.h:13:8: note: forward declaration of 'struct slab'
struct slab;
^
2 warnings and 4 errors generated.
Traceback (most recent call last):
File "/usr/share/bcc/tools/slabratetop", line 111, in <module>
b = BPF(text=bpf_text)
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/bcc/__init__.py", line 476, in __init__
raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>
The text was updated successfully, but these errors were encountered:
Since commit 40f3bf0cb04c ("mm: Convert struct page to struct slab in functions used by other subsystems"), slab_def.h and slub_def.h refers to structures (slab) and functions (slab_address) defined in the internal header mm/slab.h.
It makes slabratetop tool fail with the following error:
The text was updated successfully, but these errors were encountered: