浏览代码

clarified "simple profiling"

Vaclav Kubart 19 年之前
父节点
当前提交
68f063ac8e
共有 2 个文件被更改,包括 19 次插入3 次删除
  1. 4 1
      lib/cds/ser_profile.c
  2. 15 2
      lib/cds/ser_profile.h

+ 4 - 1
lib/cds/ser_profile.c

@@ -1,4 +1,5 @@
 #ifdef SER
+#ifdef DO_PROFILE
 
 #include <cds/ser_profile.h>
 #include "dprint.h"
@@ -86,4 +87,6 @@ void ser_profile_init()
 	start_profile(trace_func);
 }
 
-#endif
+#endif /* DO_PROFILE */
+
+#endif /* SER */

+ 15 - 2
lib/cds/ser_profile.h

@@ -3,10 +3,12 @@
 
 #ifdef SER
 
-/* declarations of watched profile points */
+#ifdef DO_PROFILING
 
 #include <cds/simple_profile.h>
 
+/* declarations of watched profile points */
+
 DECLARE_PROF_POINT(pa_handle_subscription)
 DECLARE_PROF_POINT(pa_timer_presentity)
 DECLARE_PROF_POINT(pa_timer_pdomain)
@@ -30,6 +32,17 @@ void ser_profile_init();
 
 #define SER_PROFILE_INIT	ser_profile_init();
 
-#endif
+#else /* don't profile */
+
+#define SER_PROFILE_INIT
+#define PROF_START(name)
+#define PROF_START_BODY(name)
+#define PROF_START_DECL(name)
+#define PROF_STOP(name)
+
+#endif /* DO_PROFILING */
+
+#endif /* SER */
+
 
 #endif