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]

[Bug runtime/2903] define for_each_cpu() not found for runtime's alloc.c


------- Additional Comments From dwilder at us dot ibm dot com  2006-07-11 18:29 -------
Subject: Re:  New: define for_each_cpu() not found for runtime's
 alloc.c

wcohen at redhat dot com wrote:

>When attempting to get run tests on the recent snapshots of the rawhide kernels
>2.6.17-1.2358.fc6 on x86 and i386, the compiler did not find a define for
>for_each_cpu() for the runtime's alloc.c. Note that that a work around for Red
>Hat BZ#197220 needs to be done (touch the include/config/auto.conf in the
>directory installed by the kernel-devel RPM).
>
>$  /usr/bin/stap -vv -k -e 'probe begin { log ("hello world") }'
>Created temporary directory "/tmp/stapAChtpE"
>Searched '/usr/share/systemtap/tapset/2.6.17-1.2358.fc6PAE/i686/*.stp', match
>count 0
>Searched '/usr/share/systemtap/tapset/2.6.17-1.2358.fc6PAE/*.stp', match count
>0Searched '/usr/share/systemtap/tapset/2.6.17/i686/*.stp', match count 0
>Searched '/usr/share/systemtap/tapset/2.6.17/*.stp', match count 0
>Searched '/usr/share/systemtap/tapset/2.6/i686/*.stp', match count 0
>Searched '/usr/share/systemtap/tapset/2.6/*.stp', match count 0
>Searched '/usr/share/systemtap/tapset/i686/*.stp', match count 1
>Searched '/usr/share/systemtap/tapset/*.stp', match count 24
>Pass 1: parsed user script and 25 library script(s) in 280usr/20sys/301real ms.
>Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 global(s) in
>10usr/0sys/5real ms.
>probe_608 locks nothing
>Running grep " [tT] " /proc/kallsyms | sort -k 1,8 -s -o
>/tmp/stapAChtpE/symbols.sorted
>Pass 3: translated to C into "/tmp/stapAChtpE/stap_10020.c" in
>210usr/150sys/356real ms.
>Running make -C "/lib/modules/2.6.17-1.2358.fc6PAE/build" M="/tmp/stapAChtpE"
>modules V=1
>make: Entering directory `/usr/src/kernels/2.6.17-1.2358.fc6-PAE-i686'
>mkdir -p /tmp/stapAChtpE/.tmp_versions
>rm -f /tmp/stapAChtpE/.tmp_versions/*
>make -f scripts/Makefile.build obj=/tmp/stapAChtpE
>  gcc -m32 -Wp,-MD,/tmp/stapAChtpE/.stap_10020.o.d  -nostdinc -isystem
>/usr/lib/gcc/i386-redhat-linux/4.1.1/include -D__KERNEL__ -Iinclude  -include
>include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
>-fno-strict-aliasing -fno-common -Wstrict-prototypes -Wundef
>-Werror-implicit-function-declaration  -Os -fno-omit-frame-pointer
>-fno-optimize-sibling-calls -fasynchronous-unwind-tables -g -pipe -msoft-float
>-fno-builtin-sprintf -fno-builtin-log2 -fno-builtin-puts 
>-mpreferred-stack-boundary=2  -march=i686 -mtune=generic -mtune=generic
>-mregparm=3 -ffreestanding -Iinclude/asm-i386/mach-generic
>-Iinclude/asm-i386/mach-default -Wdeclaration-after-statement -Wno-pointer-sign
>-freorder-blocks -Wno-unused -Werror -I"/usr/share/systemtap/runtime"   -DMODULE
>-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(stap_10020)" 
>-D"KBUILD_MODNAME=KBUILD_STR(stap_10020)" -c -o
>/tmp/stapAChtpE/.tmp_stap_10020.o /tmp/stapAChtpE/stap_10020.c
>In file included from /usr/share/systemtap/runtime/runtime.h:66,
>                 from /tmp/stapAChtpE/stap_10020.c:31:
>/usr/share/systemtap/runtime/alloc.c: In function '_stp_alloc_percpu':
>/usr/share/systemtap/runtime/alloc.c:40: error: implicit declaration of function
>'for_each_cpu'
>/usr/share/systemtap/runtime/alloc.c:40: error: expected ';' before '{' token
>/usr/share/systemtap/runtime/alloc.c: In function 'free_percpu':
>/usr/share/systemtap/runtime/alloc.c:72: error: expected ';' before 'kfree'
>make[1]: *** [/tmp/stapAChtpE/stap_10020.o] Error 1
>make: *** [_module_/tmp/stapAChtpE] Error 2
>make: Leaving directory `/usr/src/kernels/2.6.17-1.2358.fc6-PAE-i686'
>Pass 4: compiled C into "stap_10020.ko" in 2240usr/850sys/3064real ms.
>Pass 4: compilation failed.  Try again with more '-v' (verbose) options.
>Keeping temporary directory "/tmp/stapAChtpE"
>
>  
>

The 2.6.17 kernel had the defines for backward compatibility:
#define for_each_cpu(cpu)  for_each_cpu_mask((cpu), cpu_possible_map)
#define for_each_possible_cpu(cpu)  for_each_cpu_mask((cpu), 
cpu_possible_map)
These defines were removed in 2.6.18

So we need to change two references in runtime/alloc.c

--- alloc.c.orig        2006-07-11 12:04:36.959606168 -0700
+++ alloc.c     2006-07-10 14:56:16.000000000 -0700
@@ -38,7 +38,7 @@
        if (!pdata)
                return NULL;
 
-       for_each_cpu(i){
+       for_each_possible_cpu(i){
                int node = cpu_to_node(i);
 
                if (node_online(node))
@@ -69,7 +69,7 @@
        int i;
        struct percpu_data *p = (struct percpu_data *) (~(unsigned long) 
objp);
 
-       for_each_cpu(i)
+       for_each_possible_cpu(i)
                kfree(p->ptrs[i]);
        kfree(p);
 }



-- 


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

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


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