diff options
author | yang-g <yangg@google.com> | 2017-08-21 15:35:15 -0700 |
---|---|---|
committer | yang-g <yangg@google.com> | 2017-08-21 15:35:15 -0700 |
commit | 2def6443a3090c018bfdb7976ae5e40828297eac (patch) | |
tree | 95d0c7d6d069c179e18938725639aefe9f6506c4 /src/core/lib/profiling | |
parent | 2a1f129cfc1d90edd63b0e9ac2709e2a739bc448 (diff) |
fix C++ wrapper
Diffstat (limited to 'src/core/lib/profiling')
-rw-r--r-- | src/core/lib/profiling/timers.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/lib/profiling/timers.h b/src/core/lib/profiling/timers.h index fcc9a0d6fd..4d1437f606 100644 --- a/src/core/lib/profiling/timers.h +++ b/src/core/lib/profiling/timers.h @@ -92,18 +92,20 @@ void gpr_timer_set_enabled(int enabled); namespace grpc { class ProfileScope { public: - ProfileScope(const char *desc, bool important) : desc_(desc) { - GPR_TIMER_BEGIN(desc_, important ? 1 : 0); + ProfileScope(const char *desc, bool important, const char *file, int line) + : desc_(desc) { + gpr_timer_begin((desc_, important ? 1 : 0, file, line); } - ~ProfileScope() { GPR_TIMER_END(desc_, 0); } + ~ProfileScope() { gpr_timer_end(desc_, 0, "n/a", 0); } private: const char *const desc_; }; } // namespace grpc -#define GPR_TIMER_SCOPE(tag, important) \ - ::grpc::ProfileScope _profile_scope_##__LINE__((tag), (important)) +#define GPR_TIMER_SCOPE(tag, important) \ + ::grpc::ProfileScope _profile_scope_##__LINE__((tag), (important), __FILE__, \ + __LINE__) #else #define GPR_TIMER_SCOPE(tag, important) \ do { \ |