Message ID | 20220214080241.634290-1-tz.stoyanov@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | e75c5ced5fefdc6dbab8e17ccd0d2e94d753267a |
Headers | show |
Series | libtracefs: Add define for ALL dynamic events | expand |
On Mon, 14 Feb 2022 10:02:41 +0200 "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote: > 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. > > Suggested-by: Steven Rostedt <rostedt@goodmis.org> > Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> 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
diff --git a/include/tracefs.h b/include/tracefs.h index 1848ad0..b3694cb 100644 --- a/include/tracefs.h +++ b/include/tracefs.h @@ -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);
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. Suggested-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- include/tracefs.h | 2 ++ 1 file changed, 2 insertions(+)