public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo)
@ 2009-09-04  8:57 wangkai at noahsi dot com dot cn
  2009-09-04 14:00 ` [Bug runtime/10605] " fche at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: wangkai at noahsi dot com dot cn @ 2009-09-04  8:57 UTC (permalink / raw)
  To: systemtap

I have this script.
#cat test.stp
%{
#include <linux/swap.h>
%}

function get_swap_total:long()
%{
        struct sysinfo i;
        si_swapinfo(&i);
        THIS->__retvalue = i.totalswap;

%}

probe timer.s(1)
{
        printf("%d\n", get_swap_total())
        exit()
}

Errors I get are,
#stap -v -g test.stp
Pass 1: parsed user script and 45 library script(s) in 210usr/0sys/217real ms.
Pass 2: analyzed script: 1 probe(s), 2 function(s), 1 embed(s), 0 global(s) in
0usr/0sys/4real ms.
Pass 3: translated to C into
"/tmp/stap8S0mHK/stap_511a6ca4d792dbeb7a947b7bb78723aa_470.c" in
60usr/250sys/310real ms.
Pass 4: compiled C into "stap_511a6ca4d792dbeb7a947b7bb78723aa_470.ko" in
2290usr/360sys/2594real ms.
Pass 5: starting run.
Error inserting module
'/tmp/stap8S0mHK/stap_511a6ca4d792dbeb7a947b7bb78723aa_470.ko': Unknown symbol
in module
Pass 5: run completed in 0usr/10sys/7real ms.
Pass 5: run failed.  Try again with more '-v' (verbose) options.

#dmesg
stap_511a6ca4d792dbeb7a947b7bb78723aa_470: Unknown symbol si_swapinfo


How to call this function(si_swapinfo)?

Thanks,
WK.

-- 
           Summary: Unknown symbol in module error (Unknown symbol
                    si_swapinfo)
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: wangkai at noahsi dot com dot cn


http://sourceware.org/bugzilla/show_bug.cgi?id=10605

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/10605] Unknown symbol in module error (Unknown symbol si_swapinfo)
  2009-09-04  8:57 [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo) wangkai at noahsi dot com dot cn
@ 2009-09-04 14:00 ` fche at redhat dot com
  2009-09-04 14:09 ` dsmith at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2009-09-04 14:00 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2009-09-04 14:00 -------
Without special tricks, you can only call functions and refer to
symbols that were marked EXPORT_SYMBOL[_GPL] by the kernel.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=10605

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/10605] Unknown symbol in module error (Unknown symbol si_swapinfo)
  2009-09-04  8:57 [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo) wangkai at noahsi dot com dot cn
  2009-09-04 14:00 ` [Bug runtime/10605] " fche at redhat dot com
@ 2009-09-04 14:09 ` dsmith at redhat dot com
  2009-09-07  2:20 ` wangkai at noahsi dot com dot cn
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dsmith at redhat dot com @ 2009-09-04 14:09 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From dsmith at redhat dot com  2009-09-04 14:09 -------
It looks like si_swapinfo() is only exported for s390.  If you are on s390, then
you've found a systemtap bug.

If you aren't using a vendor-supplied kernel, you could add the following line
(most likely to mm/swapfile.c) and recompile:

EXPORT_SYMBOL_GPL(si_swapinfo);

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10605

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/10605] Unknown symbol in module error (Unknown symbol si_swapinfo)
  2009-09-04  8:57 [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo) wangkai at noahsi dot com dot cn
  2009-09-04 14:00 ` [Bug runtime/10605] " fche at redhat dot com
  2009-09-04 14:09 ` dsmith at redhat dot com
@ 2009-09-07  2:20 ` wangkai at noahsi dot com dot cn
  2009-09-07  9:45 ` wangkai at noahsi dot com dot cn
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: wangkai at noahsi dot com dot cn @ 2009-09-07  2:20 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wangkai at noahsi dot com dot cn  2009-09-07 02:19 -------
Thanks a lot.

arch is x86_64.
I will try to recompile.

-------------

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10605

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/10605] Unknown symbol in module error (Unknown symbol si_swapinfo)
  2009-09-04  8:57 [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo) wangkai at noahsi dot com dot cn
                   ` (2 preceding siblings ...)
  2009-09-07  2:20 ` wangkai at noahsi dot com dot cn
@ 2009-09-07  9:45 ` wangkai at noahsi dot com dot cn
  2009-09-07 10:06 ` wenji dot huang at oracle dot com
  2009-09-08  5:40 ` wangkai at noahsi dot com dot cn
  5 siblings, 0 replies; 7+ messages in thread
From: wangkai at noahsi dot com dot cn @ 2009-09-07  9:45 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wangkai at noahsi dot com dot cn  2009-09-07 09:45 -------
hi,

test env:
kernel version : 2.6.18
arch           : x86

I add "EXPORT_SYMBOL(si_swapinfo);" to mm/swapfile.c and recompile.
it's ok.

but if I using a vendor-supplied kernel,how can I get this info?


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10605

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/10605] Unknown symbol in module error (Unknown symbol si_swapinfo)
  2009-09-04  8:57 [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo) wangkai at noahsi dot com dot cn
                   ` (3 preceding siblings ...)
  2009-09-07  9:45 ` wangkai at noahsi dot com dot cn
@ 2009-09-07 10:06 ` wenji dot huang at oracle dot com
  2009-09-08  5:40 ` wangkai at noahsi dot com dot cn
  5 siblings, 0 replies; 7+ messages in thread
From: wenji dot huang at oracle dot com @ 2009-09-07 10:06 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wenji dot huang at oracle dot com  2009-09-07 10:06 -------
(In reply to comment #4)
> but if I using a vendor-supplied kernel,how can I get this info?
> 
Need to do a little tricky things to implement your own si_swapinfo.
for non-cross compilation situation, you can follow this.
In si_swapinfo, there are only three kernel variables needed swap_info, 
nr_swap_pages, total_swap_pages.

1. To look up the address for variables from System.map
2. Do type cast, from address to structures or unsigned long.
3. Wrote your own si_swapinfo in reference of kernel source.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10605

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug runtime/10605] Unknown symbol in module error (Unknown symbol si_swapinfo)
  2009-09-04  8:57 [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo) wangkai at noahsi dot com dot cn
                   ` (4 preceding siblings ...)
  2009-09-07 10:06 ` wenji dot huang at oracle dot com
@ 2009-09-08  5:40 ` wangkai at noahsi dot com dot cn
  5 siblings, 0 replies; 7+ messages in thread
From: wangkai at noahsi dot com dot cn @ 2009-09-08  5:40 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From wangkai at noahsi dot com dot cn  2009-09-08 05:40 -------
Did the trick. Thanks for your help.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=10605

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-08  5:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-04  8:57 [Bug runtime/10605] New: Unknown symbol in module error (Unknown symbol si_swapinfo) wangkai at noahsi dot com dot cn
2009-09-04 14:00 ` [Bug runtime/10605] " fche at redhat dot com
2009-09-04 14:09 ` dsmith at redhat dot com
2009-09-07  2:20 ` wangkai at noahsi dot com dot cn
2009-09-07  9:45 ` wangkai at noahsi dot com dot cn
2009-09-07 10:06 ` wenji dot huang at oracle dot com
2009-09-08  5:40 ` wangkai at noahsi dot com dot cn

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).