diff options
author | Vijay Pai <vpai@google.com> | 2015-04-15 00:44:35 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-04-15 00:44:35 -0700 |
commit | 74c0224e672468ff1a55f150513ebd70045dcc68 (patch) | |
tree | 70e96f90d2f8917b76a845ebdb873bd19be5cd5d /src | |
parent | 457f1f7d2ac0917b2c065b43ab8393a2f3f37eca (diff) |
Change int sequence number to a void* for more generality
Diffstat (limited to 'src')
-rw-r--r-- | src/core/profiling/timers.c | 6 | ||||
-rw-r--r-- | 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) \ |