ENH: add possibility to enable/disable profiling globally (issue #441)

- use InfoSwitch to disable, or via static method.

- respect the state of the argList banner when deciding to emit
  initialization information. Can otherwise end up with unwanted
  output rubbish on things like foamDictionary and foamListTimes.
This commit is contained in:
Mark Olesen
2017-04-19 17:04:37 +02:00
parent e55339d1e1
commit d4c7d8c6e5
8 changed files with 72 additions and 30 deletions

View File

@ -112,6 +112,7 @@ Usage
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "profiling.H"
#include "Time.H"
#include "IFstream.H"
#include "OFstream.H"
@ -289,6 +290,7 @@ int main(int argc, char *argv[])
"disableFunctionEntries",
"Disable expansion of dictionary directives - #include, #codeStream etc"
);
profiling::disable(); // Disable profiling (and its output)
argList args(argc, argv);

View File

@ -45,6 +45,7 @@ Usage
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "profiling.H"
#include "timeSelector.H"
#include "Time.H"
@ -70,6 +71,8 @@ int main(int argc, char *argv[])
"rm",
"remove selected time directories"
);
profiling::disable(); // Disable profiling (and its output)
#include "setRootCase.H"
label nProcs = 0;

View File

@ -62,6 +62,7 @@ Note
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "profiling.H"
#include "Time.H"
#include "UnsortedMeshedSurfaces.H"
@ -98,6 +99,7 @@ int main(int argc, char *argv[])
"xml",
"write output in XML format"
);
profiling::disable(); // Disable profiling (and its output)
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());