From fb3045c11367a3ffa9b8398cf9cecbce98e8711c Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Thu, 22 Apr 2021 09:36:40 +0000 Subject: Remove support for in-kernel filters. This might be added back in a future if copying events to userland becomes a performance issue. However note that it is not always possible to filter in-kernel if, for example. a variable has to be evaluated when a rule fires. --- usr.sbin/btrace/bt_parse.y | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'usr.sbin/btrace/bt_parse.y') diff --git a/usr.sbin/btrace/bt_parse.y b/usr.sbin/btrace/bt_parse.y index 44f4204051f..6a4aa5d8361 100644 --- a/usr.sbin/btrace/bt_parse.y +++ b/usr.sbin/btrace/bt_parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_parse.y,v 1.29 2021/04/21 10:53:17 mpi Exp $ */ +/* $OpenBSD: bt_parse.y,v 1.30 2021/04/22 09:36:39 mpi Exp $ */ /* * Copyright (c) 2019-2021 Martin Pieuchot @@ -58,7 +58,6 @@ SLIST_HEAD(, bt_var) l_variables; struct bt_rule *br_new(struct bt_probe *, struct bt_filter *, struct bt_stmt *, enum bt_rtype); -struct bt_filter *bf_new(enum bt_argtype, enum bt_filtervar, int); struct bt_probe *bp_new(const char *, const char *, const char *, int32_t); struct bt_arg *ba_append(struct bt_arg *, struct bt_arg *); struct bt_arg *ba_op(enum bt_argtype, struct bt_arg *, struct bt_arg *); @@ -121,7 +120,7 @@ static int pflag; %type gvar lvar %type staticval -%type fval testop binop builtin +%type testop binop builtin %type BUILTIN F_DELETE F_PRINT FUNC0 FUNC1 FUNCN OP1 OP4 %type MOP0 MOP1 %type probe probename @@ -156,11 +155,6 @@ probename : STRING ':' STRING ':' STRING { $$ = bp_new($1, $3, $5, 0); } | STRING ':' HZ ':' NUMBER { $$ = bp_new($1, "hz", NULL, $5); } ; - -fval : PID { $$ = B_FV_PID; } - | TID { $$ = B_FV_TID; } - ; - testop : OP_EQ { $$ = B_AT_OP_EQ; } | OP_NE { $$ = B_AT_OP_NE; } | OP_LE { $$ = B_AT_OP_LE; } @@ -301,25 +295,6 @@ br_new(struct bt_probe *probe, struct bt_filter *filter, struct bt_stmt *head, return br; } -/* Create a new event filter */ -struct bt_filter * -bf_new(enum bt_argtype op, enum bt_filtervar var, int val) -{ - struct bt_filter *bf; - - if (val < 0 || val > INT_MAX) - errx(1, "invalid pid '%d'", val); - - bf = calloc(1, sizeof(*bf)); - if (bf == NULL) - err(1, "bt_filter: calloc"); - bf->bf_evtfilter.bf_op = op; - bf->bf_evtfilter.bf_var = var; - bf->bf_evtfilter.bf_val = val; - - return bf; -} - /* Create a new condition */ struct bt_filter * bc_new(struct bt_arg *term, enum bt_argtype op, struct bt_arg *ba) -- cgit v1.2.3