public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Nan Xiao <xiaonan830818@gmail.com>
To: David Smith <dsmith@redhat.com>
Cc: systemtap@sourceware.org
Subject: Re: How to track the functions in self-written module using SystemTap?
Date: Wed, 18 Nov 2015 03:39:00 -0000	[thread overview]
Message-ID: <CA+MhoaNG0hENo=cnOrxogX2qofdQodh-sY7mbKoZabn+L5GgFg@mail.gmail.com> (raw)
In-Reply-To: <564B5A4C.1080302@redhat.com>

Hi David,

Yes, the "FULL_PATH_TO_KEX" works:

~/Downloads/kernel/105.ops # stap -l
'module("/root/Downloads/kernel/105.ops/kex.ko").function("*")'
module("/root/Downloads/kernel/105.ops/kex.ko").function("_open@/root/Downloads/kernel/105.ops/kex.c:21")
module("/root/Downloads/kernel/105.ops/kex.ko").function("_read@/root/Downloads/kernel/105.ops/kex.c:45")
module("/root/Downloads/kernel/105.ops/kex.ko").function("_release@/root/Downloads/kernel/105.ops/kex.c:33")
module("/root/Downloads/kernel/105.ops/kex.ko").function("copy_to_user@/usr/src/linux-3.12.49-3/arch/x86/include/asm/uaccess_64.h:72")
module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_cleanup@/root/Downloads/kernel/105.ops/kex.c:90")
module("/root/Downloads/kernel/105.ops/kex.ko").function("kex_init@/root/Downloads/kernel/105.ops/kex.c:61")

But the "RELATIVE_PATH_TO_KEX" doesn't work:
~/Downloads/kernel/105.ops # stap -l 'module("./kex.ko").function("*")'
~/Downloads/kernel/105.ops #

Is it the expected behavior of SystemTap? Thanks!
Best Regards
Nan Xiao


On Wed, Nov 18, 2015 at 12:48 AM, David Smith <dsmith@redhat.com> wrote:
> On 11/17/2015 01:14 AM, Nan Xiao wrote:
>> Hi all,
>>
>> I build a simple Linux module
>> (https://github.com/troydhanson/kernel/blob/master/105.ops/kex.c),
>> and want to use SystemTap to track it.
>>
>> But I find there is no available probes:
>> # stap -l 'module("kex").function("*")'
>> #
>>
>> How can I track the functions in module written by myself? Is there
>> any tutorial about this? I try to
>> search on https://sourceware.org/systemtap/documentation.html, but
>> can't find wanted content.
>
> If your 'kex' module isn't the same directory as the other kernel
> modules (/lib/modules/`uname -r`/), systemtap won't be able to find it.
> So, you have to tell systemtap where the module is, like this:
>
> # stap -l 'module("FULL_PATH_TO_KEX").function("*")'
>
> If that doesn't work, please let me know.
>
> --
> David Smith
> dsmith@redhat.com
> Red Hat
> http://www.redhat.com
> 256.217.0141 (direct)
> 256.837.0057 (fax)

  reply	other threads:[~2015-11-18  3:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17  7:14 Nan Xiao
2015-11-17 16:48 ` David Smith
2015-11-18  3:39   ` Nan Xiao [this message]
2015-11-18 19:38     ` David Smith
2015-11-19  0:49       ` Nan Xiao
2015-11-19  8:33         ` Nan Xiao
2015-11-19 14:58           ` David Smith
2015-11-26  6:10             ` Nan Xiao
2015-11-30 21:52               ` David Smith
2015-11-30 23:45                 ` Nan Xiao
2015-12-01  2:18                   ` Frank Ch. Eigler
2015-12-01  2:57                     ` Nan Xiao
2015-12-01 16:27                       ` David Smith
2015-12-02  2:22                         ` Nan Xiao
2015-12-02 21:42                           ` David Smith
2015-12-03  1:13                             ` Nan Xiao
2015-12-03 17:04                               ` David Smith
2015-12-04  9:56                                 ` Nan Xiao
2015-12-04 12:15                                   ` David Smith
2015-12-06  8:53                                     ` Nan Xiao
2015-12-07 19:53                                       ` David Smith
2015-12-08  1:05                                         ` Nan Xiao
2015-12-08 19:41                                           ` Frank Ch. Eigler
2016-10-06 22:05                                         ` Martin Cermak
2016-10-07 17:59                                           ` David Smith
2016-10-12 17:02                                             ` Martin Cermak

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='CA+MhoaNG0hENo=cnOrxogX2qofdQodh-sY7mbKoZabn+L5GgFg@mail.gmail.com' \
    --to=xiaonan830818@gmail.com \
    --cc=dsmith@redhat.com \
    --cc=systemtap@sourceware.org \
    /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).