trace2: trim whitespace in region messages in perf target format
Avoid unecessary trailing whitespace in "region_enter" and "region_leave" messages in perf target format. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
371df1bea9
commit
da4589ce7e
@ -452,8 +452,11 @@ static void fn_region_enter_printf_va_fl(const char *file, int line,
|
|||||||
struct strbuf buf_payload = STRBUF_INIT;
|
struct strbuf buf_payload = STRBUF_INIT;
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
strbuf_addf(&buf_payload, "label:%s ", label);
|
strbuf_addf(&buf_payload, "label:%s", label);
|
||||||
|
if (fmt && *fmt) {
|
||||||
|
strbuf_addch(&buf_payload, ' ');
|
||||||
maybe_append_string_va(&buf_payload, fmt, ap);
|
maybe_append_string_va(&buf_payload, fmt, ap);
|
||||||
|
}
|
||||||
|
|
||||||
perf_io_write_fl(file, line, event_name, repo, &us_elapsed_absolute,
|
perf_io_write_fl(file, line, event_name, repo, &us_elapsed_absolute,
|
||||||
NULL, category, &buf_payload);
|
NULL, category, &buf_payload);
|
||||||
@ -469,8 +472,11 @@ static void fn_region_leave_printf_va_fl(
|
|||||||
struct strbuf buf_payload = STRBUF_INIT;
|
struct strbuf buf_payload = STRBUF_INIT;
|
||||||
|
|
||||||
if (label)
|
if (label)
|
||||||
strbuf_addf(&buf_payload, "label:%s ", label);
|
strbuf_addf(&buf_payload, "label:%s", label);
|
||||||
|
if (fmt && *fmt) {
|
||||||
|
strbuf_addch(&buf_payload, ' ' );
|
||||||
maybe_append_string_va(&buf_payload, fmt, ap);
|
maybe_append_string_va(&buf_payload, fmt, ap);
|
||||||
|
}
|
||||||
|
|
||||||
perf_io_write_fl(file, line, event_name, repo, &us_elapsed_absolute,
|
perf_io_write_fl(file, line, event_name, repo, &us_elapsed_absolute,
|
||||||
&us_elapsed_region, category, &buf_payload);
|
&us_elapsed_region, category, &buf_payload);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user