[PATCH v2] perf trace: Fix return value of trace__fprintf_tp_fields

Benjamin Peterson posted 1 patch 6 days, 4 hours ago
tools/perf/builtin-trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] perf trace: Fix return value of trace__fprintf_tp_fields
Posted by Benjamin Peterson 6 days, 4 hours ago
This function formerly returned twice the number of bytes printed.

Signed-off-by: Benjamin Peterson <benjamin@engflow.com>
---
This is a small followup cleanup to my earlier commit 5fb8e56542a3 ("perf
trace: avoid garbage when not printing a trace event's arguments").

To: 
---
 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..c2e8ff48682bdc86a0a21f54f5163eb82d4cc17d 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 += syscall_arg_fmt__scnprintf_val(arg, bf + printed, size - printed, &syscall_arg, val);
 	}
 
-	return printed + fprintf(trace->output, "%.*s", (int)printed, bf);
+	return fprintf(trace->output, "%.*s", (int)printed, bf);
 }
 
 static int trace__event_handler(struct trace *trace, struct evsel *evsel,

---
base-commit: 8883957b3c9de2087fb6cf9691c1188cccf1ac9c
change-id: 20241212-void-fprintf_tp_fields-8aaae2f5525f

Best regards,
-- 
Benjamin Peterson <benjamin@engflow.com>
Re: [PATCH v2] perf trace: Fix return value of trace__fprintf_tp_fields
Posted by Namhyung Kim 2 days, 10 hours ago
On Thu, 23 Jan 2025 15:59:35 -0800, Benjamin Peterson wrote:

> This function formerly returned twice the number of bytes printed.
> 
> 

Applied to perf-tools-next, thanks!

Best regards,
Namhyung