mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-context: skip context switches at head of trace
We can get stack traces which have a USER at the end, or KERNEL at the end, and nothing after it. Not really useful to us.
This commit is contained in:
@ -158,6 +158,16 @@ sysprof_callgraph_add_trace (SysprofCallgraph *self,
|
|||||||
|
|
||||||
parent = &self->root;
|
parent = &self->root;
|
||||||
|
|
||||||
|
/* If the first thing we see is a context switch, then there is
|
||||||
|
* nothing after it to account for. Just skip the symbol as it
|
||||||
|
* provides nothing to us in the callgraph.
|
||||||
|
*/
|
||||||
|
if (_sysprof_symbol_is_context_switch (symbols[0]))
|
||||||
|
{
|
||||||
|
symbols++;
|
||||||
|
n_symbols--;
|
||||||
|
}
|
||||||
|
|
||||||
for (guint i = n_symbols - 1; i > 0; i--)
|
for (guint i = n_symbols - 1; i > 0; i--)
|
||||||
{
|
{
|
||||||
SysprofSymbol *symbol = symbols[i-1];
|
SysprofSymbol *symbol = symbols[i-1];
|
||||||
|
|||||||
Reference in New Issue
Block a user