summaryrefslogtreecommitdiff
path: root/usr.sbin/btrace
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2023-08-13 09:52:48 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2023-08-13 09:52:48 +0000
commita0fb56dc0c7b50ccddc559c1ff29e24a3f1fe53e (patch)
treebdb4add12c0d6573273006c2053bb55a87dd026e /usr.sbin/btrace
parentdda263d12fb4ae45849f8a8cb6c7d0c237932119 (diff)
Add support for storing builtin TID and PID in variables.
Diffstat (limited to 'usr.sbin/btrace')
-rw-r--r--usr.sbin/btrace/btrace.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c
index 25333f98510..2a114c35041 100644
--- a/usr.sbin/btrace/btrace.c
+++ b/usr.sbin/btrace/btrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: btrace.c,v 1.71 2023/06/27 14:17:00 claudio Exp $ */
+/* $OpenBSD: btrace.c,v 1.72 2023/08/13 09:52:47 mpi Exp $ */
/*
* Copyright (c) 2019 - 2021 Martin Pieuchot <mpi@openbsd.org>
@@ -1028,6 +1028,14 @@ stmt_store(struct bt_stmt *bs, struct dt_evt *dtev)
bv->bv_value = ba;
bv->bv_type = B_VT_LONG;
break;
+ case B_AT_BI_PID:
+ bv->bv_value = ba_new((long)dtev->dtev_pid, B_AT_LONG);
+ bv->bv_type = B_VT_LONG;
+ break;
+ case B_AT_BI_TID:
+ bv->bv_value = ba_new((long)dtev->dtev_tid, B_AT_LONG);
+ bv->bv_type = B_VT_LONG;
+ break;
case B_AT_BI_NSECS:
bv->bv_value = ba_new(builtin_nsecs(dtev), B_AT_LONG);
bv->bv_type = B_VT_LONG;