diff mbox series

[2/6] libtraceeval hist: Add pointer and const string types

Message ID 20230809031313.1298605-3-rostedt@goodmis.org (mailing list archive)
State Superseded
Headers show
Series libtraceeval histogram: Updates | expand

Commit Message

Steven Rostedt Aug. 9, 2023, 3:13 a.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

Add a pointer type to traceeval_data, as this can be used as a generic
pointer type. This may even obsolete the dynamic type.

Also, add a const char * "cstring" type. There's times where the key and
value data needs to be assigned to a const char *string, and without
having an option of that type, the compiler complains about losing the
const.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 include/traceeval-hist.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/include/traceeval-hist.h b/include/traceeval-hist.h
index e713c70e3fa3..03e050cdbed4 100644
--- a/include/traceeval-hist.h
+++ b/include/traceeval-hist.h
@@ -25,6 +25,7 @@  enum traceeval_data_type {
 	TRACEEVAL_TYPE_NUMBER_16,
 	TRACEEVAL_TYPE_NUMBER_8,
 	TRACEEVAL_TYPE_NUMBER,
+	TRACEEVAL_TYPE_POINTER,
 	TRACEEVAL_TYPE_STRING,
 	TRACEEVAL_TYPE_DYNAMIC
 };
@@ -41,7 +42,9 @@  enum traceeval_flags {
  */
 union traceeval_data {
 	char				*string;
+	const char			*cstring;
 	struct traceeval_dynamic	*dyn_data;
+	void				*pointer;
 	unsigned long long		number_64;
 	unsigned long			number;
 	unsigned int			number_32;