public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH]: catering for attribute_group shifting from header to C file in the linux kernel
@ 2008-05-18 14:39 Peter Teoh
  0 siblings, 0 replies; only message in thread
From: Peter Teoh @ 2008-05-18 14:39 UTC (permalink / raw)
  To: systemtap

[-- Attachment #1: Type: text/plain, Size: 1781 bytes --]

First I encountered the following when probing the following stap file:

probe kernel.function("*@mm/swapfile.c").call {
        printf ("%s -> %s\n", thread_indent(1), probefunc())
        print_backtrace();
        printf("\n");
}
probe kernel.function("*@mm/swapfile.c").return {
        printf ("%s <- %s\n", thread_indent(-1), probefunc())
        printf("\n");
}

In file included from
/usr/local/share/systemtap/runtime/transport/transport.c:22,
                 from /usr/local/share/systemtap/runtime/print.c:17,
                 from /usr/local/share/systemtap/runtime/runtime.h:82,
                 from
/tmp/stapD0oUOK/stap_24573f70afadcc1e52bf6cb62ce0c1f1_12247.c:41:
/usr/local/share/systemtap/runtime/transport/symbols.c: In function
'_stp_load_module_symbols':
/usr/local/share/systemtap/runtime/transport/symbols.c:407: error:
dereferencing pointer to incomplete type
/usr/local/share/systemtap/runtime/transport/symbols.c:425: error:
dereferencing pointer to incomplete type
/usr/local/share/systemtap/runtime/transport/symbols.c:427: error:
dereferencing pointer to incomplete type
/usr/local/share/systemtap/runtime/transport/symbols.c:456: error:
dereferencing pointer to incomplete type
/usr/local/share/systemtap/runtime/transport/symbols.c:457: error:
dereferencing pointer to incomplete type
/usr/local/share/systemtap/runtime/transport/symbols.c:460: error:
dereferencing pointer to incomplete type

And then I applied the patch as per attached, and did a compilation of
the temporary stap module in my linux kernel tree, it was successful:

/mnt/hd0/download/linux-2.6-latest>make
/tmp/stapL1n2n6/stap_dcc3707b505ec80a8051fda8cee6633c_12247.ko

Reason was because attribute_group is now declared in a C file in the
linux kernel.

-- 
Regards,
Peter Teoh

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: symbols.patch --]
[-- Type: text/x-patch; name=symbols.patch, Size: 721 bytes --]

--- runtime/transport/symbols.c	2008-04-17 00:23:04.000000000 +0800
+++ /usr/local/share/systemtap/runtime/transport/symbols.c	2008-05-18 10:04:12.000000000 +0800
@@ -400,6 +400,23 @@ static int _stp_section_is_interesting(c
 }
 
 /* Create a new _stp_module and load the symbols */
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
+struct module_sect_attr
+{
+        struct module_attribute mattr;
+        char *name;
+        unsigned long address;
+};
+
+struct module_sect_attrs
+{
+        struct attribute_group grp;
+        unsigned int nsections;
+        struct module_sect_attr attrs[0];
+};
+#endif
+
 static struct _stp_module *_stp_load_module_symbols(struct module *mod)
 {
 	int i, num, overflow = 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-18  2:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-18 14:39 [PATCH]: catering for attribute_group shifting from header to C file in the linux kernel Peter Teoh

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