Skip to contentSkip to conversation

libtracefs: Add define for ALL dynamic events

PATCH In review Tzvetomir Stoyanov (VMware) 2 participants 2 messages Feb 14, 2022 – Feb 24, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Add define for ALL dynamic events

Some of the tracefs APIs for dynamic events accept bitmask of events. If a caller wants to address all types of events, it should list them in the bitmask. This logic is fragile. When a new type of dynamic event is introduced, the API callers should be modified. That's why a new define is added, part of the library API, to address all types of dynamic events.

---
 include/tracefs.h | 2 ++
 1 file changed, 2 insertions(+)
include/tracefs.h +2 -0
index 1848ad0..b3694cb 100644
@@ -261,6 +261,8 @@ enum tracefs_dynevent_type {
 	TRACEFS_DYNEVENT_MAX		= 1 << 6,
 };
 
+#define TRACEFS_DYNEVENT_ALL		0xFFFFFFFF
+
 int tracefs_dynevent_create(struct tracefs_dynevent *devent);
 int tracefs_dynevent_destroy(struct tracefs_dynevent *devent, bool force);
 int tracefs_dynevent_destroy_all(unsigned int types, bool force);
Signature · 1 line
2.34.1
#1 lore raw
Quoted 9 lines · On Mon, 14 Feb 2022 10:02:41 +0200 "Tzvetomir Stoyanov (VMware)"…

Some of the tracefs APIs for dynamic events accept bitmask of events. If a caller wants to address all types of events, it should list them in the bitmask. This logic is fragile. When a new type of dynamic event is introduced, the API callers should be modified. That's why a new define is added, part of the library API, to address all types of dynamic events.

And of course, after I release 1.3, I discovered I forgot about this patch :-p

Well, it's usually a tradition to release a .1 right after a .0 due to something stupid I did :-/

-- Steve