Android上的SystemTap

时间:2013-09-04 07:14:22

标签: android linux systemtap

当我在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与我的android运行的内核交叉编译。

首先,我确信msyscall_all.ko是完全正确的,因为我使用命令'insomd'和'lsmod'来确保它是正确的。我做了如下:

# 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已成功交叉编译!! Howerver,在我使用'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$ 

我尽了最大努力,但我无法解决它!

0 个答案:

没有答案