From patchwork Tue Dec 28 19:36:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12700557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04870C433F5 for ; Tue, 28 Dec 2021 19:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237179AbhL1Tgr (ORCPT ); Tue, 28 Dec 2021 14:36:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237175AbhL1Tgr (ORCPT ); Tue, 28 Dec 2021 14:36:47 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 751ABC061574 for ; Tue, 28 Dec 2021 11:36:46 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id s1so40171101wra.6 for ; Tue, 28 Dec 2021 11:36:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=GFBd797eHYnH0eNzK9O41oTMilucb0iYBWz2vFrtEVo=; b=NEYDXU57NWPsDqKP4Nr5VNQOYV56+3dXHGlNYLi5QDYuvaAX54x0kQT6aCrIY+JbEO wSAPOovTra8v6omRyimND2hcBeoJu09OhUGDoGPW1lKU+mNOUKlF6KNntiS9U7L+GPoD 7hkjujBSQ2fGUB6H/z4g+1SocfuCTHAWTzbQ+TAWNA5MQOx2ywXdjcFGnfqf9YoUmGiK lmLx3AkXYYWWzLLaWv8arNoxidVAlnEi4OBbnUrjLhWP5ygMba4uidTdZqWkb5/1sFx3 1vY0yMyeNpTTuadW293jT03+/pF6HFEaTC4ImKwgXDwM4aGhLgJPVESnQYmrPJ2TKjha QkYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=GFBd797eHYnH0eNzK9O41oTMilucb0iYBWz2vFrtEVo=; b=7dfgc52IFugQk5R3NxYxNiGa4nFA47n630icpVj5uKq3paDBSovWaHp7u5MRoyi2HA JV1w5MHPKtzV8YZLECcQ+dRuxCPYRShZj9IA4MyeZJJSXWKiInhenSsKXReBtBSdkbtP 2GBxcYYNWONYAXC7GQkCrCzoeoimGteZliKXsh0F6BoRyILMgzlhXq94HECGaN1otOzO n2eWIt1xbf1av1NZ1WW3B7CW8ROTyXg0X5WVbd6/T1z/LhT1DNTLozwCZ5v8rDqvRKhi A1JNNhvL7yVbMyNVDVToa2TZuXG2t3e4RtKEkJNxgr01jxZgz2kGznF+afZrZGoHRvQN 5ymw== X-Gm-Message-State: AOAM533mxc45GkiCTiJuAcMoqH9Vzu9TMs2o0WxoX+QZlWBLPwGdjnub r9vvHJ2PO+TJEge1SIxRfedkh/hf7R8= X-Google-Smtp-Source: ABdhPJzbL+4KOj2HAufKYwOevV3vNbQLXllZELME/GYyOI5fIsqgABIbc4pDltXx/nlN15EphUl66Q== X-Received: by 2002:a5d:6e8c:: with SMTP id k12mr17189356wrz.664.1640720204832; Tue, 28 Dec 2021 11:36:44 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o38sm17688444wms.11.2021.12.28.11.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 11:36:44 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 28 Dec 2021 19:36:35 +0000 Subject: [PATCH v2 2/9] trace2: convert tr2tls_thread_ctx.thread_name from strbuf to flex array Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , Jeff Hostetler , Derrick Stolee , Matheus Tavares , Johannes Sixt , Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler 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