mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Another desparate hack to try and prevent the oops.
Fri May 6 23:38:48 2005 Søren Sandmann <sandmann@redhat.com> * sysprof-module.c (do_generate): Another desparate hack to try and prevent the oops.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
6906804784
commit
582efc99b2
@ -1,3 +1,8 @@
|
||||
Fri May 6 23:38:48 2005 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* sysprof-module.c (do_generate): Another desparate hack to try
|
||||
and prevent the oops.
|
||||
|
||||
Sat Apr 30 16:57:23 2005 Soeren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* process.c (PAGE_SIZE): Use getpagesize()
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user