From nobody Thu Jan 30 17:24:25 2025 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F400E1BD9E5 for ; Thu, 23 Jan 2025 23:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737676780; cv=none; b=KdfET8wNUSkq4JH1zrxwzi4hrAFp11+ZUDdZoctLaezPd34E5dKfuBLvqCjaUbYt6j7Ua+5K+asV/n5Glw3uRBNMUe0uLWIZ78duxEPsOqgzNmFxAtbigHXRfR+mcAbiphWQf59JhOZTwgF4CC8ESTrZnzQ17T3Lwsr9CuqIiEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737676780; c=relaxed/simple; bh=bWgQLBpkfpxIT34/8Wx/CNRUEQDQg1V7I+bbzIQI6f4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=b+jbWPu3WNg5KfZakiBxcMTwf0pBIT6lydF4d3HgmpLk3Lo9s2FEGGF7JdVtY+uY10o1rHrfi6r3mGz9QqEU8cEFxOa5MMiv5hugHaxTXQUf+JocmGjKoGxt2p0RCLgFtojcTmhRrzQPx6DHvkiKZB3h1tlnJrlTKSN4GduqPII= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=engflow.com; spf=pass smtp.mailfrom=engflow.com; dkim=pass (1024-bit key) header.d=engflow.com header.i=@engflow.com header.b=CQC5+NwF; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=engflow.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=engflow.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=engflow.com header.i=@engflow.com header.b="CQC5+NwF" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-21669fd5c7cso26626255ad.3 for ; Thu, 23 Jan 2025 15:59:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=engflow.com; s=google; t=1737676778; x=1738281578; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=5m/RuW26VeXb+ulCBQUP9Ev9ewcGepBG0IbXPJOeedk=; b=CQC5+NwFnIVAxPa4QQcXIKu2R9oQILuYVs5c+kpCeQOPgVmUASXdEuzDGx8ay5wfcj HiUnyJoz/TWnAEjo4gIdr2/p5biZcV3dwRIw4MM5YU9JFiGPUGnQOUOZ4u4wO+Gp5JC7 J9UE5L01Wcai/oWz2ozP+hl2gHMJR8hoU5Sxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737676778; x=1738281578; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5m/RuW26VeXb+ulCBQUP9Ev9ewcGepBG0IbXPJOeedk=; b=vHkXGxEWv+KCaFKKLcwzAVRk+99nKqR4gc2r4FGVUbt4EQ2CMksITBB2HpDeyuxJHc +jCp+Z/JpPnSNjgQSs5ed4b3TTuBqyMEDacdYJkx/+BJmBnZtDAnOom9kjmjyyalr6Vj 2Xgj6M2Zb4Tlae6KKAZPhx6Sdcsl9zppiiZq3b675pQrPjuS7kfwrGefAxzOh3R9X1Mh e8uhTRpLWAc6RfQyAJtUg1MYPE9EX/im3fkiQrGd9KmokMLywrtzoc/nRjWkvVyJ4UB6 RkY9M9niJ/yqeB1M+PlTr9PH0kBrK0mP4XWgcN5drv/DeDuPQfOvUmSiytFHDRMzGugU AnNg== X-Forwarded-Encrypted: i=1; AJvYcCWNWJin13ZUdR2IBr8QBKRqoKZDUfRkogg+13gdsey1jpfwmOqsoBC3zV9aySHCxMPNAZLLqSUFE4ZgOlA=@vger.kernel.org X-Gm-Message-State: AOJu0YwgbRPDcsUWC7fRDq++8cM6jgX4F6iLNtaEIr/cRaZAI33C1yLD rY8lPTo0H/8kSMtZCAlntZyc7Kese+izPFmrxsA99WgoFLC21OjBeR1TxldwoJo= X-Gm-Gg: ASbGncs/L7Eb5tkpwlWbESxwgEYIZio8WRmk4H7zpjIbj9vYVllZcd7JHV2zA/Hh7Ea GUIBMCg0YwguWOELhg5pfTSoA4Z1oSDD2qWLe0zMhlv80ldV4CPYhl6l3q3VT+d2KY7ej1cdP4P 3RDJuH0Mt0ju3RvTuQoy76m6mD580qFS5fQ0E879idk10ewA2ns9KATp3ArdUBYfXeAF2lZVn8V GD8TJoDt5pgke48DBFmrwrB+tvTrWXCL57dj3TZY5XP3RP+NzQrrHqPOFmT0pw7h8DtkIPbELmf vxGF3fnLuqO7G6jUDuSYhM9nq7hyHw2VcMjr9sm/eP6foQ== X-Google-Smtp-Source: AGHT+IEPqjhQVpFd3DogTe/CckCCbHZwhWa9F5A94jY7ve5wDBGv7zqqz1Lb0T8ZhKtstlj1bQqa4w== X-Received: by 2002:a17:902:ef11:b0:216:3dc5:1240 with SMTP id d9443c01a7336-21c355ef44bmr393632985ad.45.1737676778206; Thu, 23 Jan 2025 15:59:38 -0800 (PST) Received: from [127.0.1.1] (158-247-70-44.PUBLIC.monkeybrains.net. [158.247.70.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da4141d41sm4656375ad.126.2025.01.23.15.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 15:59:37 -0800 (PST) From: Benjamin Peterson Date: Thu, 23 Jan 2025 15:59:35 -0800 Subject: [PATCH v2] perf trace: Fix return value of trace__fprintf_tp_fields Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250123-void-fprintf_tp_fields-v2-1-6038f8224987@engflow.com> X-B4-Tracking: v=1; b=H4sIAObXkmcC/4WNQQqDMBBFryKzboqZGihd9R5FJI0zOmATSSS2i Hdv6gW6fA/++xskikIJbtUGkbIkCb4Anipwo/UDKekLA9bYaNSocpBe8RzFL9wtc8dCU5/U1Vp LyMagYSjjORLL+wg/2sKjpCXEz/GT9c/+TWattHrWDi/M3DjT3MkPPIX17MIL2n3fv3551vK+A AAA X-Change-ID: 20241212-void-fprintf_tp_fields-8aaae2f5525f To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Peterson X-Mailer: b4 0.14.2 This function formerly returned twice the number of bytes printed. Signed-off-by: Benjamin Peterson --- This is a small followup cleanup to my earlier commit 5fb8e56542a3 ("perf trace: avoid garbage when not printing a trace event's arguments"). To:=20 --- tools/perf/builtin-trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 6a1a128fe645014d0347ad4ec3e0c9e77ec59aee..c2e8ff48682bdc86a0a21f54f51= 63eb82d4cc17d 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -3088,7 +3088,7 @@ static size_t trace__fprintf_tp_fields(struct trace *= trace, struct evsel *evsel, printed +=3D syscall_arg_fmt__scnprintf_val(arg, bf + printed, size - pr= inted, &syscall_arg, val); } =20 - return printed + fprintf(trace->output, "%.*s", (int)printed, bf); + return fprintf(trace->output, "%.*s", (int)printed, bf); } =20 static int trace__event_handler(struct trace *trace, struct evsel *evsel, --- base-commit: 8883957b3c9de2087fb6cf9691c1188cccf1ac9c change-id: 20241212-void-fprintf_tp_fields-8aaae2f5525f Best regards, --=20 Benjamin Peterson