From 0310f13fd95e44ba95b2424caea33be513681d57 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 13 Apr 2015 13:07:36 -0700 Subject: clang-format results --- src/core/profiling/timers.c | 30 ++++++++++++++---------------- src/core/profiling/timers.h | 12 +++++++----- src/core/profiling/timers_preciseclock.h | 1 - 3 files changed, 21 insertions(+), 22 deletions(-) (limited to 'src/core/profiling') 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;inum_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 */ -- cgit v1.2.3