From 0ed88eb252bdeb3dd9c5cd425d6a0e26816635b6 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Tue, 8 Sep 2009 17:02:51 -0400 Subject: Warn if the pid specified by -x does not belong to an unprivileged user. --- runtime/task_finder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/task_finder.c') diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 1a9a738a..eb81b8d3 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -1443,7 +1443,7 @@ stap_start_task_finder(void) #ifndef STP_PRIVILEGED /* Make sure unprivileged users only probe their own threads. */ if (_stp_uid != tsk_euid) { - if (tgt->pid != 0) { + if (tgt->pid != 0 || _stp_target) { _stp_warn("Process %d does not belong to unprivileged user %d", tsk->pid, _stp_uid); } -- cgit From 9b7a17471dd57572a63944fe46679c08c23faa13 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Fri, 4 Sep 2009 16:43:35 -0400 Subject: task_finder diagnostics: emit start_task_finder dbug message at end of fn. * task_finder.c (stap_start_task_finder): Emit _stp_dbug message at end rather at beginning, so printed utrace-engine attach counts reflect status at end of initialization rather than at beginning. --- runtime/task_finder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/task_finder.c') diff --git a/runtime/task_finder.c b/runtime/task_finder.c index eb81b8d3..488a6a2e 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -1357,7 +1357,6 @@ stap_start_task_finder(void) char *mmpath_buf; uid_t tsk_euid; - debug_task_finder_report(); mmpath_buf = _stp_kmalloc(PATH_MAX); if (mmpath_buf == NULL) { _stp_error("Unable to allocate space for path"); @@ -1462,8 +1461,8 @@ stap_start_task_finder(void) } while_each_thread(grp, tsk); stf_err: rcu_read_unlock(); - _stp_kfree(mmpath_buf); + debug_task_finder_report(); // report at end for utrace engine counting return rc; } -- cgit From 7622ef6a5183220fa56dedabaeb8fa87b0e43919 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Mon, 7 Sep 2009 17:34:39 -0400 Subject: task_finder diagnostics: standardize on STP_DEBUG_PRINTK * io.c (DEBUG_TASK_FINDER_PRINTK): Remove conditional. --- runtime/task_finder.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'runtime/task_finder.c') diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 488a6a2e..6b50f1b9 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -45,18 +45,10 @@ static atomic_t __stp_attach_count = ATOMIC_INIT (0); #define debug_task_finder_attach() (atomic_inc(&__stp_attach_count)) #define debug_task_finder_detach() (atomic_dec(&__stp_attach_count)) -#ifdef DEBUG_TASK_FINDER_PRINTK -#define debug_task_finder_report() (printk(KERN_ERR \ - "%s:%d attach count: %d, inuse count: %d\n", \ - __FUNCTION__, __LINE__, \ - atomic_read(&__stp_attach_count), \ - atomic_read(&__stp_inuse_count))) -#else #define debug_task_finder_report() (_stp_dbug(__FUNCTION__, __LINE__, \ "attach count: %d, inuse count: %d\n", \ atomic_read(&__stp_attach_count), \ atomic_read(&__stp_inuse_count))) -#endif /* !DEBUG_TASK_FINDER_PRINTK */ #else #define debug_task_finder_attach() /* empty */ #define debug_task_finder_detach() /* empty */ -- cgit