Skip to content

libtracefs: Make hist variable names unique

Steven Rostedt linux-trace-devel lkml 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- 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.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libtracefs: Add random number to keep synthetic variables uniquesrc/tracefs-hist.c+22 -10 replies
2/2libtracefs: Have end event variables not be the end event field namesrc/tracefs-hist.c+13 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] libtracefs: Make hist variable names unique

From: "Steven Rostedt (VMware)" <[email protected]>

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(-)
Signature · 1 line
2.30.2