Whamcloud - gitweb
LU-7276 utils: make llog_reader consistent with kernel 88/16788/2
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 9 Oct 2015 19:10:09 +0000 (13:10 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 30 Nov 2015 17:19:42 +0000 (17:19 +0000)
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 <andreas.dilger@intel.com>
Change-Id: Ie0c35ecd9d74a1e0b378bcf6642bca32e4dfa35e
Reviewed-on: http://review.whamcloud.com/16788
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/llog_reader.c

index ad821c2..6ebbe02 100644 (file)
@@ -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