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

Can't attach to multiple kernel functions with the same name #3141

Open
ajor opened this issue Apr 26, 2024 · 0 comments
Open

Can't attach to multiple kernel functions with the same name #3141

ajor opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ajor
Copy link
Member

ajor commented Apr 26, 2024

Choose a function which has duplicates in kallsyms:

$ grep '\<s_next\>' /proc/kallsyms
ffffffff812a6b40 t s_next
ffffffff81469630 t s_next
ffffffff815bdf60 t s_next
ffffffff81759010 t s_next
ffffffff817eeed0 t s_next

Trace and print the address of the function we've attached to:

# bpftrace -e 'kprobe:s_next { printf("%x\n", reg("ip")) }'
Attaching 1 probe...
812a6b41
812a6b41
812a6b41
812a6b41
[...]

(this probe can be triggered by running $ grep '\<s_next\>' /proc/kallsyms again)

We only appear to trace the first entry in kallsyms.

Should we attach to all instances or error out instead?

Related to #3140

@ajor ajor added the bug Something isn't working label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant