diff options
author | Alex Rønne Petersen <alex@alexrp.com> | 2016-10-31 22:59:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-31 22:59:56 +0300 |
commit | db6986665292f1cd91763c32667929842d25b1db (patch) | |
tree | 850208884e8ca25e8692e5132978a45a16896490 | |
parent | 20d3235dae9f07738b90a7cd137ee49c4d72f728 (diff) | |
parent | 63499586de3ff308327e10e3abe60b502ddb34c3 (diff) |
Merge pull request #3860 from alexrp/profiler-c8sr1-fixesmono-4.6.2.6
[C8SR1][profiler] Fix regression causing buffers to have a zero thread ID.
-rw-r--r-- | mono/profiler/proflog.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mono/profiler/proflog.c b/mono/profiler/proflog.c index 40e41872804..874d8ba620e 100644 --- a/mono/profiler/proflog.c +++ b/mono/profiler/proflog.c @@ -674,7 +674,7 @@ pstrdup (const char *s) } static LogBuffer* -create_buffer (void) +create_buffer (uintptr_t tid) { LogBuffer* buf = (LogBuffer *)alloc_buffer (BUFFER_SIZE); @@ -683,15 +683,17 @@ create_buffer (void) buf->size = BUFFER_SIZE; buf->time_base = current_time (); buf->last_time = buf->time_base; - buf->buf_end = (unsigned char*)buf + buf->size; + buf->buf_end = (unsigned char *) buf + buf->size; buf->cursor = buf->buf; + buf->thread_id = tid; + return buf; } static void init_buffer_state (MonoProfilerThread *thread) { - thread->buffer = create_buffer (); + thread->buffer = create_buffer (thread->node.key); thread->methods = NULL; } @@ -758,7 +760,7 @@ ensure_logbuf_inner (LogBuffer *old, int bytes) if (old && old->cursor + bytes + 100 < old->buf_end) return old; - LogBuffer *new_ = create_buffer (); + LogBuffer *new_ = create_buffer (old->thread_id); new_->next = old; return new_; |