diff options
| author | Jeff Hostetler <jeffhost@microsoft.com> | 2022-10-24 13:41:05 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-10-24 12:45:26 -0700 |
| commit | 24a4c45da9e1255df43a87bec1f646b1efa69209 (patch) | |
| tree | 349f564bf5bac27bc6b2049194bb17b606eee449 /trace2/tr2_tgt_perf.c | |
| parent | 31247936041318d441de5a2681f9bcb79459c726 (diff) | |
| download | git-24a4c45da9e1255df43a87bec1f646b1efa69209.tar.gz | |
trace2: convert ctx.thread_name from strbuf to pointer
Convert the `tr2tls_thread_ctx.thread_name` field from a `strbuf`
to a "const char*" pointer.
The `thread_name` field is a constant string that is constructed when
the context is created. Using a (non-const) `strbuf` structure for it
caused some confusion in the past because it implied that someone
could rename a thread after it was created. That usage was not
intended. Change it to a const pointer to make the intent more clear.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2/tr2_tgt_perf.c')
| -rw-r--r-- | trace2/tr2_tgt_perf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c index 8cb792488c..59ca58f862 100644 --- a/trace2/tr2_tgt_perf.c +++ b/trace2/tr2_tgt_perf.c @@ -108,7 +108,7 @@ static void perf_fmt_prepare(const char *event_name, strbuf_addf(buf, "d%d | ", tr2_sid_depth()); strbuf_addf(buf, "%-*s | %-*s | ", TR2_MAX_THREAD_NAME, - ctx->thread_name.buf, TR2FMT_PERF_MAX_EVENT_NAME, + ctx->thread_name, TR2FMT_PERF_MAX_EVENT_NAME, event_name); len = buf->len + TR2FMT_PERF_REPO_WIDTH; |
