mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Call callback with an extra boolean indicating whether the sample read was
2007-10-20 Soren Sandmann <sandmann@daimi.au.dk> * collector.c (on_read): Call callback with an extra boolean indicating whether the sample read was the first one * collector.c (add_trace_to_stash): Allocate addresses on the stack if possible. * sysprof.c (on_new_sample): Only call update_sensitivity() on the first sample. * stackstash.c (stack_stash_add_trace): Move match to front svn path=/trunk/; revision=373
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
f1cbdbf27c
commit
476e6f0c1b
16
stackstash.c
16
stackstash.c
@ -165,13 +165,21 @@ stack_stash_add_trace (StackStash *stash,
|
||||
for (i = n_addrs - 1; i >= 0; --i)
|
||||
{
|
||||
StackNode *match = NULL;
|
||||
StackNode *n;
|
||||
StackNode *prev;
|
||||
|
||||
for (n = *location; n != NULL; n = n->siblings)
|
||||
prev = NULL;
|
||||
for (match = *location; match != NULL; prev = match, match = match->siblings)
|
||||
{
|
||||
if (n->address == (gpointer)addrs[i])
|
||||
if (match->address == (gpointer)addrs[i])
|
||||
{
|
||||
match = n;
|
||||
if (prev)
|
||||
{
|
||||
/* move to front */
|
||||
prev->siblings = match->siblings;
|
||||
match->siblings = *location;
|
||||
*location = match;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user