systemtap fails to instrument kernel modules on ARM
William Cohen
wcohen@redhat.com
Thu Aug 11 20:52:00 GMT 2011
On 08/11/2011 03:02 PM, Da Zheng wrote:
> Hello,
>
> I tried to instrument the some function in the kernel module, but failed.
> I have a script called squashfs.stp:
> probe module("squashfs").function("squashfs_read_data") {
> printf("%s, squashfs_read_data: length: %d, srclength: %d, blocksize: %d\n",
> execname(), $length, $srclength, $sb->s_blocksize)
> }
>
> When I cross compile the script, I got the following error:
>
> $ stap --vp 01 -a arm -r /build/tegra2_seaboard/tmp/portage/sys-kernel/chromeos-kernel-9999/work/chromeos-kernel-9999/build/tegra2_seaboard/ -p 4 -B CROSS_COMPILE=armv7a-cros-linux-gnueabi- -k squashfs.stp -m squashfs --all-modules
> semantic error: no match while resolving probe point module("squashfs").function("squashfs_read_data")
> Pass 2: analyzed script: 0 probe(s), 0 function(s), 0 embed(s), 0 global(s) using 51668virt/21632res/2132shr kb, in 0usr/40sys/36real ms.
> Pass 2: analysis failed. Try again with another '--vp 01' option.
>
> I see Cohen reported a bug of instrumenting a kernel module on ARM, but it seems the error message is a little bit different.
> I wonder if the error was caused because stap can't find the module, as all kernel modules aren't in the standard path and aren't in /build/tegra2_seaboard/tmp/portage/sys-kernel/chromeos-kernel-9999/work/chromeos-kernel-9999/build/tegra2_seaboard/ either.
>
> Thanks,
> Da
Another thing to check is to check whether squashfs is being built as a module. Look at your .config for your kernel. If it the following it is being compiled in:
CONFIG_SQUASHFS=y
If is a module that would be:
CONFIG_SQUASHFS=m
If squashfs is being compiled into the kernel and you will want to use kernel.function("squashfs").function("..."). You can write the code to allow either like the following:
probe kernel.function("squashfs_read_data")!,
module("squashfs").function("squashfs_read_data") {
printf("%s, squashfs_read_data: length: %d, srclength: %d, blocksize: %d\n",
execname(), $length, $srclength, $sb->s_blocksize)
}
-Will
More information about the Systemtap
mailing list