tracing: Dynamically allocate the per-elt hist_elt_data array
authorTom Zanussi <zanussi@kernel.org>
Thu, 2 Sep 2021 20:57:12 +0000 (15:57 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 8 Sep 2021 19:29:16 +0000 (15:29 -0400)
commitc910db943d35d4ac4b77570ece76e0799af24233
tree6d6bcf3cbd73b5e82ad79e25dbe90dd40d56491d
parent0be083cee42ec78ba6f9148f5b12a00aa2fb8bd3
tracing: Dynamically allocate the per-elt hist_elt_data array

Setting the hist_elt_data.field_var_str[] array unconditionally to a
size of SYNTH_FIELD_MAX elements wastes space unnecessarily.  The
actual number of elements needed can be calculated at run-time
instead.

In most cases, this will save a lot of space since it's a per-elt
array which isn't normally close to being full.  It also allows us to
increase SYNTH_FIELD_MAX without worrying about even more wastage when
we do that.

Link: https://lkml.kernel.org/r/d52ae0ad5e1b59af7c4f54faf3fc098461fd82b3.camel@kernel.org
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c