From d7078f3ba0b8b4b014ace390e99cc700616658c3 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sat, 13 Apr 2013 19:02:58 +0000 Subject: [PATCH] move the error report to a lower log level... Now you can see when it returns an error without getting every single io that went through it.. MFC after: 1 week --- sys/geom/nop/g_nop.c | 2 +- sys/geom/nop/g_nop.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c index 73782660bab..0cb03746ea0 100644 --- a/sys/geom/nop/g_nop.c +++ b/sys/geom/nop/g_nop.c @@ -124,7 +124,7 @@ g_nop_start(struct bio *bp) rval = arc4random() % 100; if (rval < failprob) { - G_NOP_LOGREQ(bp, "Returning error=%d.", sc->sc_error); + G_NOP_LOGREQLVL(1, bp, "Returning error=%d.", sc->sc_error); g_io_deliver(bp, sc->sc_error); return; } diff --git a/sys/geom/nop/g_nop.h b/sys/geom/nop/g_nop.h index 4bfc4e16680..da555ecb100 100644 --- a/sys/geom/nop/g_nop.h +++ b/sys/geom/nop/g_nop.h @@ -44,9 +44,10 @@ printf("\n"); \ } \ } while (0) -#define G_NOP_LOGREQ(bp, ...) do { \ - if (g_nop_debug >= 2) { \ - printf("GEOM_NOP[2]: "); \ +#define G_NOP_LOGREQ(bp, ...) G_NOP_LOGREQLVL(2, bp, __VA_ARGS__) +#define G_NOP_LOGREQLVL(lvl, bp, ...) do { \ + if (g_nop_debug >= (lvl)) { \ + printf("GEOM_NOP[%d]: ", (lvl)); \ printf(__VA_ARGS__); \ printf(" "); \ g_print_bio(bp); \