Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12241

Uprobes not working in v4.14.x kernel with SystemTap on 32-bit ARM platform

$
0
0

I rely on Uprobes for the dynamic instrumentation of a shared library. While everything I need is working perfectly on x86 systems, unexpected errors appear when working with the Linux v4.14.x kernel on a 32.bit ARM platform: the Odroid XU4 board. I am currently using the kernel provided by the board manufacturer (Hardkernel).

Essentially, all Systemtap probes with the following format fail:

process(<PATH_TO_EXECUTABLE_OR_SHARED_LIB>).mark(<MARKER_NAME>)
process(<PATH_TO_EXECUTABLE_OR_SHARED_LIB).function(<FUNCTION_NAME>)

Example for the example_openmp_stap executable:

$ stap -e 'probe process("./example_openmp_stap").function("main") { printf("Hey\n")}' -c ./example_openmp_stap
WARNING: probe process("/tmp/example_openmp_stap").function("main") at inode-offset 165296:00000789 registration error (rc -22)
WARNING: task_finder mmap inode-uprobes callback for task 4989 failed: -22
...

By contrast, some features of the process probe "family" do work:

$ stap -e 'probe process("/tmp/example_openmp_stap").begin { printf("Program launched\n")}' -c ./example_openmp_stap
Program launched

Apparently, the kernel function uprobe_register() --defined at kernel/events/uprobes.c-- is the one that fails (it returns -EINVAL). Note that the kernel has been apparently compiled with all the necessary symbols:

CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_UPROBES=y
CONFIG_UPROBE_EVENTS=y

I compiled and install SystemTap from its GIT repository (latest version):

$ stap --version
Systemtap translator/driver (version 4.3/0.170, commit release-4.2-41-g0e1d5b7eb397 + changes)
Copyright (C) 2005-2019 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 5.4-rc6
enabled features: AVAHI BPF LIBSQLITE3 NLS NSS

Any information which sheds light on how to fix this will be greatly appreciated!

PS.: Note that this does not work either with 4.9.x or 3.10.x kernels.


Viewing all articles
Browse latest Browse all 12241

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>