diff --git a/ChangeLog b/ChangeLog index 77cf303b..9a9d22f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 6 23:38:48 2005 Søren Sandmann + + * sysprof-module.c (do_generate): Another desparate hack to try + and prevent the oops. + Sat Apr 30 16:57:23 2005 Soeren Sandmann * process.c (PAGE_SIZE): Use getpagesize() diff --git a/sysprof-module.c b/sysprof-module.c index 17a4ac4b..2497fa7d 100644 --- a/sysprof-module.c +++ b/sysprof-module.c @@ -335,9 +335,17 @@ do_generate (void *data) if (head++ == &stack_traces[N_TRACES - 1]) head = &stack_traces[0]; - - wake_up (&wait_for_trace); + /* This is crack, what we actually want is "put_task_struct()", + * but that macros uses __put_task_struct() which is not exported. + * + * It does look to me like the worst that will happen is a rare + * leak, which is certainly better than an oops. + */ + if (atomic_dec_and_test(&(task)->usage)) { + free_task (task); + } + mod_timer(&timer, jiffies + INTERVAL); } @@ -348,7 +356,7 @@ on_timer(unsigned long dong) { if (current && current->state == TASK_RUNNING && current->pid != 0) { - set_current_state (TASK_UNINTERRUPTIBLE); + get_task_struct (current); INIT_WORK (&work, do_generate, current);