diff mbox series

[25/38] lustre: obd: enhance print_lustre_cfg()

Message ID 1534475441-15543-26-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: fixes for sysfs handling | expand

Commit Message

James Simmons Aug. 17, 2018, 3:10 a.m. UTC
Make the function print_lustre_cfg() exportables so we can provide
details when debugging other parts of the stack that handle
lustre_cfg processing. We currently report the index of the buffer
in struct lustre_cfg as well as the buffers length. We don't report
the actually string so lets add that info as well.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
WC-id: https://jira.whamcloud.com/browse/LU-7004
Reviewed-on: https://review.whamcloud.com/28590
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/obd_class.h  |  1 +
 drivers/staging/lustre/lustre/obdclass/llog_swab.c | 12 ++++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index e994c968..e250bc3 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -106,6 +106,7 @@  typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *,
 
 /* obd_config.c */
 char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index);
+void print_lustre_cfg(struct lustre_cfg *lcfg);
 int class_process_config(struct lustre_cfg *lcfg);
 int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
 			     struct lustre_cfg *lcfg, void *data);
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c
index b431c34..3803056 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c
@@ -308,12 +308,13 @@  void lustre_swab_llog_hdr(struct llog_log_hdr *h)
 }
 EXPORT_SYMBOL(lustre_swab_llog_hdr);
 
-static void print_lustre_cfg(struct lustre_cfg *lcfg)
+void print_lustre_cfg(struct lustre_cfg *lcfg)
 {
 	int i;
 
 	if (!(libcfs_debug & D_OTHER)) /* don't loop on nothing */
 		return;
+
 	CDEBUG(D_OTHER, "lustre_cfg: %p\n", lcfg);
 	CDEBUG(D_OTHER, "\tlcfg->lcfg_version: %#x\n", lcfg->lcfg_version);
 
@@ -324,10 +325,13 @@  static void print_lustre_cfg(struct lustre_cfg *lcfg)
 
 	CDEBUG(D_OTHER, "\tlcfg->lcfg_bufcount: %d\n", lcfg->lcfg_bufcount);
 	if (lcfg->lcfg_bufcount < LUSTRE_CFG_MAX_BUFCOUNT)
-		for (i = 0; i < lcfg->lcfg_bufcount; i++)
-			CDEBUG(D_OTHER, "\tlcfg->lcfg_buflens[%d]: %d\n",
-			       i, lcfg->lcfg_buflens[i]);
+		for (i = 0; i < lcfg->lcfg_bufcount; i++) {
+			CDEBUG(D_OTHER, "\tlcfg->lcfg_buflens[%d]: %d %s\n",
+			       i, lcfg->lcfg_buflens[i],
+			       lustre_cfg_string(lcfg, i));
+		}
 }
+EXPORT_SYMBOL(print_lustre_cfg);
 
 void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg)
 {