in flame graph. Only when both kernel and userland are displayed,
the whole picture of system activity becomes clear. Fixes a parsing
bug in the flame graph tool where userland time was interpreted as
invalid kernel stack.
OK kn@
-/* $OpenBSD: btrace.c,v 1.37 2021/06/23 11:24:01 dv Exp $ */
+/* $OpenBSD: btrace.c,v 1.38 2021/06/28 08:55:06 bluhm Exp $ */
/*
* Copyright (c) 2019 - 2020 Martin Pieuchot <mpi@openbsd.org>
size_t i;
int sz;
- if (!kernel || st->st_count == 0)
+ if (!kernel)
return "";
+ if (st->st_count == 0)
+ return "\nuserland\n";
buf[0] = '\0';
bp = buf;
bp += l;
sz -= l;
}
- snprintf(bp, sz, "\n");
+ snprintf(bp, sz, "\nkernel\n");
return buf;
}