From: mpi Date: Sun, 13 Aug 2023 09:52:47 +0000 (+0000) Subject: Add support for storing builtin TID and PID in variables. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8e12692080a7aeff5578dff91915a5dd8c16f376;p=openbsd Add support for storing builtin TID and PID in variables. --- 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 @@ -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;