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]

Re: SystemTap + Android | Compiling Script | ERROR


On 11/02/2016 02:38 PM, ayush goel wrote:
>>
>> Also, which tool should I be using specifically for compiling stap scripts into modules,
>> for android.
>> Your documentation talks about using build_module executable, and on the net I found
>> this another way using the ./installed/bin/stap executable.
>>
>  Kindly ignore the above comment. I just went through the code of
> build-module and it invokes the installed/bin/stap executable itself.
> 
> Also, I added the KERNEL_ARCH variable to my conf file and now at
> least the script gets fired.
> 
> I also recompiled my kernel the DEBUG_FS flag and I no longer see that
> error, so that’s some progress.
> 
> However the compilation process is still giving me some errors.
> ---------------------------------------------------------------------------------------------------------------
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/linux/alloc.c:345:14:
> error: static declaration of 'vzalloc' follows non-static declaration
>  static void *vzalloc(unsigned long size)
>               ^
> In file included from
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/linux/runtime.h:23:0,
>                  from
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/runtime.h:24,
>                  from /tmp/stapeKp7TT/monitor_fopen_src.c:26:
> include/linux/vmalloc.h:68:14: note: previous declaration of 'vzalloc' was here
>  extern void *vzalloc(unsigned long size);
>               ^
> In file included from
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/linux/runtime.h:212:0,
>                  from
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/runtime.h:24,
>                  from /tmp/stapeKp7TT/monitor_fopen_src.c:26:
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/linux/alloc.c:380:14:
> error: static declaration of 'vmalloc_node' follows non-static
> declaration
>  static void *vmalloc_node(unsigned long size, int node __attribute__((unused)))
>               ^
> In file included from
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/linux/runtime.h:23:0,
>                  from
> /root/sukritk/systemtap-android/installed//share/systemtap/runtime/runtime.h:24,
>                  from /tmp/stapeKp7TT/monitor_fopen_src.c:26:
> include/linux/vmalloc.h:70:14: note: previous declaration of
> 'vmalloc_node' was here
>  extern void *vmalloc_node(unsigned long size, int node);

What's going on here is that some linux kernels have a vzalloc()
function and some don't. We attempt to use the kernel's vzalloc()
function if available. If it isn't available, we roll our own.

In your case, the android kernel's include/linux/vmalloc.h file declared
a vzalloc() function but the systemtap build process didn't find it and
tried to use its own version.

Does the script you are using to run systemtap use the '-r BUILD_TREE'
option? I ask because it might be that your host kernel doesn't have a
vzalloc() function but your android kernel does and systemtap is looking
in the wrong place.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)


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