Skip to content
Snippets Groups Projects
Commit c50a090f authored by Nadav Har'El's avatar Nadav Har'El Committed by Avi Kivity
Browse files

trace: only allocate trace_log when tracepoints are enabled


The current code the trace_log - a 4MB array which stores tracepoint data -
is a global array. In other words, as explained in issue #96, it is part
of the BSS, which always adds 4MB memory usage to OSv - whether or not
tracepoints are actually enabled.

This patch changes trace_log to be a dynamically-allocated array, allocated
when the first tracepoint is enabled (e.g., with a --trace=...  boot
option).

This will also allow us (in the future) to choose the size of the trace log
at run time rather than compile time.

This patch reduces 4 MB of BSS (from 13MB to 9MB), and correspondly lowers
our minimum memory use by 4 MB. Whereas the minimum memory requirement of
the "rogue" image used to be 59 MB, now it is 55 MB.

Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
parent 824f0f64
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment