tracing: Fix now invalid var_ref_vals assumption in trace action
authorTom Zanussi <zanussi@kernel.org>
Thu, 30 Jan 2020 02:18:18 +0000 (21:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:35:18 +0000 (04:35 -0800)
commit38b67e60b6b582e81f9db1b2e7176cbbfbd3e574
tree22342fd7dc8685898dd482d2f9aa9c074369869d
parent5b92f86c84928e9b532124bae09471c69aa54153
tracing: Fix now invalid var_ref_vals assumption in trace action

[ Upstream commit d380dcde9a07ca5de4805dee11f58a98ec0ad6ff ]

The patch 'tracing: Fix histogram code when expression has same var as
value' added code to return an existing variable reference when
creating a new variable reference, which resulted in var_ref_vals
slots being reused instead of being duplicated.

The implementation of the trace action assumes that the end of the
var_ref_vals array starting at action_data.var_ref_idx corresponds to
the values that will be assigned to the trace params. The patch
mentioned above invalidates that assumption, which means that each
param needs to explicitly specify its index into var_ref_vals.

This fix changes action_data.var_ref_idx to an array of var ref
indexes to account for that.

Link: https://lore.kernel.org/r/1580335695.6220.8.camel@kernel.org
Fixes: 8bcebc77e85f ("tracing: Fix histogram code when expression has same var as value")
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/trace_events_hist.c