This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] Fix error checking in utrace_attach_task()
- From: David Smith <dsmith at redhat dot com>
- To: Atsushi Tsuji <a-tsuji at bk dot jp dot nec dot com>
- Cc: systemtap ML <systemtap at sources dot redhat dot com>
- Date: Thu, 02 Jun 2011 11:28:11 -0500
- Subject: Re: [PATCH] Fix error checking in utrace_attach_task()
- References: <4DE6DB70.30109@bk.jp.nec.com>
On 06/01/2011 07:38 PM, Atsushi Tsuji wrote:
> utrace_attach_task() returns not ENOENT but ESRCH in case of
> UTRACE_ATTACH_CREATE if an error occurs. So this patch fixes
> error checking to correctly ignore processes in "mortally
> wounded" state.
>
> Signed-off-by: Atsushi Tsuji <a-tsuji@bk.jp.nec.com>
> ---
> runtime/task_finder.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/runtime/task_finder.c b/runtime/task_finder.c
> index 2c52175..552972b 100644
> --- a/runtime/task_finder.c
> +++ b/runtime/task_finder.c
> @@ -506,7 +506,7 @@ __stp_utrace_attach(struct task_struct *tsk,
> engine = utrace_attach_task(tsk, UTRACE_ATTACH_CREATE, ops, data);
> if (IS_ERR(engine)) {
> int error = -PTR_ERR(engine);
> - if (error != ENOENT) {
> + if (error != ESRCH) {
> _stp_error("utrace_attach returned error %d on pid %d",
> error, (int)tsk->pid);
> rc = error;
> -- 1.7.2.1
Thanks a bunch for the patch, I've checked this in (commit ede8ec6). I
tweaked your patch a small bit to check for ENOENT and ESRCH, since
ENOENT seems to be returned by the old utrace in this case.
Thanks again!
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)