From 74c0224e672468ff1a55f150513ebd70045dcc68 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 15 Apr 2015 00:44:35 -0700 Subject: Change int sequence number to a void* for more generality --- src/core/profiling/timers.c | 6 +++--- src/core/profiling/timers.h | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/core/profiling/timers.c b/src/core/profiling/timers.c index 478397d1bf..e8743aa990 100644 --- a/src/core/profiling/timers.c +++ b/src/core/profiling/timers.c @@ -45,7 +45,7 @@ typedef struct grpc_timer_entry { grpc_precise_clock tm; const char* tag; - int seq; + void* seq; const char* file; int line; } grpc_timer_entry; @@ -85,7 +85,7 @@ static void log_report_locked(grpc_timers_log* log) { 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, + fprintf(fp, " %s %p %s %d\n", entry->tag, entry->seq, entry->file, entry->line); } @@ -104,7 +104,7 @@ 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, +void grpc_timers_log_add(grpc_timers_log* log, const char* tag, void* seq, const char* file, int line) { grpc_timer_entry* entry; diff --git a/src/core/profiling/timers.h b/src/core/profiling/timers.h index ef4cad112a..3cb6feaa85 100644 --- a/src/core/profiling/timers.h +++ b/src/core/profiling/timers.h @@ -44,15 +44,16 @@ extern "C" { typedef struct grpc_timers_log grpc_timers_log; -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); +grpc_timers_log* grpc_timers_log_create(int capacity_limit, FILE* dump); +void grpc_timers_log_add(grpc_timers_log*, const char* tag, void* seq, + 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__) + grpc_timers_log_add(grpc_timers_log_global, #x, ((void *)(gpr_intptr)(s)), \ + __FILE__, __LINE__) #else /* !GRPC_LATENCY_PROFILER */ #define GRPC_TIMER_MARK(x, s) \ -- cgit v1.2.3