systemtap-android icon indicating copy to clipboard operation
systemtap-android copied to clipboard

Error occured when compile script

Open Youlor opened this issue 5 years ago • 1 comments

Device: nexus5 Kernel: android-msm-hammerhead-3.4-kitkat-mr2, Enable CONFIG_DEBUG_INFO, CONFIG_KPROBES, CONFIG_RELAY, CONFIG_DEBUG_FS, CONFIG_MODULES, CONFIG_MODULE_UNLOAD, CONFIG_UPROBES

When I use toolchain arm-eabi-, Error occured. Logs:

./build-module measure_ra_pages msm
Executing: stap -p 4 -v  -a arm -B CROSS_COMPILE=arm-eabi- -r /home/youlor/android-4.4.4_r1/kernel/msm -t -g -m measure_ra_pages scripts/measure_ra_pages.stp
Pass 1: parsed user script and 108 library script(s) using 104604virt/41208res/6424shr/34932data kb, in 80usr/20sys/95real ms.
Pass 2: analyzed script: 9 probe(s), 12 function(s), 97 embed(s), 5 global(s) using 155664virt/93684res/7860shr/85992data kb, in 2050usr/340sys/2403real ms.
Pass 3: translated to C into "/tmp/stapLhq8pD/measure_ra_pages_src.c" using 155664virt/93812res/7988shr/85992data kb, in 10usr/30sys/49real ms.
/tmp/stapLhq8pD/measure_ra_pages_src.c:2205:2: error: 'PR_SET_MM_ARG_START' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2206:2: error: 'PR_SET_MM_ARG_END' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2207:2: error: 'PR_SET_MM_ENV_START' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2208:2: error: 'PR_SET_MM_ENV_END' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2209:2: error: 'PR_SET_MM_AUXV' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2210:2: error: 'PR_SET_MM_EXE_FILE' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2572:2: error: 'KEXEC_ON_CRASH' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2572:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2572:2: error: (near initialization for '_stp_kexec_flags_list[0].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2576:2: error: 'KEXEC_ARCH_DEFAULT' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2576:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2576:2: error: (near initialization for '_stp_kexec_flags_list[1].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2577:2: error: 'KEXEC_ARCH_386' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2577:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2577:2: error: (near initialization for '_stp_kexec_flags_list[2].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2578:2: error: 'KEXEC_ARCH_X86_64' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2578:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2578:2: error: (near initialization for '_stp_kexec_flags_list[3].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2579:2: error: 'KEXEC_ARCH_PPC' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2579:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2579:2: error: (near initialization for '_stp_kexec_flags_list[4].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2580:2: error: 'KEXEC_ARCH_PPC64' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2580:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2580:2: error: (near initialization for '_stp_kexec_flags_list[5].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2581:2: error: 'KEXEC_ARCH_IA_64' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2581:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2581:2: error: (near initialization for '_stp_kexec_flags_list[6].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2585:2: error: 'KEXEC_ARCH_S390' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2585:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2585:2: error: (near initialization for '_stp_kexec_flags_list[7].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c:2586:2: error: 'KEXEC_ARCH_SH' undeclared here (not in a function)
/tmp/stapLhq8pD/measure_ra_pages_src.c:2586:2: error: initializer element is not constant
/tmp/stapLhq8pD/measure_ra_pages_src.c:2586:2: error: (near initialization for '_stp_kexec_flags_list[8].val')
/tmp/stapLhq8pD/measure_ra_pages_src.c: In function 'function__stp_syscall_nr':
/tmp/stapLhq8pD/measure_ra_pages_src.c:4016:2: error: implicit declaration of function '_stp_syscall_get_nr' [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors

scripts/Makefile.build:307: recipe for target '/tmp/stapLhq8pD/measure_ra_pages_src.o' failed
make[1]: *** [/tmp/stapLhq8pD/measure_ra_pages_src.o] Error 1
Makefile:1369: recipe for target '_module_/tmp/stapLhq8pD' failed
make: *** [_module_/tmp/stapLhq8pD] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "measure_ra_pages.ko" in 2660usr/980sys/3583real ms.
Pass 4: compilation failed.  [man error::pass4]
Tip: /usr/share/doc/systemtap/README.Debian should help you get started.

Youlor avatar Jun 01 '19 13:06 Youlor

Apparently the failure/error comes from compiling source code measure_ra_pages_src.c, which is better to show its source along with the issue.

0xaead avatar Oct 26 '21 21:10 0xaead