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 two functions to the same kprobe event #251

Open
yanivagman opened this issue Jul 7, 2020 · 1 comment
Open

Can't attach two functions to the same kprobe event #251

yanivagman opened this issue Jul 7, 2020 · 1 comment

Comments

@yanivagman
Copy link

We have a use case where we need to attach two different functions to the same kprobe event (mmap syscall in one case).
The use case is legitimate, as the user can choose to have one of these events or both.
For some reason, this is not allowed as the function "attachProbe" (bcc/module.go) has the following check:

func (bpf *Module) attachProbe(evName string, attachType uint32, fnName string, fd int, maxActive int) error {
if _, ok := bpf.kprobes[evName]; ok {
return nil
}
...
...
bpf.kprobes[evName] = int(res)
return nil
}

With python bcc bindings there is no such issue, and I can attach two functions to a single kprobe event at once.

Any good reason for this check?

@itaysk
Copy link
Contributor

itaysk commented Jul 16, 2020

any thoughts on this from the maintainers? I can fix this if someone green-lights it

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

No branches or pull requests

2 participants