enable_tls
enable_uuidd
enable_mmp
+enable_bmap_stats
+enable_bmap_stats_ops
enable_nls
with_gnu_ld
enable_rpath
--disable-tls disable use of thread local support
--disable-uuidd disable building the uuid daemon
--disable-mmp disable support mmp, Multi Mount Protection
+ --disable-bmap-stats disable collection of bitmap stats.
+ --enable-bmap-stats-ops enable collection of additional bitmap stats
--disable-nls do not use Native Language Support
--disable-rpath do not hardcode runtime library paths
fi
+
+# Check whether --enable-bmap-stats was given.
+if test "${enable_bmap_stats+set}" = set; then :
+ enableval=$enable_bmap_stats; if test "$enableval" = "no"
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling bitmap statistics support" >&5
+$as_echo "Disabling bitmap statistics support" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling bitmap statistics support" >&5
+$as_echo "Enabling bitmap statistics support" >&6; }
+ $as_echo "#define ENABLE_BMAP_STATS 1" >>confdefs.h
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling bitmap statistics support by default" >&5
+$as_echo "Enabling bitmap statistics support by default" >&6; }
+$as_echo "#define ENABLE_BMAP_STATS 1" >>confdefs.h
+
+
+fi
+
+
+# Check whether --enable-bmap-stats-ops was given.
+if test "${enable_bmap_stats_ops+set}" = set; then :
+ enableval=$enable_bmap_stats_ops; if test "$enableval" = "no"
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling additional bitmap statistics" >&5
+$as_echo "Disabling additional bitmap statistics" >&6; }
+else
+ if test "x${enable_bmap_stats}" = "xno"; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Error --enable-bmap-stats-ops requires bmap-stats
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling additional bitmap statistics" >&5
+$as_echo "Enabling additional bitmap statistics" >&6; }
+ $as_echo "#define ENABLE_BMAP_STATS_OPS 1" >>confdefs.h
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling additional bitmap statistics by default" >&5
+$as_echo "Disabling additional bitmap statistics by default" >&6; }
+
+fi
+
MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
GETTEXT_PACKAGE=e2fsprogs
AC_DEFINE(CONFIG_MMP, 1)
)
dnl
+dnl handle --disable-bmap-stats
+dnl
+AH_TEMPLATE([ENABLE_BMAP_STATS], [Define to 1 to enable bitmap stats.])
+AC_ARG_ENABLE([bmap-stats],
+[ --disable-bmap-stats disable collection of bitmap stats.],
+if test "$enableval" = "no"
+then
+ AC_MSG_RESULT([Disabling bitmap statistics support])
+else
+ AC_MSG_RESULT([Enabling bitmap statistics support])
+ AC_DEFINE(ENABLE_BMAP_STATS, 1)
+fi
+,
+AC_MSG_RESULT([Enabling bitmap statistics support by default])
+AC_DEFINE(ENABLE_BMAP_STATS, 1)
+)
+dnl
+dnl handle --enable-bmap-stats-ops
+dnl
+AH_TEMPLATE([ENABLE_BMAP_STATS_OPS], [Define to 1 to enable bitmap stats.])
+AC_ARG_ENABLE([bmap-stats-ops],
+[ --enable-bmap-stats-ops enable collection of additional bitmap stats],
+if test "$enableval" = "no"
+then
+ AC_MSG_RESULT([Disabling additional bitmap statistics])
+else
+ dnl There has to be a better way!
+ AS_IF([test "x${enable_bmap_stats}" = "xno"],
+ AC_MSG_FAILURE([Error --enable-bmap-stats-ops requires bmap-stats]))
+
+ AC_MSG_RESULT([Enabling additional bitmap statistics])
+ AC_DEFINE(ENABLE_BMAP_STATS_OPS, 1)
+fi
+,
+AC_MSG_RESULT([Disabling additional bitmap statistics by default])
+)
+dnl
dnl
dnl
MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
+/* Define to 1 to enable bitmap stats. */
+#undef ENABLE_BMAP_STATS
+
+/* Define to 1 to enable bitmap stats. */
+#undef ENABLE_BMAP_STATS_OPS
+
/* Define to 1 if ext2 compression enabled */
#undef ENABLE_COMPRESSION
struct rb_root root;
struct bmap_rb_extent **wcursor;
struct bmap_rb_extent **rcursor;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
__u64 mark_hit;
__u64 test_hit;
#endif
*bp->rcursor = NULL;
*bp->wcursor = NULL;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
bp->test_hit = 0;
bp->mark_hit = 0;
#endif
goto search_tree;
if (bit >= rcursor->start && bit < rcursor->start + rcursor->count) {
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
bp->test_hit++;
#endif
return 1;
if (ext) {
if (start >= ext->start &&
start <= (ext->start + ext->count)) {
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
bp->mark_hit++;
#endif
goto got_extent;
*bp->wcursor = NULL;
}
-#ifdef BMAP_STATS
+#ifdef ENABLE_BMAP_STATS
static void rb_print_stats(ext2fs_generic_bitmap bitmap)
{
struct ext2fs_rb_private *bp;
__u64 min_size = ULONG_MAX;
__u64 size = 0, avg_size = 0;
double eff;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
__u64 mark_all, test_all;
double m_hit = 0.0, t_hit = 0.0;
#endif
min_size = 0;
eff = (double)((count * sizeof(struct bmap_rb_extent)) << 3) /
(bitmap->real_end - bitmap->start);
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
mark_all = bitmap->stats.mark_count + bitmap->stats.mark_ext_count;
test_all = bitmap->stats.test_count + bitmap->stats.test_ext_count;
if (mark_all)
int type;
struct timeval created;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
unsigned long copy_count;
unsigned long resize_count;
unsigned long mark_count;
unsigned long mark_seq;
unsigned long test_seq;
-#endif /* BMAP_STATS_OPS */
+#endif /* ENABLE_BMAP_STATS_OPS */
};
char *description;
void *private;
errcode_t base_error_code;
-#ifdef BMAP_STATS
+#ifdef ENABLE_BMAP_STATS
struct ext2_bmap_statistics stats;
#endif
};
__u32 *out);
/* gen_bitmap64.c */
-
-/* Generate and print bitmap usage statistics */
-#define BMAP_STATS
-
void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap);
errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic,
int type, __u64 start, __u64 end,
#endif
}
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
#define INC_STAT(map, name) map->stats.name
#else
#define INC_STAT(map, name) ;;
if (retval)
return retval;
-#ifdef BMAP_STATS
+#ifdef ENABLE_BMAP_STATS
if (gettimeofday(&bitmap->stats.created,
(struct timezone *) NULL) == -1) {
perror("gettimeofday");
return 0;
}
-#ifdef BMAP_STATS
+#ifdef ENABLE_BMAP_STATS
void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap bitmap)
{
struct ext2_bmap_statistics *stats = &bitmap->stats;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
float mark_seq_perc = 0.0, test_seq_perc = 0.0;
float mark_back_perc = 0.0, test_back_perc = 0.0;
#endif
double inuse;
struct timeval now;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
if (stats->test_count) {
test_seq_perc = ((float)stats->test_seq /
stats->test_count) * 100;
fprintf(stderr, "\n[+] %s bitmap (type %d)\n", bitmap->description,
stats->type);
fprintf(stderr, "=================================================\n");
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
fprintf(stderr, "%16llu bits long\n",
bitmap->real_end - bitmap->start);
fprintf(stderr, "%16lu copy_bmap\n%16lu resize_bmap\n",
fprintf(stderr, "%16llu bits marked backwards (%.2f%%)\n"
"%16.2f seconds in use\n",
stats->mark_back, mark_back_perc, inuse);
-#endif /* BMAP_STATS_OPS */
+#endif /* ENABLE_BMAP_STATS_OPS */
}
#endif
if (!EXT2FS_IS_64_BITMAP(bmap))
return;
-#ifdef BMAP_STATS
+#ifdef ENABLE_BMAP_STATS
if (getenv("E2FSPROGS_BITMAP_STATS")) {
ext2fs_print_bmap_statistics(bmap);
bmap->bitmap_ops->print_stats(bmap);
return retval;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
src->stats.copy_count++;
#endif
-#ifdef BMAP_STATS
+#ifdef ENABLE_BMAP_STATS
if (gettimeofday(&new_bmap->stats.created,
(struct timezone *) NULL) == -1) {
perror("gettimeofday");
arg >>= bitmap->cluster_bits;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
if (arg == bitmap->stats.last_marked + 1)
bitmap->stats.mark_seq++;
if (arg < bitmap->stats.last_marked)
arg >>= bitmap->cluster_bits;
-#ifdef BMAP_STATS_OPS
+#ifdef ENABLE_BMAP_STATS_OPS
bitmap->stats.test_count++;
if (arg == bitmap->stats.last_tested + 1)
bitmap->stats.test_seq++;