]> git.dujemihanovic.xyz Git - u-boot.git/commit
trace: use dynamic string buffer in make_flamegraph()
authorVincent Stehlé <vincent.stehle@arm.com>
Tue, 2 Apr 2024 11:29:16 +0000 (13:29 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 10 Apr 2024 15:34:53 +0000 (09:34 -0600)
commitb782be47f12b1957c67e612e7d3b0ef7b3f32b36
treeb3bb78e5046c2300e6098307b23d2954d069ad73
parentf12001b1317b7219b1f764497fa643389ffe04b4
trace: use dynamic string buffer in make_flamegraph()

The str[] buffer declared in make_flamegraph() is used to hold strings
representing the full call-stacks recorded in traces. The size of this
buffer is currently 500 characters and this works well for the documented
examples.

However, it is possible to exhaust this buffer when processing traces
captured when running the UEFI shell on aarch64 sandbox for example.
Indeed, the maximum length needed for such traces can reach 780 characters.

As it is difficult to evaluate the maximum size that would ever be needed
for all the possible traces, let's use a dynamically allocated `abuf'
instead, which we reallocate when needed.

This fixes the following error:

  String too short (500 chars)

While at it, fix a few typos in strings and comments.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Michal Simek <michal.simek@amd.com>
tools/proftool.c