From 3041bbc4409572831c36b6e2e36922b886a0685b Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 9 Oct 2015 13:10:09 -0600 Subject: [PATCH] LU-7276 utils: make llog_reader consistent with kernel Handle the CM_SKIP records in the same manner as the kernel, by printing "SKIP" only until the first CM_END record, rather until the first CM_END|CM_SKIP record. Signed-off-by: Andreas Dilger Change-Id: Ie0c35ecd9d74a1e0b378bcf6642bca32e4dfa35e Reviewed-on: http://review.whamcloud.com/16788 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Frank Zago Reviewed-by: Olaf Faaland-LLNL Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/utils/llog_reader.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/lustre/utils/llog_reader.c b/lustre/utils/llog_reader.c index ad821c2..6ebbe02 100644 --- a/lustre/utils/llog_reader.c +++ b/lustre/utils/llog_reader.c @@ -496,22 +496,21 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip) char createtime[26], canceltime[26] = ""; time_t time_tmp; - if (marker->cm_flags & CM_SKIP) { - if (marker->cm_flags & CM_START) { - printf("SKIP START "); - (*skip)++; - } else { - printf( "END "); - *skip = 0; - } - } + if (marker->cm_flags & CM_START && + marker->cm_flags & CM_SKIP) { + printf("SKIP START "); + (*skip)++; + } else if (marker->cm_flags & CM_END) { + printf( "END "); + *skip = 0; + } - if (marker->cm_flags & CM_EXCLUDE) { - if (marker->cm_flags & CM_START) - printf("EXCLUDE START "); - else - printf("EXCLUDE END "); - } + if (marker->cm_flags & CM_EXCLUDE) { + if (marker->cm_flags & CM_START) + printf("EXCLUDE START "); + else + printf("EXCLUDE END "); + } /* Handle overflow of 32-bit time_t gracefully. * The copy to time_tmp is needed in any case to -- 1.8.3.1