Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext4slower doesn't work and the error message is not very helpful #1391

Closed
afiskon opened this issue Oct 13, 2017 · 7 comments · Fixed by #1408
Closed

ext4slower doesn't work and the error message is not very helpful #1391

afiskon opened this issue Oct 13, 2017 · 7 comments · Fixed by #1408

Comments

@afiskon
Copy link
Contributor

afiskon commented Oct 13, 2017

Hi,

I would like to use ext4slower. I execute it like this:

sudo /usr/share/bcc/tools/ext4slower 1

... and it tells me:

ERROR: no ext4_file_operations in /proc/kallsyms. Exiting.

It's not very helpful since I can't understand from this error message whether I should rebuild a kernel with some additional flags or do something else. Could you please add some hint text that would explain how to make ext4slower work?

The environment is Arch Linux x64, uname -a:

Linux e733 4.13.3-1-ARCH #1 SMP PREEMPT Thu Sep 21 20:33:16 CEST 2017 x86_64 GNU/Linux
@afiskon afiskon changed the title ext4slower error message is not very helpful ext4slower doesn't work and the error message is not very helpful Oct 13, 2017
@goldshtn
Copy link
Collaborator

/cc @brendangregg

@samuelnair
Copy link
Contributor

The tool is checking to see if that symbol exists in the kernel, as a means to determine if you have the ext4 compiled or loaded so as to ensure that those kprobes can attach successfully to the necessary functions.

The ext4_file_operations is a struct and should show up as a symbol of type 'd'. In all likelihood you need to compile the kernel with CONFIG_KALLSYMS_ALL option enabled to ensure that symbol table contains more than just text type symbols.

@afiskon
Copy link
Contributor Author

afiskon commented Oct 20, 2017

Indeed, CONFIG_KALLSYMS_ALL is disabled:

$ zcat /proc/config.gz | grep CONFIG_KALLSYMS_ALL
# CONFIG_KALLSYMS_ALL is not set

I believe it worth adding a corresponding hint to the script:

diff --git a/home/eax/temp/ext4slower.orig b/usr/share/bcc/tools/ext4slower
index 3b5e7ae..09e8572 100755
--- a/home/eax/temp/ext4slower.orig
+++ b/usr/share/bcc/tools/ext4slower
@@ -262,6 +262,7 @@ with open(kallsyms) as syms:
             break
     if ops == '':
         print("ERROR: no ext4_file_operations in /proc/kallsyms. Exiting.")
+        print("HINT: the kernel should be built with CONFIG_KALLSYMS_ALL.")
         exit()
     bpf_text = bpf_text.replace('EXT4_FILE_OPERATIONS', ops)
 if min_ms == 0:

@yonghong-song
Copy link
Collaborator

Could you submit a formal patch for this? I think this is indeed helpful.
cc @brendangregg

@afiskon
Copy link
Contributor Author

afiskon commented Oct 23, 2017

Done.

@afiskon
Copy link
Contributor Author

afiskon commented Oct 23, 2017

For the record - also I've contacted Tobias Powalowski, the maintainer of the linux package for Arch Linux, and asked him if it's possible to enable CONFIG_KALLSYMS_ALL in this package.

@afiskon
Copy link
Contributor Author

afiskon commented Oct 23, 2017

For the record - updated PR is here #1408

yonghong-song added a commit that referenced this issue Oct 24, 2017
Explain possible reason of an error in scripts that rely on /proc/kallsyms (fixes #1391)
CrackerCat pushed a commit to CrackerCat/bcc that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants