SET_TARGET_PROPERTIES(sarg PROPERTIES COMPILE_FLAGS "${TMPCFLAGS} -g")
ENDIF(ENABLE_DEBUG)
+# Enable double check of the data written in the reports
+OPTION(ENABLE_DOUBLE_CHECK_DATA "Make sarg double check the data it manipulates and output a warning if an error is found" OFF)
+
# Save the configuration for the project
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/include/config.h.in" "${CMAKE_BINARY_DIR}/config.h" @ONLY)
fi
])
+dnl Enable double check of the data written in the reports
+AC_ARG_ENABLE(doublecheck,
+[ --enable-doublecheck
+ Make sarg double check the data it manipulates and output a warning if an error is found ],
+[
+ if test "$enableval"; then
+ AC_DEFINE(ENABLE_DOUBLE_CHECK_DATA)
+ fi
+])
+
AC_SUBST(PACKAGE,"$PACKAGE_NAME")
AC_SUBST(VERSION,"$PACKAGE_VERSION")
if(debug)
debuga(_("sarg version: %s\n"),VERSION);
+#ifdef ENABLE_DOUBLE_CHECK_DATA
+ debuga(_("Sarg compiled to report warnings if the output is inconsistent\n"));
+#endif
+
maxopenfiles=MAX_OPEN_USER_FILES;
#ifdef HAVE_RLIM_T
if (Ulimit[0] != '\0') {
inperc=(tnbytes) ? incac * 100. / tnbytes : 0.;
ouperc=(tnbytes) ? oucac * 100. / tnbytes : 0.;
fprintf(fp_top3,"<td class=\"data\">%3.2lf%%</td><td class=\"data\">%3.2lf%%</td>",inperc,ouperc);
+#ifdef ENABLE_DOUBLE_CHECK_DATA
+ if (fabs(inperc+ouperc-100.)>=0.01) {
+ debuga(_("The total of the in-cache and cache-miss is not 100%% at position %d of user %s\n"),posicao,uinfo->label);
+ }
+#endif
}
if((TopUserFields & TOPUSERFIELDS_USED_TIME) != 0)
fprintf(fp_top3,"<td class=\"data\">%s</td>",buildtime(tnelap));
inperc=(ttnbytes) ? ttnincache * 100. / ttnbytes : 0.;
ouperc=(ttnbytes) ? ttnoucache *100. / ttnbytes : 0.;
fprintf(fp_top3,"<th class=\"header_r\">%3.2lf%%</th><th class=\"header_r\">%3.2lf%%</th>",inperc,ouperc);
+#ifdef ENABLE_DOUBLE_CHECK_DATA
+ if (fabs(inperc+ouperc-100.)>=0.01) {
+ debuga(_("The total of the in-cache and cache-miss is not 100%% for user %s\n"),uinfo->label);
+ }
+#endif
}
if((TopUserFields & TOPUSERFIELDS_USED_TIME) != 0)
fprintf(fp_top3,"<th class=\"header_r\">%s</th>",buildtime(ttnelap));