Android でコマンド「staprun」を実行すると、次の問題が発生しました。
# /data/systemtap-1.0-omap/bin/staprun /data/local/msyscall_all.ko
/data/systemtap-1.0-omap/bin/staprun: 1: Syntax error: "(" unexpected
#
モジュール msyscall_all.ko は、私のアンドロイドが実行されているカーネルでクロスコンパイルされています。
まず、コマンド「insomd」と「lsmod」を使用して正しいことを確認しているため、msyscall_all.koが正確に正しいと確信しています。次のように実行しました。
# lsmod
omaplfb 8986 0 - Live 0xbf032000
pvrsrvkm 137346 29 omaplfb, Live 0xbf000000
# insmod /data/local/msyscall_all.ko
# lsmod
msyscall_all 1121778 0 - Live 0xbf037000
omaplfb 8986 0 - Live 0xbf032000
pvrsrvkm 137346 29 omaplfb, Live 0xbf000000
#
次に、http: //omappedia.org/wiki/Systemtap#Systemtap_1.0_code_update_for_OMAP_ARM_platformsの指示に従いました。
そして、私の systemtap-1.0-omap はクロスコンパイルに成功しました!! ただし、「adb push」を使用して systemtap-1.0-omap を Android デバイスにプッシュして実行した後、以下のエラーが発生しました。
/data/systemtap-1.0-omap/bin/staprun: 1: 構文エラー: "(" 予期しない
「staprun」がubuntuで実行されたとき、「staprun」の実行方法についてアドバイスがあり、Androidデバイスで実行されたときはうまくいきませんでした:
# /data/systemtap-1.0-omap/bin/staprun
/data/systemtap-1.0-omap/bin/staprun: 1: Syntax error: "(" unexpected
# exit
ubuntu@ubuntu:~$ cd systemtap-1.0-omap/bin/
ubuntu@ubuntu:~/systemtap-1.0-omap/bin$ ./staprun
ERROR: Need a module name or path to load.
./staprun [-v] [-c cmd ] [-x pid] [-u user] [-A|-L|-d]
[-b bufsize] [-o FILE [-D] [-S size[,N]]] MODULE [module-options]
-v Increase verbosity.
-c cmd Command 'cmd' will be run and staprun will
exit when it does. The '_stp_target' variable
will contain the pid for the command.
-x pid Sets the '_stp_target' variable to pid.
-o FILE Send output to FILE. This supports strftime(3)
formats for FILE.
-b buffer size The systemtap module specifies a buffer size.
Setting one here will override that value. The
value should be an integer between 1 and 4095
which be assumed to be the buffer size in MB.
That value will be per-cpu in bulk mode.
-L Load module and start probes, then detach.
-A Attach to loaded systemtap module.
-d Delete a module. Only detached or unused modules
the user has permission to access will be deleted. Use "*"
(quoted) to delete all unused modules.
-D Run in background. This requires '-o' option.
-S size[,N] Switches output file to next file when the size
of file reaches the specified size. The value
should be an integer greater than 1 which is
assumed to be the maximum file size in MB.
When the number of output files reaches N, it
switches to the first output file. You can omit
the second argument.
MODULE can be either a module name or a module path. If a
module name is used, it is looked for in the following
directory: /lib/modules/`uname -r`/systemtap
ubuntu@ubuntu:~/systemtap-1.0-omap/bin$
頑張ったけど解けない!!