linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] libtraceeval: Remove the need of TRACEEVAL_TYPE_NONE
@ 2023-10-03 14:08 Steven Rostedt
  2023-10-03 14:08 ` [PATCH v2 1/2] libtraceeval: Remove need to use TRACEEVAL_TYPE_NONE in keys and vals Steven Rostedt
  2023-10-03 14:08 ` [PATCH v2 2/2] libtraceeval samples: Remove adding TRACEEVAL_TYPE_NONE to " Steven Rostedt
  0 siblings, 2 replies; 6+ messages in thread
From: Steven Rostedt @ 2023-10-03 14:08 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Ross Zwisler, Stevie Alvarez, Steven Rostedt (Google)

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

The use of macros to determine the size of the keys and vals arrays made
me think a bit more about how we initialize the traceeval. The more I'm
using the library, the less I like having to add the TRACEEVAL_TYPE_NONE
to the end of the keys and vals array.

Instead, use the same macro trick of TRACEEVAL_ARRAY_SIZE() to determine
the number of elements. Still allow the use of using the
TRACEEVAL_TYPE_NONE to determine the size (if the number passed in is
still bigger), so that most applications that still use that still work.

I made the change separate than updating the sample code to test that
the old way still works. Then I updated the sample to make sure the new
way works. Perhaps when we add unit tests back in, we'll test both
cases.

Changes since v1: https://lore.kernel.org/linux-trace-devel/20230929100025.1018258-1-rostedt@goodmis.org/

 - Added size checks to check_keys() and check_vals() (Ross Zwisler)

Steven Rostedt (Google) (2):
  libtraceeval: Remove need to use TRACEEVAL_TYPE_NONE in keys and vals
  libtraceeval samples: Remove adding TRACEEVAL_TYPE_NONE to keys and
    vals

 include/traceeval-hist.h | 11 +++++++++--
 samples/task-eval.c      | 18 ------------------
 src/histograms.c         | 23 +++++++++++++----------
 3 files changed, 22 insertions(+), 30 deletions(-)

-- 
2.40.1


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

end of thread, other threads:[~2023-10-03 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-03 14:08 [PATCH v2 0/2] libtraceeval: Remove the need of TRACEEVAL_TYPE_NONE Steven Rostedt
2023-10-03 14:08 ` [PATCH v2 1/2] libtraceeval: Remove need to use TRACEEVAL_TYPE_NONE in keys and vals Steven Rostedt
2023-10-03 15:39   ` Ross Zwisler
2023-10-03 15:44     ` Steven Rostedt
2023-10-03 14:08 ` [PATCH v2 2/2] libtraceeval samples: Remove adding TRACEEVAL_TYPE_NONE to " Steven Rostedt
2023-10-03 15:39   ` Ross Zwisler

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