This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH]: catering for attribute_group shifting from header to C file in the linux kernel
- From: "Peter Teoh" <htmldeveloper at gmail dot com>
- To: systemtap at sources dot redhat dot com
- Date: Sun, 18 May 2008 10:11:23 +0800
- Subject: [PATCH]: catering for attribute_group shifting from header to C file in the linux kernel
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=1OFsAgUlumd5yaOCkdTHXy9bAaO6D34QwXLVtSMpIl0=; b=WO8BFBaRNFjeGm4tyvvIXOJ1FaTq4dX3bvW/NF4vhoR5KLBAR7I+Pjv3IQT6w1BxizlJcECxtf2yQto+DXyQd+Mb7JSzBprc/4g3+9rwST2Jy6UsKGtBpagOXy6/sAg1rijAshdUXVSywVFuNRJAzzAVxx6HuHyN7xrUfiYe6T8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=uJ5XeVDl3XnsVkVWQ6Ppvwhmv8BG22vH49/eqyaVtdpJ790stEPzG838zDAkeAoU5jInH8gbbSZgQO1l10wI4pUhtRriPwRf8Llhtp4TT/MxxWLpWsvFNqgvRb1XgSYQUGl8so+a13EdcG+ECKX5WfbR3JK4Eb9YaR+oEf14IiI=
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;