aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/profiling/timers.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-22 10:42:19 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-22 10:42:19 -0700
commit45724b35e411fef7c5da66a74c78428c11d56843 (patch)
tree9264034aca675c89444e02f72ef58e67d7043604 /src/core/profiling/timers.h
parent298751c1195523ef6228595043b583c3a6270e08 (diff)
indent pass to get logical source lines on one physical line
Diffstat (limited to 'src/core/profiling/timers.h')
-rw-r--r--src/core/profiling/timers.h94
1 files changed, 46 insertions, 48 deletions
diff --git a/src/core/profiling/timers.h b/src/core/profiling/timers.h
index 92dbab9042..34929d8217 100644
--- a/src/core/profiling/timers.h
+++ b/src/core/profiling/timers.h
@@ -35,51 +35,49 @@
#define GRPC_CORE_PROFILING_TIMERS_H
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
-void grpc_timers_global_init(void);
-void grpc_timers_global_destroy(void);
-
-void grpc_timer_add_mark(int tag, const char *tagstr, void *id,
- const char *file, int line);
-void grpc_timer_add_important_mark(int tag, const char *tagstr, void *id,
- const char *file, int line);
-void grpc_timer_begin(int tag, const char *tagstr, void *id, const char *file,
- int line);
-void grpc_timer_end(int tag, const char *tagstr, void *id, const char *file,
- int line);
-
-enum grpc_profiling_tags {
- /* Any GRPC_PTAG_* >= than the threshold won't generate any profiling mark. */
- GRPC_PTAG_IGNORE_THRESHOLD = 1000000,
-
- /* Re. Protos. */
- GRPC_PTAG_PROTO_SERIALIZE = 100 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_PROTO_DESERIALIZE = 101 + GRPC_PTAG_IGNORE_THRESHOLD,
-
- /* Re. sockets. */
- GRPC_PTAG_HANDLE_READ = 200 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_SENDMSG = 201 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_RECVMSG = 202 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_POLL_FINISHED = 203 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_TCP_CB_WRITE = 204 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_TCP_WRITE = 205 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_CALL_ON_DONE_RECV = 206 + GRPC_PTAG_IGNORE_THRESHOLD,
-
- /* C++ */
- GRPC_PTAG_CPP_CALL_CREATED = 300 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_CPP_PERFORM_OPS = 301 + GRPC_PTAG_IGNORE_THRESHOLD,
-
- /* Transports */
- GRPC_PTAG_HTTP2_UNLOCK = 401 + GRPC_PTAG_IGNORE_THRESHOLD,
- GRPC_PTAG_HTTP2_UNLOCK_CLEANUP = 402 + GRPC_PTAG_IGNORE_THRESHOLD,
-
- /* > 1024 Unassigned reserved. For any miscellaneous use.
- * Use addition to generate tags from this base or take advantage of the 10
- * zero'd bits for OR-ing. */
- GRPC_PTAG_OTHER_BASE = 1024
-};
+ void grpc_timers_global_init (void);
+ void grpc_timers_global_destroy (void);
+
+ void grpc_timer_add_mark (int tag, const char *tagstr, void *id, const char *file, int line);
+ void grpc_timer_add_important_mark (int tag, const char *tagstr, void *id, const char *file, int line);
+ void grpc_timer_begin (int tag, const char *tagstr, void *id, const char *file, int line);
+ void grpc_timer_end (int tag, const char *tagstr, void *id, const char *file, int line);
+
+ enum grpc_profiling_tags
+ {
+ /* Any GRPC_PTAG_* >= than the threshold won't generate any profiling mark. */
+ GRPC_PTAG_IGNORE_THRESHOLD = 1000000,
+
+ /* Re. Protos. */
+ GRPC_PTAG_PROTO_SERIALIZE = 100 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_PROTO_DESERIALIZE = 101 + GRPC_PTAG_IGNORE_THRESHOLD,
+
+ /* Re. sockets. */
+ GRPC_PTAG_HANDLE_READ = 200 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_SENDMSG = 201 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_RECVMSG = 202 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_POLL_FINISHED = 203 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_TCP_CB_WRITE = 204 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_TCP_WRITE = 205 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_CALL_ON_DONE_RECV = 206 + GRPC_PTAG_IGNORE_THRESHOLD,
+
+ /* C++ */
+ GRPC_PTAG_CPP_CALL_CREATED = 300 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_CPP_PERFORM_OPS = 301 + GRPC_PTAG_IGNORE_THRESHOLD,
+
+ /* Transports */
+ GRPC_PTAG_HTTP2_UNLOCK = 401 + GRPC_PTAG_IGNORE_THRESHOLD,
+ GRPC_PTAG_HTTP2_UNLOCK_CLEANUP = 402 + GRPC_PTAG_IGNORE_THRESHOLD,
+
+ /* > 1024 Unassigned reserved. For any miscellaneous use.
+ * Use addition to generate tags from this base or take advantage of the 10
+ * zero'd bits for OR-ing. */
+ GRPC_PTAG_OTHER_BASE = 1024
+ };
#if !(defined(GRPC_STAP_PROFILER) + defined(GRPC_BASIC_PROFILER))
/* No profiling. No-op all the things. */
@@ -99,7 +97,7 @@ enum grpc_profiling_tags {
do { \
} while (0)
-#else /* at least one profiler requested... */
+#else /* at least one profiler requested... */
/* ... hopefully only one. */
#if defined(GRPC_STAP_PROFILER) && defined(GRPC_BASIC_PROFILER)
#error "GRPC_STAP_PROFILER and GRPC_BASIC_PROFILER are mutually exclusive."
@@ -131,16 +129,16 @@ enum grpc_profiling_tags {
#ifdef GRPC_STAP_PROFILER
/* Empty placeholder for now. */
-#endif /* GRPC_STAP_PROFILER */
+#endif /* GRPC_STAP_PROFILER */
#ifdef GRPC_BASIC_PROFILER
/* Empty placeholder for now. */
-#endif /* GRPC_BASIC_PROFILER */
+#endif /* GRPC_BASIC_PROFILER */
-#endif /* at least one profiler requested. */
+#endif /* at least one profiler requested. */
#ifdef __cplusplus
}
#endif
-#endif /* GRPC_CORE_PROFILING_TIMERS_H */
+#endif /* GRPC_CORE_PROFILING_TIMERS_H */