linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] libtracefs: Make hist variable names unique
@ 2021-08-12 15:50 Steven Rostedt
  2021-08-12 15:50 ` [PATCH v2 1/2] libtracefs: Add random number to keep synthetic variables unique Steven Rostedt
  2021-08-12 15:50 ` [PATCH v2 2/2] libtracefs: Have end event variables not be the end event field name Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2021-08-12 15:50 UTC (permalink / raw)
  To: linux-trace-devel
  Cc: linux-kernel, Tom Zanussi, Daniel Bristot de Oliveira,
	Masami Hiramatsu, Steven Rostedt (VMware)

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

In order to be able to have API that can do onmax() and onchange() as well
as include the .save() and .snapshot() actions, we need to make sure that
the variable names are unique even between different events.

The first adds a "randomness" to the name, and the second patch fixes an
issue where the "end" event fields are saved in the same name as they are
called, then the ".save" action can not be used on them.

Changes since v1:

 - Use open coded "rand()" as rand() is not reentrant, and it we use our own
   seed each time.

 - Use gettimeofday() instead of time() as Yordan pointed out that time()
   has a resolution of 1 second, and a thread could call this for different
   synthetic events.


Steven Rostedt (VMware) (2):
  libtracefs: Add random number to keep synthetic variables unique
  libtracefs: Have end event variables not be the end event field name

 src/tracefs-hist.c | 45 +++++++++++++++++++++++++++++++++++----------
 1 file changed, 35 insertions(+), 10 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-12 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-12 15:50 [PATCH v2 0/2] libtracefs: Make hist variable names unique Steven Rostedt
2021-08-12 15:50 ` [PATCH v2 1/2] libtracefs: Add random number to keep synthetic variables unique Steven Rostedt
2021-08-12 15:50 ` [PATCH v2 2/2] libtracefs: Have end event variables not be the end event field name Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).