diff options
author | Vijay Pai <vpai@google.com> | 2015-04-13 13:07:36 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-04-13 13:07:36 -0700 |
commit | 0310f13fd95e44ba95b2424caea33be513681d57 (patch) | |
tree | f43a22164f5963f94871c12e60c207b70f478cb2 /src/core/profiling | |
parent | 9cccb08311ea969ac018a781a2fe4a0f09a7cc8b (diff) |
clang-format results
Diffstat (limited to 'src/core/profiling')
-rw-r--r-- | src/core/profiling/timers.c | 30 | ||||
-rw-r--r-- | src/core/profiling/timers.h | 12 | ||||
-rw-r--r-- | src/core/profiling/timers_preciseclock.h | 1 |
3 files changed, 21 insertions, 22 deletions
diff --git a/src/core/profiling/timers.c b/src/core/profiling/timers.c index 74da10bf91..4814930a79 100644 --- a/src/core/profiling/timers.c +++ b/src/core/profiling/timers.c @@ -56,12 +56,12 @@ struct grpc_timers_log { int num_entries; int capacity; int capacity_limit; - FILE *fp; + FILE* fp; }; grpc_timers_log* grpc_timers_log_global = NULL; -grpc_timers_log* grpc_timers_log_create(int capacity_limit, FILE *dump) { +grpc_timers_log* grpc_timers_log_create(int capacity_limit, FILE* dump) { grpc_timers_log* log = gpr_malloc(sizeof(*log)); /* TODO (vpai): Allow allocation below limit */ @@ -78,22 +78,22 @@ grpc_timers_log* grpc_timers_log_create(int capacity_limit, FILE *dump) { return log; } -static void log_report_locked(grpc_timers_log *log) { - FILE *fp = log->fp; +static void log_report_locked(grpc_timers_log* log) { + FILE* fp = log->fp; int i; - for (i=0;i<log->num_entries;i++) { + for (i = 0; i < log->num_entries; i++) { grpc_timer_entry* entry = &(log->log[i]); fprintf(fp, "GRPC_LAT_PROF "); grpc_precise_clock_print(&entry->tm, fp); - fprintf(fp, " %s#%d,%s:%d\n", entry->tag, entry->seq, - entry->file, entry->line); + fprintf(fp, " %s#%d,%s:%d\n", entry->tag, entry->seq, entry->file, + entry->line); } /* Now clear out the log */ - log->num_entries=0; + log->num_entries = 0; } -void grpc_timers_log_destroy(grpc_timers_log *log) { +void grpc_timers_log_destroy(grpc_timers_log* log) { gpr_mu_lock(&log->mu); log_report_locked(log); gpr_mu_unlock(&log->mu); @@ -104,8 +104,8 @@ void grpc_timers_log_destroy(grpc_timers_log *log) { gpr_free(log); } -void grpc_timers_log_add(grpc_timers_log *log, const char *tag, int seq, - const char *file, int line) { +void grpc_timers_log_add(grpc_timers_log* log, const char* tag, int seq, + const char* file, int line) { grpc_timer_entry* entry; /* TODO (vpai) : Improve concurrency */ @@ -132,9 +132,7 @@ void grpc_timers_log_global_init(void) { void grpc_timers_log_global_destroy(void) { grpc_timers_log_destroy(grpc_timers_log_global); } -#else /* !GRPC_LATENCY_PROFILER */ -void grpc_timers_log_global_init(void) { -} -void grpc_timers_log_global_destroy(void) { -} +#else /* !GRPC_LATENCY_PROFILER */ +void grpc_timers_log_global_init(void) {} +void grpc_timers_log_global_destroy(void) {} #endif /* GRPC_LATENCY_PROFILER */ diff --git a/src/core/profiling/timers.h b/src/core/profiling/timers.h index f3a87752ce..ef4cad112a 100644 --- a/src/core/profiling/timers.h +++ b/src/core/profiling/timers.h @@ -44,18 +44,20 @@ extern "C" { typedef struct grpc_timers_log grpc_timers_log; -grpc_timers_log* grpc_timers_log_create(int capacity_limit, FILE *dump); +grpc_timers_log *grpc_timers_log_create(int capacity_limit, FILE *dump); void grpc_timers_log_add(grpc_timers_log *, const char *tag, int seq, - const char *file, int line); + const char *file, int line); void grpc_timers_log_destroy(grpc_timers_log *); extern grpc_timers_log *grpc_timers_log_global; -#define GRPC_TIMER_MARK(x, s) grpc_timers_log_add(grpc_timers_log_global, #x, \ - s, __FILE__, __LINE__) +#define GRPC_TIMER_MARK(x, s) \ + grpc_timers_log_add(grpc_timers_log_global, #x, s, __FILE__, __LINE__) #else /* !GRPC_LATENCY_PROFILER */ -#define GRPC_TIMER_MARK(x, s) do {} while (0) +#define GRPC_TIMER_MARK(x, s) \ + do { \ + } while (0) #endif /* GRPC_LATENCY_PROFILER */ void grpc_timers_log_global_init(void); diff --git a/src/core/profiling/timers_preciseclock.h b/src/core/profiling/timers_preciseclock.h index c39596709a..bf4a0eab8a 100644 --- a/src/core/profiling/timers_preciseclock.h +++ b/src/core/profiling/timers_preciseclock.h @@ -53,5 +53,4 @@ static void grpc_precise_clock_print(const grpc_precise_clock* clk, FILE* fp) { } #endif /* GRPC_TIMERS_RDTSC */ - #endif /* GRPC_CORE_PROFILING_TIMERS_PRECISECLOCK_H */ |