From patchwork Thu Feb 15 21:39:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 201761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp137388dyb; Thu, 15 Feb 2024 13:39:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXFAzgmxcV596fJEeCpYLSq3u8/7WN6VQztrNorukmJsQ5PubDzn3ZDooWpIVmAepVaff3EXHN/vVMe9gAnXFixgwh5WQ== X-Google-Smtp-Source: AGHT+IFQmh9d6/nNqXzQyMQDlA5RbCEeK4S12yI5XMBYV78hfxOKxeq8696gOZfwRXqkDj84DwWJ X-Received: by 2002:ac8:4f0f:0:b0:42d:d78f:8278 with SMTP id b15-20020ac84f0f000000b0042dd78f8278mr1315426qte.52.1708033140946; Thu, 15 Feb 2024 13:39:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708033140; cv=pass; d=google.com; s=arc-20160816; b=ycZwH8skMApTDuqPkU3Qhyv209xkpZIK6FpArGxL2nT9tqvBw5G0jsZb4uCgFXiF+Q VjEQibHFJSXC4X3+fARxC1TfY0N9V8LcZqOkbsMSKw1N+dqdB6iYi93Ce/vi4uw1Wee7 j1YQNFAJCHolmz6lUJ/r9AGcF3WttebS2jZyxoZkdnotPwWrySU9gXH4P1FdlNhs6BCN g8djYDFib2g+EelX1WSI9IDx1Sje+sQ6pbOXfHCdGqtN9TUaYVJq+bxRLoOuNdvOXLNt 6LQ2BciATXHM3a0XAz7UX9bDTmN9VvDj+Xw4mimmhNT2hVPIAlbXNAQW43NTYX2siCBf Ow1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=g/vbEDcmvSRp0zqolWmABtagY3Z5kp7Gh+rxrtIo07s=; fh=0sVjrz5QfP9NgLxTP/vdiUBjJ5NChrEJDZd4HHpGvE0=; b=HNzLOsvOWV/O3ATJn7IAqKtwaS1DJd8yz/H9vUdWp02oResdm8NYVazSiBfpkVM9gA a8lzWkYAzHQdujsvyFuFZow+gYGYFOU5vy1m2mYA88S+grkbmc0/suImepEEbwj+2AyT iYyH5V2iLzpZc+pMaCBk6xdG9YwPLrXx/dv+fxYFDIXXX7faEsF6HgxvcCSpWA+EIA3D iRHxcPDLSm1VGQR892C8cCf8YB9SE/o8nxncORp1DhTR+TXt8qP/U/SUTWxXO577KO1G pyDAYC4/Y+H3KCjX/lGI9rPVZ/m4fYGHDjXIRsVJ4ks5BC/6LusMko88vD5jJ0NeLD73 3ygw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67705-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67705-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d6-20020ac851c6000000b0042c63b8d06csi2223225qtn.258.2024.02.15.13.39.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 13:39:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67705-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-67705-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67705-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B60921C2132F for ; Thu, 15 Feb 2024 21:39:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE3AC145B14; Thu, 15 Feb 2024 21:38:11 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5ADE313DB8A; Thu, 15 Feb 2024 21:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708033090; cv=none; b=fzofpqFrCne97cb21cXFnr/hAmzjDz5HcRdt31N6qc/KH86vFrQc5QFvAznzDWIzZJ1ewMPzJ4m/nzULbl6NHwLjgi0gkyrIKkh+YmkpukWHY9VyR0dNzEJ8tMiv8/OKxnWJ/am6MEltpA3hKY/8b60VFFKHRmtLYogScuwWDwY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708033090; c=relaxed/simple; bh=g+k8dVIgHQp4F/ACveGtoBHKj0W/K4gDHR8e9oQTBSw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=php4NzdkKEu5dE9+p24cXZa8IuKuEtsCNu6d/vyPGeh/tes0R74RIqPxRhpaS507vXtO1AXekF3oGlpN/H8s9HbYpdLn7t4gNT/Ekhw7LUH7SKy7+wS34f0AY4pUbvL4Nq7LCiVKaE7nCQ01hH8Yh2cW8YJbLhcE9GFnEtkUpuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB84BC43399; Thu, 15 Feb 2024 21:38:09 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rajSK-00000000ee2-3PlZ; Thu, 15 Feb 2024 16:39:44 -0500 Message-ID: <20240215213944.670781481@goodmis.org> User-Agent: quilt/0.67 Date: Thu, 15 Feb 2024 16:39:18 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , stable@vger.kernel.org, Thorsten Blum Subject: [for-linus][PATCH 2/4] tracing/synthetic: Fix trace_string() return value References: <20240215213916.385127578@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791002558788944250 X-GMAIL-MSGID: 1791002558788944250 From: Thorsten Blum Fix trace_string() by assigning the string length to the return variable which got lost in commit ddeea494a16f ("tracing/synthetic: Use union instead of casts") and caused trace_string() to always return 0. Link: https://lore.kernel.org/linux-trace-kernel/20240214220555.711598-1-thorsten.blum@toblux.com Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers Fixes: ddeea494a16f ("tracing/synthetic: Use union instead of casts") Acked-by: Masami Hiramatsu (Google) Signed-off-by: Thorsten Blum Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_synth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c index e7af286af4f1..c82b401a294d 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -441,8 +441,9 @@ static unsigned int trace_string(struct synth_trace_event *entry, if (is_dynamic) { union trace_synth_field *data = &entry->fields[*n_u64]; + len = fetch_store_strlen((unsigned long)str_val); data->as_dynamic.offset = struct_size(entry, fields, event->n_u64) + data_size; - data->as_dynamic.len = fetch_store_strlen((unsigned long)str_val); + data->as_dynamic.len = len; ret = fetch_store_string((unsigned long)str_val, &entry->fields[*n_u64], entry);