From: Jeff Hostetler <jeffh...@microsoft.com>

Trim leading/trailing whitespace from the command line
printed in the "start" message in the perf target format.

We use `sq_quote_argv_pretty()` to format the message
and it adds a leading space to the output.  Trim that.

Signed-off-by: Jeff Hostetler <jeffh...@microsoft.com>
---
 trace2/tr2_tgt_perf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
index 4a9d99218b..ed4e708f28 100644
--- a/trace2/tr2_tgt_perf.c
+++ b/trace2/tr2_tgt_perf.c
@@ -185,6 +185,7 @@ static void fn_start_fl(const char *file, int line,
        struct strbuf buf_payload = STRBUF_INIT;
 
        sq_quote_argv_pretty(&buf_payload, argv);
+       strbuf_trim(&buf_payload);
 
        perf_io_write_fl(file, line, event_name, NULL, &us_elapsed_absolute,
                         NULL, NULL, &buf_payload);
-- 
gitgitgadget

Reply via email to