mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Updates
2007-11-16 Soren Sandmann <sandmann@daimi.au.dk> * TODO: Updates * process.c (process_locate_map): Move map to front * profile.c (profile_load): Ignore the toplevel field in the file since we can compute it ourselves. * stackstash.c (stack_stash_decorate): New function * stackstash.c (stack_stash_add_trace): Decorate the tree lazily instead of on each sample. svn path=/trunk/; revision=387
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
0118fb459b
commit
d82fe2e474
16
process.c
16
process.c
@ -127,13 +127,13 @@ read_maps (int pid, int *n_maps)
|
||||
g_array_append_val (result, map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
g_free (name);
|
||||
fclose (in);
|
||||
|
||||
if (n_maps)
|
||||
*n_maps = result->len;
|
||||
|
||||
|
||||
return (Map *)g_array_free (result, FALSE);
|
||||
}
|
||||
|
||||
@ -241,6 +241,18 @@ process_locate_map (Process *process, gulong addr)
|
||||
if ((addr >= map->start) &&
|
||||
(addr < map->end))
|
||||
{
|
||||
if (i > 4)
|
||||
{
|
||||
/* FIXME: Is this move-to-front really worth it? */
|
||||
Map tmp = *map;
|
||||
|
||||
memmove (process->maps + 1, process->maps, i * sizeof (Map));
|
||||
|
||||
*(process->maps) = tmp;
|
||||
|
||||
map = process->maps;
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user