Macro Definition
-
PROF: encapsulates profiling statements. Use theENABLE\_PROFmacro to control whether profiling is enabled during compilation.PROFsupports one or two parameters.-
One parameter: profiling statement.
If
ENABLE\_PROFis defined, theprintstatement is executed. If it is not defined, printing is skipped.PROF(std::cout**<<** "enable prof" << std::endl);
-
Two parameters: profiling level and profiling statement. Automatically initializes the
Profilerclass and defines the profiling level.If
ENABLE\_PROFis defined, profiling is executed. If it is not defined, no profiling occurs. TheProfilerclass is automatically initialized.PROF(INFO, Attr("req", 1).Event("recv"));
-
-
ENABLE\_PROF: works withPROF. If this environment variable is not defined, profiling is disabled, andPROFis automatically defined as empty. Generally, it is defined inCMakeLists.txt.add_definitions(-DENABLE_PROF)