Start implementing conditionals for filters.
authormpi <mpi@openbsd.org>
Mon, 1 Feb 2021 11:26:28 +0000 (11:26 +0000)
committermpi <mpi@openbsd.org>
Mon, 1 Feb 2021 11:26:28 +0000 (11:26 +0000)
commitea0c567a8e96fb7f14327c7b9b0bc447c6c64606
tree6e62e8d0f44a47f37d2588b46f38d35b4210af3c
parent781a6a5cf8982f5e2522c1a9481e61cacef7cfff
Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
  @start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
  @usecs = hist((nsecs - @start[pid]) / 1000);
  delete(@start[pid]);
}
usr.sbin/btrace/bt_parse.y
usr.sbin/btrace/bt_parser.h
usr.sbin/btrace/btrace.c