aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@amd.com>2023-09-15 14:12:04 +0200
committerMichal Simek <michal.simek@amd.com>2023-09-21 13:20:12 +0200
commitad0f3cdc219c9482c728cdbcf43cfcc2dfba04e2 (patch)
tree8ebf9e2ced220e8da2cfca55e08e623dc201c8c3
parentdee8739a1ba5fe8cdf1c51b168dbc56f7bd921c4 (diff)
downloadu-boot-ad0f3cdc219c9482c728cdbcf43cfcc2dfba04e2.zip
u-boot-ad0f3cdc219c9482c728cdbcf43cfcc2dfba04e2.tar.gz
u-boot-ad0f3cdc219c9482c728cdbcf43cfcc2dfba04e2.tar.bz2
trace: Move trace_clocks description above record offset calculation
Flyrecord tracing data are page aligned that's why it is necessary to calculate alignment properly. Because trace_clocks description is the part of record length it is necessary to have information about length earlier. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/d3853d91b6fa7e3a1e5c24dd3c17335cf0041b5b.1694779918.git.michal.simek@amd.com
-rw-r--r--tools/proftool.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/proftool.c b/tools/proftool.c
index 869a2a3..7c95a94 100644
--- a/tools/proftool.c
+++ b/tools/proftool.c
@@ -1500,6 +1500,10 @@ static int write_flyrecord(struct twriter *tw, enum out_format_t out_format,
tw->ptr += fprintf(fout, "flyrecord%c", 0);
+ snprintf(str, sizeof(str),
+ "[local] global counter uptime perf mono mono_raw boot x86-tsc\n");
+ len = strlen(str);
+
/* trace data */
start = ALIGN(tw->ptr + 16, TRACE_PAGE_SIZE);
tw->ptr += tputq(fout, start);
@@ -1510,9 +1514,6 @@ static int write_flyrecord(struct twriter *tw, enum out_format_t out_format,
return -1;
tw->ptr += ret;
- snprintf(str, sizeof(str),
- "[local] global counter uptime perf mono mono_raw boot x86-tsc\n");
- len = strlen(str);
tw->ptr += tputq(fout, len);
tw->ptr += tputs(fout, str);