This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: catering for attribute_group shifting from header to C file in the linux kernel


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
--- 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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]