public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	        Jim Keniston <jkenisto@us.ibm.com>,
	David Miller <davem@davemloft.net>,
	        Rusty Russell <rusty@rustcorp.com.au>,
	        LKML <linux-kernel@vger.kernel.org>,
	        systemtap-ml <systemtap@sources.redhat.com>
Subject: [PATCH 0/7] kprobes: Support probing __init and __exit functions  in modules
Date: Tue, 11 Nov 2008 20:57:00 -0000	[thread overview]
Message-ID: <4919F159.6090706@redhat.com> (raw)

Hi,

This series of patches allows kprobes to probe module's __init and
__exit functions. This means, you can probe driver initialization
and terminating.

Currently, kprobes can't probe __init function because these functions
are freed after module initialization. And it also can't probe module
__exit functions because kprobe increments reference count of target
module and user can't unload it. this means __exit functions never be
called unless removing probes from the module.

To solve both cases, this series of patches introduces GONE flag and
sets it when the target code is freed(for this purpose, kprobes hooks
MODULE_STATE_* events). This also removes refcount incrementing for
allowing user to unload target module. Users can check which probes
are GONE by debugfs interface. For taking timing of freeing module's
.init text, these also include a patch which adds module's notifier of
MODULE_STATE_LIVE event.

This series of patches can be applied after applying below patches on
2.6.28-rc4.

http://lkml.org/lkml/2008/11/6/236
http://lkml.org/lkml/2008/11/5/346

Thank you,

 Documentation/kprobes.txt     |    5
 arch/arm/kernel/kprobes.c     |    2
 arch/ia64/kernel/kprobes.c    |    8 -
 arch/powerpc/kernel/kprobes.c |    7 -
 arch/s390/kernel/kprobes.c    |    7 -
 arch/x86/kernel/kprobes.c     |    7 -
 include/linux/kprobes.h       |   15 +-
 include/linux/module.h        |   12 +
 kernel/kprobes.c              |  260 ++++++++++++++++++++++++++----------------
 kernel/module.c               |   27 +---
 10 files changed, 220 insertions(+), 130 deletions(-)

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

                 reply	other threads:[~2008-11-11 20:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4919F159.6090706@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=davem@davemloft.net \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).