libtracefs: Add random number to keep synthetic variables unique

The 'hist' triggers expect that all variables are unique. If two synthetic
events are created, it is possible that they will use the same variable
names, and this can break the logic for synthetic events. Add a random
number to the argument names that will help prevent that from happening.
There's no guarantee that there wont be collisions, but the chances of
that happening is 1 in 32768. If this is a problem, we could possibly look
for variables that are already in use.

Link: https://lore.kernel.org/linux-trace-devel/20210812005546.910833-2-rostedt@goodmis.org/
Link: https://lkml.kernel.org/r/20210812155029.929048-2-rostedt@goodmis.org

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 file changed