Skip to content
Snippets Groups Projects
  • Jerome Marchand's avatar
    tools: include kasan header in slabtoprate · 33393d30
    Jerome Marchand authored
    slabtoprate fails on 5.10 kernels because of a missing kasan_reset_tag
    declaration. We need to include the kasan header file.
    
    Fixes the following error:
    In file included from /virtual/main.c:12:
    include/linux/slub_def.h:181:27: warning: implicit declaration of function 'kasan_reset_tag' is invalid in C99 [-Wimplicit-function-declaration]
            return reciprocal_divide(kasan_reset_tag(obj) - addr,
                                     ^
    include/linux/slub_def.h:181:48: error: invalid operands to binary expression ('int' and 'void *')
            return reciprocal_divide(kasan_reset_tag(obj) - addr,
                                     ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
    1 warning and 1 error generated.
    Traceback (most recent call last):
      File "/usr/share/bcc/tools/slabratetop", line 115, in <module>
        b = BPF(text=bpf_text)
      File "/usr/lib/python3.9/site-packages/bcc/__init__.py", line 364, in __init__
        raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
    Exception: Failed to compile BPF module <text>
    33393d30