From: mpi Date: Wed, 1 Sep 2021 08:01:09 +0000 (+0000) Subject: Always print non-empty map & hist on exit even if there's an END rule. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=42cd3088a05e094e26335b38954f92368a3ed626;p=openbsd Always print non-empty map & hist on exit even if there's an END rule. Match bpftrace behavior. --- diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index 6c220940999..3fed1ee26e4 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.43 2021/09/01 07:35:21 mpi Exp $ */ +/* $OpenBSD: btrace.c,v 1.44 2021/09/01 08:01:09 mpi Exp $ */ /* * Copyright (c) 2019 - 2021 Martin Pieuchot @@ -522,12 +522,10 @@ rules_teardown(int fd) if (rend) rule_eval(rend, &bt_devt); - else { - debug("eval default 'end' rule\n"); - TAILQ_FOREACH(r, &g_rules, br_next) - rule_printmaps(r); - } + /* Print non-empty map & hist */ + TAILQ_FOREACH(r, &g_rules, br_next) + rule_printmaps(r); } void