Skip to content

Commit 6fb64dd

Browse files
authored
Merge pull request #47789 from Dr15Jones/debugXrdRequestManager
Only use CPUTimer in XrdRequestManager debugging
2 parents 8dd0a29 + f30efe6 commit 6fb64dd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Utilities/XrdAdaptor/src/XrdRequestManager.cc

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
#include "XrdCl/XrdClDefaultEnv.hh"
1414
#include "XrdCl/XrdClFileSystem.hh"
1515

16+
//#define CPUTIME_IN_XRD
17+
#if defined(CPUTIME_IN_XRD)
1618
#include "FWCore/Utilities/interface/CPUTimer.h"
19+
#endif
1720
#include "FWCore/Utilities/interface/EDMException.h"
1821
#include "FWCore/Utilities/interface/Likely.h"
1922
#include "FWCore/MessageLogger/interface/MessageLogger.h"
@@ -751,8 +754,10 @@ std::future<IOSize> XrdAdaptor::RequestManager::handle(std::shared_ptr<std::vect
751754
timespec now;
752755
GET_CLOCK_MONOTONIC(now);
753756

757+
#if defined(CPUTIME_IN_XRD)
754758
edm::CPUTimer timer;
755759
timer.start();
760+
#endif
756761

757762
if (activeSources.size() == 1) {
758763
auto c_ptr = std::make_shared<XrdAdaptor::ClientRequest>(*this, iolist);
@@ -816,8 +821,11 @@ std::future<IOSize> XrdAdaptor::RequestManager::handle(std::shared_ptr<std::vect
816821
},
817822
std::move(future1),
818823
std::move(future2));
824+
#if defined(CPUTIME_IN_XRD)
819825
timer.stop();
820-
//edm::LogVerbatim("XrdAdaptorInternal") << "Total time to create requests " << static_cast<int>(1000*timer.realTime()) << std::endl;
826+
edm::LogVerbatim("XrdAdaptorInternal")
827+
<< "Total time to create requests " << static_cast<int>(1000 * timer.realTime()) << std::endl;
828+
#endif
821829
return task;
822830
} else if (!req1->empty()) {
823831
return future1;

0 commit comments

Comments
 (0)