From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26171 invoked by alias); 19 Jun 2014 20:33:42 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 26140 invoked by uid 48); 19 Jun 2014 20:33:38 -0000 From: "jlebon at redhat dot com" To: systemtap@sourceware.org Subject: [Bug runtime/16861] probes aren't re-registered after module reload Date: Thu, 19 Jun 2014 20:33:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jlebon at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q2/txt/msg00276.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16861 Jonathan Lebon changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jlebon at redhat dot com --- Comment #1 from Jonathan Lebon --- OK, I've looked into this a bit more. It seems like we do register and unregister when it "makes sense", i.e. - Upon MODULE_STATE_COMING, we update all the addresses, and then register all kprobes. - Upon MODULE_STATE_LIVE, we zero out any init section, and then unregister any init kprobes. - Upon MODULE_STATE_GOING, we zero out all sections, and then unregister all kprobes. However, it looks like kprobes doesn't like it when we unregister things during the MODULE_STATE_LIVE and MODULE_STATE_GOING events. This may be due to the fact that kprobes already checks for these events as well (and is notified before us) and accordingly disarms no longer valid kprobes (see kprobes_module_callback()). For that reason, unregistration for no longer valid module addresses is not necessary. If we instead unregister and re-register during the MODULE_STATE_COMING event, then everything works as expected. Note by the way that this is the approach also done in trace_kprobe.c (see trace_kprobe_module_callback()). Tentative patch to follow. -- You are receiving this mail because: You are the assignee for the bug.