We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have run "cat /proc/kallsyms | grep perf_event_create_kernel_counter", and the output is empty. I went down to /proc and find kallsyms is 0 byte.
However, I have checked and found I did built kernel with CONFIG_PERF_EVENTS. Could you please offer more advice regarding where went wrong?
I assume you did an ls of /proc and saw that kallsyms is 0 bytes? Most files in the proc filesystem show empty even if they really aren't. For example, one Linux machine I have access to shows this> ls -l /proc/kallsyms -r--r--r-- 1 root root 0 Aug 29 23:05 /proc/kallsymsBut when I cat it, I get results> cat /proc/kallsyms0000000000000000 D irq_stack_union0000000000000000 D __per_cpu_startffffffff810001c8 t run_init_processffffffff810001c8 T _stextffffffff810001e8 T do_one_initcallffffffff810002f4 t match_dev_by_uuidffffffff8100031f T name_to_dev_tffffffff81000670 t init_linuxrcffffffff81001000 T set_personality_ia32ffffffff810010a1 t start_thread_common.constprop.4...Do you get any results when you say cat /proc/kallsyms?How are you compiling gator.ko? Can you please share the output of the compile? Try building the gator.ko kernel module with the same toolchain you're using to build the kernel. I've seen issues where if the toolchains are different the module may not load or run correctly. Also the gcc provided by the Android NDK does not always work correctly. Please also try using the gcc distributed with DS-5.
I did use the exact same toolchain I used to build the kernel to build gator.ko. And I did not use Android NDK, instead, I used the cross compiler of the prebuilt tools downloaded along with the kernel source when building cm 10.1 ( http://wiki.cyanogen...uild_for_p4wifi).
To the kernel module gator.ko side:export ARCH=armexport CROSS_COMPILE=/p/arch/Xdong/android_src/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-make -C /home/vax7/p2/arch/Xdong/android_src/android/system/kernel/samsung/p4 M=`pwd` cleanmake -C /home/vax7/p2/arch/Xdong/android_src/android/system/kernel/samsung/p4 M=`pwd` CFLAGS_MODULE=-fno-pic modulesAnd here is the output when compiling gator.ko:make: Entering directory `/home/vax7/p2/arch/Xdong/android_src/android/system/kernel/samsung/p4' CLEAN /home/vax7/p2/arch/Xdong/android_modules/gator-driver CLEAN /home/vax7/p2/arch/Xdong/android_modules/gator-driver/.tmp_versions CLEAN /home/vax7/p2/arch/Xdong/android_modules/gator-driver/Module.symversmake: Leaving directory `/home/vax7/p2/arch/Xdong/android_src/android/system/kernel/samsung/p4'make: Entering directory `/home/vax7/p2/arch/Xdong/android_src/android/system/kernel/samsung/p4' CHK gator_events.h CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_main.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_irq.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_sched.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_net.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_block.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_meminfo.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_perf_pmu.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_mmaped.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_armv6.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_armv7.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_l2c-310.o CC [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator_events_scorpion.o LD [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator.o Building modules, stage 2. MODPOST 1 modules CC /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator.mod.o LD [M] /home/vax7/p2/arch/Xdong/android_modules/gator-driver/gator.komake: Leaving directory `/home/vax7/p2/arch/Xdong/android_src/android/system/kernel/samsung/p4
To the kernel side:export ARCH=armexport CROSS_COMPILE=/p/arch/Xdong/android_src/android/system/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-make cyanogenmod_samsung_p4wifi-jb_defconfigmake modules -j4where cyanogenmod_samsung_p4wifi-jb_defconfig have already been edited to enable those options listed in README_Streamline.txt.
I have run "cat /proc/kallsyms" and there are a lot of lines in the output. However, when I run "cat /proc/kallsyms | grep perf_event", I got nothing.
Fantastic, thank you for confirming this. That looks perfect.[size="2"]I see you building the kernel modules here, but not the kernel itself. Usually a uImage or zImage is built then installed on the device. Are you also doing this?[size="2"]That is concerning - you should see the perf_event entries. My best guess is that the kernel config you have on your host machine (where you are cross compiling everything) has been updated to include CONFIG_PERF_EVENTS but the kernel running on the device has not yet been updated. I do not know how to do this for your device, but I think if you can do it it will resolve the "Unknown symbol" errors.
Note: This was originally posted on 3rd September 2013 at forums.arm.com
Thank you SO MUCH, Drew!!! The problem is solved. I edited cyanogenmod_samsung_p4wifi-jb_defconfig and added CONFIG_HW_PERF_EVENT in it. Then built the kernel again and the problem is gone! Actually I still do not quite get where went wrong, as CONFIG_PERF_EVENTS should be the macro responsible for functions like perf_event_release_kernel, but it have already been enabled in cyanogenmod_samsung_p4wifi-jb_defconfig before.Anyway, the problem is fixed. Thank you once again, Drew!Best regards,Xiaowan
I am glad that this problem is fixed. To help fix the problem for future users, will you please answer a followup question - when I remove CONFIG_HW_PERF_EVENT from my config I get this error
> make -C ~/linux-linaro-tracking M=`pwd` ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modulesmake: Entering directory `~/linux-linaro-tracking'CHK gator_events.hCC [M] ~/gator/driver/gator_main.o~/gator/driver/gator_main.c:55:2: error: #error gator requires the kernel to have CONFIG_HW_PERF_EVENTS defined to support pmu hardware countersmake[1]: *** [~/gator/driver/gator_main.o] Error 1make: *** [_module_/~/gator/driver] Error 2make: Leaving directory `~/linux-linaro-tracking'
The lines that create the error are as follows in the gator sources distributed with DS5 v5.15:
driver/gator.h:18:#define GATOR_PERF_PMU_SUPPORT GATOR_PERF_SUPPORT && defined(CONFIG_PERF_EVENTS) && (!(defined(__arm__) || defined(__aarch64__)) || defined(CONFIG_HW_PERF_EVENTS))
driver/gator_main.c:51:#if (GATOR_PERF_SUPPORT) && (!(GATOR_PERF_PMU_SUPPORT))driver/gator_main.c:52:#ifndef CONFIG_PERF_EVENTSdriver/gator_main.c:53:#error gator requires the kernel to have CONFIG_PERF_EVENTS defined to support pmu hardware countersdriver/gator_main.c:54:#elif !defined CONFIG_HW_PERF_EVENTSdriver/gator_main.c:55:#error gator requires the kernel to have CONFIG_HW_PERF_EVENTS defined to support pmu hardware countersdriver/gator_main.c:56:#endifdriver/gator_main.c:57:#endif
What does your gator.ko source code look like?
Note: This was originally posted on 6th September 2013 at forums.arm.com
I am glad that this problem is fixed. To help fix the problem for future users, will you please answer a followup question - when I remove CONFIG_HW_PERF_EVENT from my config I get this error> make -C ~/linux-linaro-tracking M=`pwd` ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modulesmake: Entering directory `~/linux-linaro-tracking'CHK gator_events.hCC [M] ~/gator/driver/gator_main.o~/gator/driver/gator_main.c:55:2: error: #error gator requires the kernel to have CONFIG_HW_PERF_EVENTS defined to support pmu hardware countersmake[1]: *** [~/gator/driver/gator_main.o] Error 1make: *** [_module_/~/gator/driver] Error 2make: Leaving directory `~/linux-linaro-tracking'The lines that create the error are as follows in the gator sources distributed with DS5 v5.15:driver/gator.h:18:#define GATOR_PERF_PMU_SUPPORT GATOR_PERF_SUPPORT && defined(CONFIG_PERF_EVENTS) && (!(defined(__arm__) || defined(__aarch64__)) || defined(CONFIG_HW_PERF_EVENTS))driver/gator_main.c:51:#if (GATOR_PERF_SUPPORT) && (!(GATOR_PERF_PMU_SUPPORT))driver/gator_main.c:52:#ifndef CONFIG_PERF_EVENTSdriver/gator_main.c:53:#error gator requires the kernel to have CONFIG_PERF_EVENTS defined to support pmu hardware countersdriver/gator_main.c:54:#elif !defined CONFIG_HW_PERF_EVENTSdriver/gator_main.c:55:#error gator requires the kernel to have CONFIG_HW_PERF_EVENTS defined to support pmu hardware countersdriver/gator_main.c:56:#endifdriver/gator_main.c:57:#endifWhat does your gator.ko source code look like?
Hi Drew,
If I compile gator.ko without enabling CONFIG_HW_PERF_EVENTS, I will got errors too. What I did before was to enable it in menuconfig, then compile gator.ko. However, this was done after I have built the kernel. As you have said before, the kernel image running on my device does not get CONFIG_HW_PERF_EVENTS enabled in this way.
But I am still not sure how I solved this unknown symbol problem.
Thank you!
Best regards,
Xiaowan
Note: This was originally posted on 30th August 2013 at forums.arm.com
The unknown symbols perf_event_* imply that your kernel is not compiled with perf support. Older versions DS-5, like 5.5, did not use perf which is why you can run it. However gator.ko from DS-5 v5.15 uses perf on kernels 3.0 and newer (which I assume you're using). Is the kernel you're running built with CONFIG_PERF_EVENTS? To check you can run "cat /proc/kallsyms | grep perf_event_create_kernel_counter" from the adb shell. Here's what I get on my Nexus 10root@android:/ # cat /proc/kallsyms | grep perf_event_create_kernel_counter 00000000 T perf_event_create_kernel_counter00000000 r __ksymtab_perf_event_create_kernel_counter00000000 r __kstrtab_perf_event_create_kernel_counterIf it's missing you will need to enable it using menuconfig and then install the resulting kernel on your Galaxy Tab 10.1.
Thank you SO MUCH for your reply.
I have run "cat /proc/kallsyms | grep perf_event_create_kernel_counter", and the output is empty. I went down to /proc and find kallsyms is 0 byte. However, I have checked and found I did built kernel with CONFIG_PERF_EVENTS. Could you please offer more advice regarding where went wrong?