This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: SystemTap + Android | Compiling Script | ERROR
- From: David Smith <dsmith at redhat dot com>
- To: ayush goel <ayushgoel1610 at gmail dot com>, Alexander Lochmann <alexander dot lochmann at tu-dortmund dot de>, systemtap at sourceware dot org
- Date: Wed, 2 Nov 2016 15:15:09 -0500
- Subject: Re: SystemTap + Android | Compiling Script | ERROR
- Authentication-results: sourceware.org; auth=none
- References: <CAGp8FVVCC1h+N96AqZtroEqTDQHsw0Ho_giyn6OiG=Dpa0GdfQ@mail.gmail.com> <ba9f5547-b9b7-94c7-ab0d-d65b8cf51899@tu-dortmund.de> <CAGp8FVXyk-VLGCrgpQJfNJjibZKVusQz9JDHAx2R3+_SEY850Q@mail.gmail.com> <CAGp8FVXpU11YiTp8JQyQ0JWFA3dxhg_m=WnSq3sX0G-aqdsrxQ@mail.gmail.com>
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)