Necessary to measure latency, example below to better understand the kqueue
select(2) regression:
syscall:select:entry { @start[pid] = nsecs; }
syscall:select:return { @usecs = hist((nsecs - @start[pid]) / 1000); }
-/* $OpenBSD: btrace.c,v 1.26 2020/12/07 18:28:09 bluhm Exp $ */
+/* $OpenBSD: btrace.c,v 1.27 2021/01/21 13:19:25 mpi Exp $ */
/*
* Copyright (c) 2019 - 2020 Martin Pieuchot <mpi@openbsd.org>
long
ba2long(struct bt_arg *ba, struct dt_evt *dtev)
{
+ struct bt_var *bv;
long val;
switch (ba->ba_type) {
ba = ba_read(ba);
val = (long)ba->ba_value;
break;
+ case B_AT_MAP:
+ bv = ba->ba_value;
+ val = ba2long(map_get((struct map *)bv->bv_value,
+ ba2str(ba->ba_key, dtev)), dtev);
+ break;
case B_AT_BI_NSECS:
val = builtin_nsecs(dtev);
break;
-/* $OpenBSD: map.c,v 1.11 2020/09/18 19:19:38 jasper Exp $ */
+/* $OpenBSD: map.c,v 1.12 2021/01/21 13:19:25 mpi Exp $ */
/*
* Copyright (c) 2020 Martin Pieuchot <mpi@openbsd.org>
free(mep->mval);
mep->mval = bval;
break;
+ case B_AT_BI_NSECS:
case B_AT_BI_RETVAL:
free(mep->mval);
mep->mval = ba_new(ba2long(bval, dtev), B_AT_LONG);