diff options
author | yang-g <yangg@google.com> | 2018-01-31 15:59:50 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2018-01-31 22:16:34 -0800 |
commit | ce1cfea12d3f8aa566e6e7d8adec60c10e6b6700 (patch) | |
tree | 28428e93f85b2ca53bd20bde3ab3d1577fd5d847 /src/core/lib/profiling | |
parent | e294279e398566fb6f41256c79b9d3e886a0d156 (diff) |
Deprecate GPR_TIMER_BEGIN/END and replace with GPR_TIMER_SCOPE.
Diffstat (limited to 'src/core/lib/profiling')
-rw-r--r-- | src/core/lib/profiling/timers.h | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/core/lib/profiling/timers.h b/src/core/lib/profiling/timers.h index 9f11f771e6..d0188b5054 100644 --- a/src/core/lib/profiling/timers.h +++ b/src/core/lib/profiling/timers.h @@ -40,14 +40,10 @@ void gpr_timer_set_enabled(int enabled); do { \ } while (0) -#define GPR_TIMER_BEGIN(tag, important) \ +#define GPR_TIMER_SCOPE(tag, important) \ do { \ } while (0) -#define GPR_TIMER_END(tag, important) \ - do { \ - } while (0) - #else /* at least one profiler requested... */ /* ... hopefully only one. */ #if defined(GRPC_STAP_PROFILER) && defined(GRPC_BASIC_PROFILER) @@ -64,12 +60,6 @@ void gpr_timer_set_enabled(int enabled); #define GPR_TIMER_MARK(tag, important) \ gpr_timer_add_mark(tag, important, __FILE__, __LINE__); -#define GPR_TIMER_BEGIN(tag, important) \ - gpr_timer_begin(tag, important, __FILE__, __LINE__); - -#define GPR_TIMER_END(tag, important) \ - gpr_timer_end(tag, important, __FILE__, __LINE__); - #ifdef GRPC_STAP_PROFILER /* Empty placeholder for now. */ #endif /* GRPC_STAP_PROFILER */ @@ -78,10 +68,6 @@ void gpr_timer_set_enabled(int enabled); /* Empty placeholder for now. */ #endif /* GRPC_BASIC_PROFILER */ -#endif /* at least one profiler requested. */ - -#if (defined(GRPC_STAP_PROFILER) + defined(GRPC_BASIC_PROFILER) + \ - defined(GRPC_CUSTOM_PROFILER)) namespace grpc { class ProfileScope { public: @@ -99,10 +85,7 @@ class ProfileScope { #define GPR_TIMER_SCOPE(tag, important) \ ::grpc::ProfileScope _profile_scope_##__LINE__((tag), (important), __FILE__, \ __LINE__) -#else -#define GPR_TIMER_SCOPE(tag, important) \ - do { \ - } while (false) -#endif + +#endif /* at least one profiler requested. */ #endif /* GRPC_CORE_LIB_PROFILING_TIMERS_H */ |