summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2021-01-10 11:06:09 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2021-01-10 11:06:09 +0000
commitec45cd9e9d1aed5afeb267877f4bda7003a0d4ee (patch)
tree55c5f67bc7c0fffe27fd6cd15472b9011026c5e0
parent0f878ad3242a9fac2225b725cf884f8ce4649638 (diff)
Exclude the 'hz' token from the lexer backdoor, so interval and profile
probes can be parsed again. ok anton@ kn@
-rw-r--r--usr.sbin/btrace/bt_parse.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/btrace/bt_parse.y b/usr.sbin/btrace/bt_parse.y
index 520b544040f..187db9f6d1d 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.20 2020/12/11 07:27:55 anton Exp $ */
+/* $OpenBSD: bt_parse.y,v 1.21 2021/01/10 11:06:08 jmatthew Exp $ */
/*
* Copyright (c) 2019 - 2020 Martin Pieuchot <mpi@openbsd.org>
@@ -792,10 +792,14 @@ again:
/*
* Probe lexer backdoor, interpret the token as a string
* rather than a keyword. Otherwise, reserved keywords
- * would conflict with syscall names.
+ * would conflict with syscall names. The exception to
+ * this is 'hz', which hopefully will never be a
+ * syscall.
*/
- yylval.v.string = kwp->word;
- return STRING;
+ if (kwp->token != HZ) {
+ yylval.v.string = kwp->word;
+ return STRING;
+ }
}
yylval.v.i = kwp->type;
return kwp->token;