aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/profiling
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-05-04 00:22:12 -0700
committerGravatar Yang Gao <yangg@google.com>2015-05-04 00:22:12 -0700
commitc71a9d2b56c8881bd076423d9c52f58fc822f6f7 (patch)
tree0e257b1f686cc9e89d25172ed6d9442bff167e4d /src/core/profiling
parentf7d05b572b229a78a08022e286f15fbb6b7266fd (diff)
clang-format
Diffstat (limited to 'src/core/profiling')
-rw-r--r--src/core/profiling/basic_timers.c5
-rw-r--r--src/core/profiling/stap_timers.c6
-rw-r--r--src/core/profiling/timers.h27
3 files changed, 20 insertions, 18 deletions
diff --git a/src/core/profiling/basic_timers.c b/src/core/profiling/basic_timers.c
index d89bba7b87..ab598b5a00 100644
--- a/src/core/profiling/basic_timers.c
+++ b/src/core/profiling/basic_timers.c
@@ -135,8 +135,8 @@ void grpc_timer_add_mark(int tag, void* id, const char* file, int line) {
grpc_timers_log_add(grpc_timers_log_global, tag, id, file, line);
}
-void grpc_timer_begin(int tag, void* id, const char *file, int line) {}
-void grpc_timer_end(int tag, void* id, const char *file, int line) {}
+void grpc_timer_begin(int tag, void* id, const char* file, int line) {}
+void grpc_timer_end(int tag, void* id, const char* file, int line) {}
/* Basic profiler specific API functions. */
void grpc_timers_global_init(void) {
@@ -147,7 +147,6 @@ void grpc_timers_global_destroy(void) {
grpc_timers_log_destroy(grpc_timers_log_global);
}
-
#else /* !GRPC_BASIC_PROFILER */
void grpc_timers_global_init(void) {}
void grpc_timers_global_destroy(void) {}
diff --git a/src/core/profiling/stap_timers.c b/src/core/profiling/stap_timers.c
index 52fb58a279..6e3a965dae 100644
--- a/src/core/profiling/stap_timers.c
+++ b/src/core/profiling/stap_timers.c
@@ -42,15 +42,15 @@
#include "src/core/profiling/stap_probes.h"
/* Latency profiler API implementation. */
-void grpc_timer_add_mark(int tag, void* id, const char *file, int line) {
+void grpc_timer_add_mark(int tag, void* id, const char* file, int line) {
_STAP_ADD_MARK(tag);
}
-void grpc_timer_begin(int tag, void* id, const char *file, int line) {
+void grpc_timer_begin(int tag, void* id, const char* file, int line) {
_STAP_TIMING_NS_BEGIN(tag);
}
-void grpc_timer_end(int tag, void* id, const char *file, int line) {
+void grpc_timer_end(int tag, void* id, const char* file, int line) {
_STAP_TIMING_NS_END(tag);
}
diff --git a/src/core/profiling/timers.h b/src/core/profiling/timers.h
index d0b8286c03..c7e6674f7c 100644
--- a/src/core/profiling/timers.h
+++ b/src/core/profiling/timers.h
@@ -41,9 +41,9 @@ extern "C" {
void grpc_timers_global_init(void);
void grpc_timers_global_destroy(void);
-void grpc_timer_add_mark(int tag, void* id, const char *file, int line);
-void grpc_timer_begin(int tag, void* id, const char *file, int line);
-void grpc_timer_end(int tag, void* id, const char *file, int line);
+void grpc_timer_add_mark(int tag, void *id, const char *file, int line);
+void grpc_timer_begin(int tag, void *id, const char *file, int line);
+void grpc_timer_end(int tag, void *id, const char *file, int line);
enum grpc_profiling_tags {
/* Any GRPC_PTAG_* >= than the threshold won't generate any profiling mark. */
@@ -74,13 +74,16 @@ enum grpc_profiling_tags {
#if !(defined(GRPC_STAP_PROFILER) + defined(GRPC_BASIC_PROFILER))
/* No profiling. No-op all the things. */
#define GRPC_TIMER_MARK(tag, id) \
- do {} while(0)
+ do { \
+ } while (0)
#define GRPC_TIMER_BEGIN(tag, id) \
- do {} while(0)
+ do { \
+ } while (0)
#define GRPC_TIMER_END(tag, id) \
- do {} while(0)
+ do { \
+ } while (0)
#else /* at least one profiler requested... */
/* ... hopefully only one. */
@@ -94,14 +97,14 @@ enum grpc_profiling_tags {
grpc_timer_add_mark(tag, ((void *)(gpr_intptr)(id)), __FILE__, __LINE__); \
}
-#define GRPC_TIMER_BEGIN(tag, id) \
- if (tag < GRPC_PTAG_IGNORE_THRESHOLD) { \
- grpc_timer_begin(tag, ((void *)(gpr_intptr)(id)), __FILE__, __LINE__); \
+#define GRPC_TIMER_BEGIN(tag, id) \
+ if (tag < GRPC_PTAG_IGNORE_THRESHOLD) { \
+ grpc_timer_begin(tag, ((void *)(gpr_intptr)(id)), __FILE__, __LINE__); \
}
-#define GRPC_TIMER_END(tag, id) \
- if (tag < GRPC_PTAG_IGNORE_THRESHOLD) { \
- grpc_timer_end(tag, ((void *)(gpr_intptr)(id)), __FILE__, __LINE__); \
+#define GRPC_TIMER_END(tag, id) \
+ if (tag < GRPC_PTAG_IGNORE_THRESHOLD) { \
+ grpc_timer_end(tag, ((void *)(gpr_intptr)(id)), __FILE__, __LINE__); \
}
#ifdef GRPC_STAP_PROFILER