From: Jeff Hostetler via GitGitGadget Date: Tue, 28 Dec 2021 19:36:35 GMT Subject: [PATCH v2 2/9] trace2: convert tr2tls_thread_ctx.thread_name from strbuf to flex array Message-ID: In-Reply-To: From: Jeff Hostetler Move the thread name to a flex array at the bottom of the Trace2 thread local storage data and get rid of the strbuf. Let the flex array have the full computed value of the thread name without truncation. Change the PERF target to truncate the thread name so that the columns still line up. Signed-off-by: Jeff Hostetler --- trace2/tr2_tgt_event.c | 2 +- trace2/tr2_tgt_perf.c | 7 ++++--- trace2/tr2_tls.c | 25 +++++++++++++------------ trace2/tr2_tls.h | 10 +--------- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/trace2/tr2_tgt_event.c b/trace2/tr2_tgt_event.c index 3a0014417cc..ca48d00aebc 100644 --- a/trace2/tr2_tgt_event.c +++ b/trace2/tr2_tgt_event.c @@ -88,7 +88,7 @@ static void event_fmt_prepare(const char *event_name, const char *file, jw_object_string(jw, "event", event_name); jw_object_string(jw, "sid", tr2_sid_get()); - jw_object_string(jw, "thread", ctx->thread_name.buf); + jw_object_string(jw, "thread", ctx->thread_name); /* * In brief mode, only emit