From d107fe8044105a30f176d513ae36b91ff82cae9d Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 25 Sep 2008 16:13:34 -0500 Subject: New utrace fixes. 2008-09-25 David Smith * task_finder.c (__stp_utrace_attach): Added action flag to know to request the thread to be stopped or not. (stap_utrace_attach): Now just calls __stp_utrace_attach(). (__stp_utrace_task_finder_target_quiesce): Handles utrace_set_events() errors properly. * utrace_compatibility.h (enum utrace_resume_action): Added utrace_resume_action enum. (utrace_control): Added UTRACE_STOP support. (utrace_engine_put): New. (utrace_barrier): New. --- runtime/utrace_compatibility.h | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'runtime/utrace_compatibility.h') diff --git a/runtime/utrace_compatibility.h b/runtime/utrace_compatibility.h index 80037015..27fca250 100644 --- a/runtime/utrace_compatibility.h +++ b/runtime/utrace_compatibility.h @@ -24,9 +24,11 @@ #define UTRACE_ORIG_VERSION -#define UTRACE_RESUME UTRACE_ACTION_RESUME -#define UTRACE_DETACH UTRACE_ACTION_DETACH -#define UTRACE_STOP UTRACE_ACTION_QUIESCE +enum utrace_resume_action { + UTRACE_STOP = UTRACE_ACTION_QUIESCE, + UTRACE_RESUME = UTRACE_ACTION_RESUME, + UTRACE_DETACH = UTRACE_ACTION_DETACH, +}; static inline struct utrace_attached_engine * utrace_attach_task(struct task_struct *target, int flags, @@ -38,11 +40,17 @@ utrace_attach_task(struct task_struct *target, int flags, static inline int __must_check utrace_control(struct task_struct *target, struct utrace_attached_engine *engine, - unsigned long action) + enum utrace_resume_action action) { - if (action == UTRACE_DETACH) + switch (action) { + case UTRACE_DETACH: return utrace_detach(target, engine); - return -EINVAL; + case UTRACE_STOP: + return utrace_set_flags(target, engine, + (engine->flags | UTRACE_ACTION_QUIESCE)); + default: + return -EINVAL; + } } static inline int __must_check @@ -52,6 +60,19 @@ utrace_set_events(struct task_struct *target, { return utrace_set_flags(target, engine, eventmask); } + +static inline void +utrace_engine_put(struct utrace_attached_engine *engine) +{ + return; +} + +static inline int __must_check +utrace_barrier(struct task_struct *target, + struct utrace_attached_engine *engine) +{ + return 0; +} #endif #endif /* _UTRACE_COMPATIBILITY_H_ */ -- cgit