Skip to contentSkip to conversation

libtraceeval: Remove TIMESTAMP and STAT flags from API

PATCH New Steven Rostedt 1 participant 1 message Oct 12, 2023 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtraceeval: Remove TIMESTAMP and STAT flags from API

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

The TRACEEVAL_TYPE_DELTA can be used to keep track of numbers that require maximum, minimum, count, total, average and stand deviation. This is easier to use than to create a separate TRACEEVAL_FL_TIMESTAMP to keep track of the time associated with a value that has a STAT flag.

Note, the logic is only removed from the API, that is, the traceeval_flags no longer have them. They are now replied with:

TRACEEVAL_FL_RESERVE_3
TRACEEVAL_FL_RESERVE_4

The logic in the code still keeps it around in case we discover that there's use cases where the TRACEEVAL_TYPE_DELTA does not suffice. But we also have the option of simply removing it too.

The man pages have been updated to remove any mention of these flags, and to use TRACEEVAL_TYPE_DELTA.

Also, added man pages for:

traceeval_stat_average()
traceeval_stat_stddev()

---
 Documentation/libtraceeval-init.txt |  2 -
 Documentation/libtraceeval-stat.txt | 73 ++++++++++++++++++++++-------
 Documentation/libtraceeval.txt      |  2 +
 include/traceeval.h                 |  4 +-
 src/eval-local.h                    |  4 ++
 5 files changed, 64 insertions(+), 21 deletions(-)
Documentation/libtraceeval-init.txt +0 -2
index 71251f2cc8ff..1c09cee319c8 100644
@@ -128,8 +128,6 @@ enum traceeval_flags {
 	TRACEEVAL_FL_KEY		= (1 << 0),
 	TRACEEVAL_FL_VALUE		= (1 << 1),
 	TRACEEVAL_FL_SIGNED		= (1 << 2),
-	TRACEEVAL_FL_TIMESTAMP		= (1 << 3),
-	TRACEEVAL_FL_STAT		= (1 << 4),
 };
 --
 
Documentation/libtraceeval-stat.txt +56 -17

104 lines not on this page · raw message

Documentation/libtraceeval.txt +2 -0
index 173b1ddb3df8..e65ebd270445 100644
@@ -74,6 +74,8 @@ Functions to manage statistics of values of a traceeval:
 	unsigned long long *traceeval_stat_min_timestamp*(struct traceeval_stat pass:[*]_stat_, unsigned long long pass:[*]ts);
 	unsigned long long *traceeval_stat_total*(struct traceeval_stat pass:[*]_stat_);
 	unsigned long long *traceeval_stat_count*(struct traceeval_stat pass:[*]_stat_);
+	unsigned long long *traceeval_stat_average*(struct traceeval_stat pass:[*]_stat_);
+	double *traceeval_stat_stddev*(struct traceeval_stat pass:[*]_stat_);
 --
 
 DESCRIPTION
include/traceeval.h +2 -2
index 58c220c0f81c..99b3f7b86915 100644
@@ -59,8 +59,8 @@ enum traceeval_flags {
 	TRACEEVAL_FL_KEY		= (1 << 0),
 	TRACEEVAL_FL_VALUE		= (1 << 1),
 	TRACEEVAL_FL_SIGNED		= (1 << 2),
-	TRACEEVAL_FL_TIMESTAMP		= (1 << 3),
-	TRACEEVAL_FL_STAT		= (1 << 4),
+	TRACEEVAL_FL_RESERVE_3		= (1 << 3),
+	TRACEEVAL_FL_RESERVE_4		= (1 << 4),
 };
 
 enum traceeval_log_level {
src/eval-local.h +4 -0
index 9f387e500efa..4f5f702434f1 100644
@@ -4,6 +4,10 @@
 
 #include <string.h>
 
+/* For possible future use */
+#define TRACEEVAL_FL_TIMESTAMP	TRACEEVAL_FL_RESERVE_3
+#define TRACEEVAL_FL_STAT	TRACEEVAL_FL_RESERVE_4
+
 #define __hidden __attribute__((visibility ("hidden")))
 #define __weak __attribute__((weak))
 
Signature · 1 line
2.42.0