From: Andrew Perepechko Date: Wed, 28 Jun 2017 09:24:26 +0000 (+0300) Subject: LU-9716 osc: osc_extent_tree_dump0() implementation is suboptimal X-Git-Tag: 2.10.51~53 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=97115ccd159e4503ca16cb7f68ee7479c780f1cf LU-9716 osc: osc_extent_tree_dump0() implementation is suboptimal Avoid looping in osc_extent_tree_dump() if debugging is disabled. This helps us save some cpu ticks. Change-Id: I492429d8a6de79f67b5923895ffa58b7fe3a100d Seagate-bug-id: MRP-4469 Signed-off-by: Andrew Perepechko Reviewed-on: https://review.whamcloud.com/27866 Reviewed-by: Alexander Boyko Tested-by: Jenkins Reviewed-by: Alexander Zarochentsev Reviewed-by: Andreas Dilger Tested-by: Maloo --- diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index fad98b4..fe2bba4 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -1227,6 +1227,9 @@ static void osc_extent_tree_dump0(int level, struct osc_object *obj, struct osc_extent *ext; int cnt; + if (!cfs_cdebug_show(level, DEBUG_SUBSYSTEM)) + return; + CDEBUG(level, "Dump object %p extents at %s:%d, mppr: %u.\n", obj, func, line, osc_cli(obj)->cl_max_pages_per_rpc);