tracing: Save normal string variables
authorTom Zanussi <zanussi@kernel.org>
Sun, 4 Oct 2020 22:14:05 +0000 (17:14 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 5 Oct 2020 22:13:53 +0000 (18:13 -0400)
commit63a1e5de3006f4ad713e4d72bcb404d0301e853d
treefe0dec10d6587290bff659d685f5c1f737fd0f03
parent8fbeb52a598c7ab5aa603d6bb083b8a8d16d607a
tracing: Save normal string variables

String variables created as field variables and save variables are
already handled properly by having their values copied when set.  The
same isn't done for normal variables, but needs to be - simply saving
a pointer to a string contained in an old event isn't sufficient,
since that event's data may quickly become overwritten and therefore a
string pointer to it could yield garbage.

This change uses the same mechanism as field variables and simply
appends the new strings to the existing per-element field_var_str[]
array allocated for that purpose.

Link: https://lkml.kernel.org/r/1c1a03798b02e67307412a0c719d1bfb69b13007.1601848695.git.zanussi@kernel.org
Fixes: 02205a6752f2 (tracing: Add support for 'field variables')
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c