For EXA6.0/6.1 do not show the "block maps msec" stats in brw_stats
by default as this breaks collectd and lustrefs_collector parsing.
Base this check on the Linux kernel version, since those releases
were based on RHEL7.9 on the server, while EXA6.2/6.3 use RHEL8.
Add an "enable_brw_block_maps" parameter that can be used to
disable the display of this statistic (it is always collected).
Enable the "enable_stats_header" parameter automatically in the
same way, as this was added for EXA6.2 but should now be supported.
Test-Parameters: trivial
Fixes:
c1e43cf8e0 ("LU-15564 osd: add allocation time histogram")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ib5e33bd98085aaf4a5a5d39283d5d334b93ebbe5
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53903
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
ktime_t ts_init, int width, const char *colon,
bool show_units, const char *prefix);
extern unsigned int obd_enable_stats_header;
+extern unsigned int obd_enable_brw_block_maps;
/* Generic callbacks */
extern int lprocfs_uuid_seq_show(struct seq_file *m, void *data);
#ifdef CONFIG_PROC_FS
-/* disable start/elapsed_time in stats headers by default for compatibility */
-unsigned int obd_enable_stats_header;
+/* To avoid displaying newer stats by default for EXA6.0/6.1, use the
+ * kernel version by proxy since servers used el7.9 with kernel 3.10.
+ * There isn't an easy way to distinguish between EXA6.1*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
+#define OBD_ENABLE_STATS_DEFAULT = 1
+#else
+#define OBD_ENABLE_STATS_DEFAULT
+#endif
+
+/* allow start/elapsed_time in stats headers to be disabled for compatibility */
+unsigned int obd_enable_stats_header OBD_ENABLE_STATS_DEFAULT;
+/* allow "block maps msec" in brw_stats to be disabled for compatibility */
+unsigned int obd_enable_brw_block_maps OBD_ENABLE_STATS_DEFAULT;
static int lprocfs_no_percpu_stats = 0;
module_param(lprocfs_no_percpu_stats, int, 0644);
if (!brw_stats->bs_props[i].bsp_name)
continue;
+ /* skip allocation time for older releases */
+ if (!obd_enable_brw_block_maps && i == BRW_ALLOC_TIME)
+ continue;
+
display_brw_stats(seq, brw_stats->bs_props[i].bsp_name,
brw_stats->bs_props[i].bsp_units,
&brw_stats->bs_hist[i * 2],
LUSTRE_STATIC_UINT_ATTR(at_early_margin, &at_early_margin);
LUSTRE_STATIC_UINT_ATTR(at_history, &at_history);
LUSTRE_STATIC_UINT_ATTR(enable_stats_header, &obd_enable_stats_header);
+LUSTRE_STATIC_UINT_ATTR(enable_brw_block_maps, &obd_enable_brw_block_maps);
LUSTRE_STATIC_UINT_ATTR(lbug_on_eviction, &obd_lbug_on_eviction);
#ifdef HAVE_SERVER_SUPPORT
&lustre_attr_version.attr,
&lustre_attr_pinger.attr,
&lustre_sattr_enable_stats_header.u.attr,
+ &lustre_sattr_enable_brw_block_maps.u.attr,
&lustre_attr_health_check.attr,
&lustre_attr_jobid_name.attr,
&lustre_attr_jobid_var.attr,