summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-06-28 08:55:07 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-06-28 08:55:07 +0000
commitd34d7f3dbc8d01855af625e1eb5b93e18458fd3b (patch)
tree8333be536f1704efa0ffb7616e42209ed2fffd0a /usr.sbin
parent9f44144555755dd7b16e9d20be2a42a49b5055b7 (diff)
Also show the time spent in userland when analyzing the kernel stack
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/btrace/btrace.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c
index 961500a3a68..75966f836a4 100644
--- a/usr.sbin/btrace/btrace.c
+++ b/usr.sbin/btrace/btrace.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -638,8 +638,10 @@ builtin_stack(struct dt_evt *dtev, int kernel)
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;
@@ -658,7 +660,7 @@ builtin_stack(struct dt_evt *dtev, int kernel)
bp += l;
sz -= l;
}
- snprintf(bp, sz, "\n");
+ snprintf(bp, sz, "\nkernel\n");
return buf;
}