This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug runtime/16861] probes aren't re-registered after module reload


https://sourceware.org/bugzilla/show_bug.cgi?id=16861

--- Comment #4 from Jonathan Lebon <jlebon at redhat dot com> ---
OK, I've decided to *really* look into this and see why kprobes seems to be
misbehaving. The answer is that we are the ones actually misbehaving. :)

The key is that we are actually being notified *before* the kprobes callback,
not after (I believe the comments in transport.c which is based on
kernel/trace/trace_kprobe.c, are wrong -- notifiers are called from high to low
priority number, not the other way around, see notifier_chain_register()).

So what would happen is that (prior to the patch I posted) we would call
unregister_kprobe() during the GOING event, which would set the DISABLED flag
as part of the process. That DISABLED flag stayed in the struct and is what
caused the behaviour in the PR in the first place (i.e. the next register()
looked like it didn't work, when really it did register but just remained
disabled).

On the other hand, with the patch I posted above, we would call
unregister_kprobe() only at the next COMING event, at which point it doesn't
bother to set the DISABLED flag because kprobes had already flagged it as GONE
during the previous GOING event (see the kprobe_disabled() predicate, which
looks at both the DISABLED and the GONE flags). This is why the following
register() call worked.

So really all we needed to do was change the priority of the notifier to be
less than that of the kprobes callback and of course make sure that the flags
member is cleared (or just zero out the whole struct).

-- 
You are receiving this mail because:
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]