]> sourceware.org Git - systemtap.git/commit
task_finder: error out when we cannot attach to _stp_target
authorSultan Alsawaf <sultan@openresty.com>
Thu, 29 Oct 2020 08:24:43 +0000 (01:24 -0700)
committerYichun Zhang (agentzh) <yichun@openresty.com>
Thu, 29 Oct 2020 08:25:10 +0000 (01:25 -0700)
commitfeb0327b6370e8f560afe740564d6f64e9750949
tree2724818bb4ea65b6f6ec0662b9a20b50a90c29ed
parent41040e6cdbcf0e5fa18411dde68250c7d0797dd4
task_finder: error out when we cannot attach to _stp_target

In order to avoid sleeping, stap_find_exe_file() does a trylock attempt
on an mm's mmap semaphore and returns NULL when the lock is contented.
When this happens, it can cause the task finder to not attach to a
desired target process. This is especially noticeable when a target PID
is specified, in which case the target PID itself can get skipped over
by the task finder.

Therefore, we should treat failures to get the exe file for a specific
target PID as fatal, since that means the target PID will never get
attached. Note that we must return a negative value from
stap_start_task_finder() in order for the fatal error to be honored, so
we shouldn't negate PTR_ERR(mmpath).

Signed-off-by: Yichun Zhang (agentzh) <yichun@openresty.com>
runtime/linux/task_finder.c
runtime/linux/task_finder2.c
This page took 0.02615 seconds and 5 git commands to generate.