From patchwork Fri Aug 17 03:10:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 10568365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F82914BD for ; Fri, 17 Aug 2018 03:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B7DE2B124 for ; Fri, 17 Aug 2018 03:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3E812B157; Fri, 17 Aug 2018 03:11:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A4E7A2B124 for ; Fri, 17 Aug 2018 03:11:35 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id EA0B54E1FE3; Thu, 16 Aug 2018 20:11:11 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 892FF4E1D00 for ; Thu, 16 Aug 2018 20:10:55 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id 2FFCE100538B; Thu, 16 Aug 2018 23:10:46 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 2BFFA464; Thu, 16 Aug 2018 23:10:46 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 16 Aug 2018 23:10:28 -0400 Message-Id: <1534475441-15543-26-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1534475441-15543-1-git-send-email-jsimmons@infradead.org> References: <1534475441-15543-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 25/38] lustre: obd: enhance print_lustre_cfg() X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: James Simmons , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 WC-id: https://jira.whamcloud.com/browse/LU-7004 Reviewed-on: https://review.whamcloud.com/28590 Reviewed-by: Fan Yong Reviewed-by: Dmitry Eremin Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- 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 --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) {