proc = sspt_proc_get_by_task(task);
if (proc)
+ /* TODO: uninstall_proc - is not atomic context */
uninstall_proc(proc);
}
void uninstall_all(void)
{
- int tmp_oops_in_progress;
-
- tmp_oops_in_progress = oops_in_progress;
- oops_in_progress = 1;
-
- on_each_proc(on_each_uninstall_proc, NULL);
-
- oops_in_progress = tmp_oops_in_progress;
-
+ wait_proc_lock();
+ on_each_proc_no_lock(on_each_uninstall_proc, NULL);
clean_pfg();
}
}
EXPORT_SYMBOL_GPL(sspt_proc_get_by_task);
-void on_each_proc(void (*func)(struct sspt_proc *, void *), void *data)
+void on_each_proc_no_lock(void (*func)(struct sspt_proc *, void *), void *data)
{
struct sspt_proc *proc, *tmp;
- spin_lock(&proc_lock);
list_for_each_entry_safe(proc, tmp, &proc_probes_list, list) {
func(proc, data);
}
+}
+
+void on_each_proc(void (*func)(struct sspt_proc *, void *), void *data)
+{
+ spin_lock(&proc_lock);
+ on_each_proc_no_lock(func, data);
spin_unlock(&proc_lock);
}
EXPORT_SYMBOL_GPL(on_each_proc);
+void wait_proc_lock(void)
+{
+ spin_lock(&proc_lock);
+ spin_unlock(&proc_lock);
+}
+
struct sspt_proc *sspt_proc_get_by_task_or_new(struct task_struct *task,
void *priv)
{
struct sspt_proc *sspt_proc_create(struct task_struct *task, void *priv);
void sspt_proc_free(struct sspt_proc *proc);
+void on_each_proc_no_lock(void (*func)(struct sspt_proc *, void *),
+ void *data);
void on_each_proc(void (*func)(struct sspt_proc *, void *), void *data);
+void wait_proc_lock(void);
struct sspt_proc *sspt_proc_get_by_task(struct task_struct *task);
struct sspt_proc *sspt_proc_get_by_task_or_new(struct task_struct *task,