[PATCH 2/3] trace2: trim whitespace in start message in perf target format
- From
- Jeff Hostetler via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jul 31, 2019, 20:04 UTC
- Message-ID
- <834ee95cd2fe919c7a5a2d3cc3d647cfdeebe9e6.1564603467.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.298.git.gitgitgadget@gmail.com>
From: Jeff Hostetler <jeffhost@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 <jeffhost@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