diff options
author | Soren Sandmann <sandmann@redhat.com> | 2006-09-23 03:09:24 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2006-09-23 03:09:24 +0000 |
commit | 6a7178f612abbfe50795ef654c946669b70ed61d (patch) | |
tree | 26648cd69e357912214fe5e0576815a20159de05 /module | |
parent | 8f4d731788477c12ad555a57064eda0975e8386e (diff) |
Remove old commented out code Add commented out code accessing entire
2006-08-27 Soren Sandmann <sandmann@redhat.com>
* binparser.c: Remove old commented out code
* module/sysprof-module.c: Add commented out code accessing entire
stack.
2006-08-27 Soren Sandmann <sandmann@redhat.com>
* module/Makefile ($(MODULE).o): Add dependency on sysprof-module.h
* elfparser.c (elf_parser_get_eh_frame): Add this function.
Remove some commented out code.
Diffstat (limited to 'module')
-rw-r--r-- | module/Makefile | 2 | ||||
-rw-r--r-- | module/sysprof-module.c | 39 |
2 files changed, 40 insertions, 1 deletions
diff --git a/module/Makefile b/module/Makefile index 850c896..f89c2e3 100644 --- a/module/Makefile +++ b/module/Makefile @@ -28,7 +28,7 @@ endif # build module -$(MODULE).o: $(MODULE).c +$(MODULE).o: $(MODULE).c $(MODULE).h $(KMAKE) modules diff --git a/module/sysprof-module.c b/module/sysprof-module.c index d4f30b4..cf03d37 100644 --- a/module/sysprof-module.c +++ b/module/sysprof-module.c @@ -126,6 +126,9 @@ timer_notify (struct pt_regs *regs) StackFrame frame; int result; static atomic_t in_timer_notify = ATOMIC_INIT(1); +#if 0 + int stacksize; +#endif if (((++get_cpu_var(n_samples)) % INTERVAL) != 0) return 0; @@ -157,11 +160,47 @@ timer_notify (struct pt_regs *regs) trace->addresses[i++] = (void *)regs->REG_INS_PTR; frame_pointer = (void *)regs->REG_FRAME_PTR; + + { +#if 0 + /* In principle we should use get_task_mm() but + * that will use task_lock() leading to deadlock + * if somebody already has the lock + */ + if (spin_is_locked (¤t->alloc_lock)) + printk ("alreadylocked\n"); + { + struct mm_struct *mm = current->mm; + if (mm) + { + printk (KERN_ALERT "stack size: %d (%d)\n", + mm->start_stack - regs->REG_STACK_PTR, + current->pid); + + stacksize = mm->start_stack - regs->REG_STACK_PTR; + } + else + stacksize = 1; + } +#endif +#if 0 + else + printk (KERN_ALERT "could not lock on %d\n", current->pid); +#endif + } +#if 0 + if (stacksize < 100000) + goto out; +#endif + while (((result = read_frame (frame_pointer, &frame)) == 0) && i < SYSPROF_MAX_ADDRESSES && (unsigned long)frame_pointer >= regs->REG_STACK_PTR) { +#if 0 + printk ("frame pointer: %p (retaddr: %p)\n", frame_pointer, frame.return_address); +#endif trace->addresses[i++] = (void *)frame.return_address; frame_pointer = (StackFrame *)frame.next; } |