File tree Expand file tree Collapse file tree 11 files changed +50
-8
lines changed Expand file tree Collapse file tree 11 files changed +50
-8
lines changed Original file line number Diff line number Diff line change @@ -42,3 +42,6 @@ MODULES += jsonrpc
42
42
43
43
# # 第三方库依赖
44
44
THIRDPARTY += nlohmann
45
+
46
+ # # 编译配置
47
+ CCFLAGS += -DENABLE_TRACE_RECORDER=1
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ set(TBOX_BASE_HEADERS
45
45
catch_throw.h
46
46
func_types.h
47
47
object_pool.hpp
48
- recorder.h )
48
+ recorder.h
49
+ wrapped_recorder.h )
49
50
50
51
set (TBOX_BASE_SOURCES
51
52
version .cpp
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ HEAD_FILES = \
45
45
object_pool.hpp \
46
46
func_types.h \
47
47
recorder.h \
48
+ wrapped_recorder.h \
48
49
49
50
CPP_SRC_FILES = \
50
51
version.cpp \
Original file line number Diff line number Diff line change
1
+ /*
2
+ * .============.
3
+ * // M A K E / \
4
+ * // C++ DEV / \
5
+ * // E A S Y / \/ \
6
+ * ++ ----------. \/\ .
7
+ * \\ \ \ /\ /
8
+ * \\ \ \ /
9
+ * \\ \ \ /
10
+ * -============'
11
+ *
12
+ * Copyright (c) 2024 Hevake and contributors, all rights reserved.
13
+ *
14
+ * This file is part of cpp-tbox (https://github.com/cpp-main/cpp-tbox)
15
+ * Use of this source code is governed by MIT license that can be found
16
+ * in the LICENSE file in the root of the source tree. All contributing
17
+ * project authors may be found in the CONTRIBUTORS.md file in the root
18
+ * of the source tree.
19
+ */
20
+ /**
21
+ * 在 recorder.h 的基础上加 ENABLE_TRACE_RECORDER 宏开关
22
+ * 使 recorder 功能可以在编译期间被关彻底关闭
23
+ */
24
+ #ifndef TBOX_TRACE_WRAPPED_RECORDER_H_20240610
25
+ #define TBOX_TRACE_WRAPPED_RECORDER_H_20240610
26
+
27
+ #if ENABLE_TRACE_RECORDER
28
+ #include "recorder.h"
29
+ #else
30
+ #define RECORD_SCOPE ()
31
+ #define RECORD_DEFINE (name )
32
+ #define RECORD_START (name )
33
+ #define RECORD_STOP (name )
34
+ #define RECORD_EVENT ()
35
+ #endif
36
+
37
+ #endif //TBOX_TRACE_WRAPPED_RECORDER_H_20240610
Original file line number Diff line number Diff line change 24
24
#include < algorithm>
25
25
#include < tbox/base/log.h>
26
26
#include < tbox/base/assert.h>
27
- #include < tbox/base/recorder .h>
27
+ #include < tbox/base/wrapped_recorder .h>
28
28
29
29
namespace tbox {
30
30
namespace event {
Original file line number Diff line number Diff line change 22
22
#include < algorithm>
23
23
#include < tbox/base/defines.h>
24
24
#include < tbox/base/assert.h>
25
- #include < tbox/base/recorder .h>
25
+ #include < tbox/base/wrapped_recorder .h>
26
26
27
27
#include " timer_event_impl.h"
28
28
Original file line number Diff line number Diff line change 25
25
#include < tbox/base/log.h>
26
26
#include < tbox/base/assert.h>
27
27
#include < tbox/base/defines.h>
28
- #include < tbox/base/recorder .h>
28
+ #include < tbox/base/wrapped_recorder .h>
29
29
30
30
namespace tbox {
31
31
namespace event {
Original file line number Diff line number Diff line change 32
32
#include < tbox/base/log.h>
33
33
#include < tbox/base/defines.h>
34
34
#include < tbox/base/assert.h>
35
- #include < tbox/base/recorder .h>
35
+ #include < tbox/base/wrapped_recorder .h>
36
36
37
37
namespace tbox {
38
38
namespace event {
Original file line number Diff line number Diff line change 21
21
#include " common_loop.h"
22
22
#include < tbox/base/log.h>
23
23
#include < tbox/base/assert.h>
24
- #include < tbox/base/recorder .h>
24
+ #include < tbox/base/wrapped_recorder .h>
25
25
26
26
namespace tbox {
27
27
namespace event {
Original file line number Diff line number Diff line change 35
35
#include < tbox/base/assert.h>
36
36
#include < tbox/base/catch_throw.h>
37
37
#include < tbox/base/object_pool.hpp>
38
- #include < tbox/base/recorder .h>
38
+ #include < tbox/base/wrapped_recorder .h>
39
39
#include < tbox/event/loop.h>
40
40
41
41
namespace tbox {
You can’t perform that action at this time.
0 commit comments