From c1cffc714ead02dd5176e68249af49ca8349e06b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 26 Feb 2013 11:33:23 -0800 Subject: [PATCH] mon: avoid expensive dump unless log will gather Signed-off-by: Sage Weil --- src/mon/PaxosService.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 8495870e9a0..72b00b85313 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -158,11 +158,13 @@ void PaxosService::propose_pending() encode_pending(&t); have_pending = false; - JSONFormatter f(true); - t.dump(&f); - dout(30) << __func__ << " transaction dump:\n"; - f.flush(*_dout); - *_dout << dendl; + if (g_conf->subsys.should_gather(dout_subsys, 30)) { + JSONFormatter f(true); + t.dump(&f); + dout(30) << __func__ << " transaction dump:\n"; + f.flush(*_dout); + *_dout << dendl; + } t.encode(bl); -- 2.47.3