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: Met Problem on Enable SystemTap on Android


2011/8/30 Josh Stone <jistone@redhat.com>:
> On 08/30/2011 12:48 PM, Yao,Yanjun wrote:
>> Thank you for your reply.
>>
>> 2011/8/30 Josh Stone <jistone@redhat.com>:
>>> On 08/30/2011 12:10 PM, Yao,Yanjun wrote:
>>>> Hi all,
>>>>
>>>> I tried enable SystemTap on Android, however, after I finished all the
>>>> set up, no matter what I tried to run, I always get a "stap: 57:
>>>> Syntax error: "(" unexpected" error.
>>>
>>> That's an odd error - can you provide more context? ?What command line
>>> are you running, and what is the full output from it?
>>>
>>
>> The following is the commands and the output:
>> # ./stap syscalls_by_pid.stp -c "sleep 0.2"
>> ./stap: 57: Syntax error: "(" unexpected
>>
>> The syscalls_by_pid.stp is the example provided in
>> http://sourceware.org/systemtap/examples/
>
> This is still strange. ?That example only has 28 lines, and as far as I
> can see there isn't any place in stap where we print any error of the
> form "Syntax error: ...".
>
> To me this looks like a bash shell error, as if ./stap were a script.
> Do you have some kind of wrapper in use?
>

I am a starter of both Android Kernel and SystemTap. I am not sure
what kind of wrapper the system can be use, but I did not make any
change to the kernel code. I just downloaded the source by following
the instructions in
http://source.android.com/source/initializing.html.

> It may also help to try with a few verbose flags, -vvvv
>

I tried it with the -vvvv, but the same problem happens:

# ./stap -vvvv
./stap: 57: Syntax error: "(" unexpected
# ./staprun -vvv
./staprun: 1: Syntax error: ")" unexpected

All of the above run in "adb shell", is this the problem?

>>> Why are you invoking staprun with the wireless driver module? ?This is
>>> meant to be invoked with a .ko that was compiled by stap. ?If you
>>> happened to name your stap module with "-m bcm4329", then that's an
>>> issue, as it must be unique from the kernel's own modules.
>>>
>>
>> I followed the instructions in http://omappedia.org/wiki/Systemtap. It
>> said I need to copy kernel modules on the target, and launch them
>> through staprun. So I find the .ko file in the Android Source. May I
>> ask what the .ko file should be? This is the only file I can find in
>> both Android Source and the systemtap folders. I even tried to find a
>> .ko file in adb shell, but found nothing.
>
> I see. ?I believe that wiki page means that you should cross-compile
> your systemtap script on the host machine, as described here:
> ?http://omappedia.org/wiki/Systemtap#Systemtap_Scripts_compilation
>
> Then copy *that* resulting .ko file to your Android device, and that's
> the file path that you should give to staprun.
>

I tried to get the .ko file but not succeed. The command should be in format:
./stap -gv -a arm -D OMAP_REL_FAMILY -B
CROSS_COMPILE=arm-none-linux-gnueabi- -r FULLKERNELPATH -I
FULLTAPSETPATH -R SYSTEMTAPCFILEPATH -m SYSTEMTAPMODULENAME SCRIPTNAME

So I set (the command is run in UBUNTU 11.04):
   OMAP_REL_FAMILY  == OMAP_L25
   FULLKERNELPATH  ==
/home/xxx/WORKING_DIRECTORY/prebuilt/android-arm/kernel/vmlinux-qemu
   FULLTAPSETPATH  ==  /data/systemtap-1.5-macharm/share/systemtap/tapset/
   SYSTEMTAPCFILEPATH  == /data/systemtap-1.5-macharm/share/systemtap/runtime
   SYSTEMTAPMODULENAME  == contextswitch
   SCRIPTNAME ==

The problem is that:
1. The did not download the kernel code, as I can get a user debug
enabled kernel with android source. There are prebuild codes for the
building, however, the binary I found with the name
"/home/xxx/WORKING_DIRECTORY/prebuilt/android-arm/kernel/vmlinux-qemu"
seems does not work fine. May I ask do I need to download the kernel
code, and get the kernel img from that? Or it is just because I found
the wrong prebuild kernel file.
2. I did not find the contextswitch.stp as mentioned in
http://omappedia.org/wiki/Systemtap#Systemtap_Scripts_compilation. Is
there other scripts has the same functionality? If not, where can I
download the contextswitch.stp?

>
> Josh
>

Thank you very much.

Yours
SIncerely


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