libtracefs: New API for clearing filters
cover libtracefs: New API for clearing filters
This patch applys on tom of the 'New tracefs APIs' patch-set.
Yordan Karadzhov (VMware) (1):
libtracefs: New API for clearing filter on event
Documentation/libtracefs-filter.txt | 7 ++++++- include/tracefs.h | 2 ++ src/tracefs-filter.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-)
Signature · 1 line
2.32.0
PATCH 1/1 libtracefs: New API for clearing filter on event
There is no API for clearing filter from event. After adding an API that applys a filter we must provide an identical API for clearing the filter.
--- Documentation/libtracefs-filter.txt | 7 ++++++- include/tracefs.h | 2 ++ src/tracefs-filter.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-)
Documentation/libtracefs-filter.txt +6 -1
@@ -3,7 +3,7 @@ libtracefs(3) NAME ---- -tracefs_event_append_filter, tracefs_event_verify_filter tracefs_event_apply_filter - +tracefs_event_append_filter, tracefs_event_verify_filter tracefs_event_apply_filter tracefs_event_clear_filter - Add, verify and apply event filters SYNOPSIS
@@ -17,6 +17,7 @@ int tracefs_event_append_filter(struct tep_event pass:[*]event, char pass:[**] f enum tracefs_synth_compare compare, const char pass:[*]val); int tracefs_event_verify_filter(struct tep_event pass:[*]event, const char pass:[*]filter, char pass:[**]err); int tracefs_event_apply_filter(struct tracefs_instance pass:[*]instance, struct tep_event pass:[*]event, const char pass:[*]filter); +int tracefs_event_clear_filter(struct tracefs_instance pass:[*]instance, struct tep_event pass:[*]event); --
@@ -70,6 +71,8 @@ with *free*(). *tracefs_event_apply_filter*() applies given _filter_ string on _event_ in given _instance_. +*tracefs_event_clear_filter*() clear all filters on _event_ in given _instance_. + RETURN VALUE ------------ *tracefs_event_append_filter*() returns 0 on success and -1 on error.
@@ -81,6 +84,8 @@ freed with *free*(). *tracefs_event_apply_filter*() returns 0 on success and -1 on error. +*tracefs_event_clear_filter*() returns 0 on success and -1 on error. + EXAMPLE ------- [source,c]
include/tracefs.h +2 -0
@@ -477,6 +477,8 @@ int tracefs_event_verify_filter(struct tep_event *event, const char *filter, char **err);int tracefs_event_apply_filter (struct tracefs_instance *instance,struct tep_event *event,const char *filter); +int tracefs_event_clear_filter (struct tracefs_instance *instance, +struct tep_event *event);#define TRACEFS_TIMESTAMP "common_timestamp"
src/tracefs-filter.c +14 -0
@@ -764,3 +764,17 @@ int tracefs_event_apply_filter(struct tracefs_instance *instance, "filter", filter); } +/** +* tracefs_event_clear_filter - clear the filter on event in given instance +* @instance: The instance in which the filter will be applied (NULL for toplevel). +* @event: The event to clear the filter on. +* +* Returns 0 on succes and -1 on error. +*/ +int tracefs_event_clear_filter (struct tracefs_instance *instance, +struct tep_event *event) +{ +return tracefs_event_file_write (instance, event->system, event->name, +"filter" ,"0" ); +} +
Signature · 1 line
2.32.0
Re: [PATCH 1/1] libtracefs: New API for clearing filter on event
Documentation/libtracefs-filter.txt freed with *free*(). · line 88
Quoted 6 lines · On Tue, 30 Nov 2021 16:34:22 +0200 "Yordan Karadzhov (VMware)"…
Documentation/libtracefs-filter.txt +2
-0@@ -81,6 +84,8 @@ freed with *free*(). *tracefs_event_apply_filter*() returns 0 on success and -1 on error. +*tracefs_event_clear_filter*() returns 0 on success and -1 on error. +
I just applied Tzvetomir's patches, and he renamed the function to:
tracefs_event_filter_apply()
Can you resubmit a rebased version of this patch and rename he function to:
tracefs_event_filter_clear()
Thanks,
-- Steve
Quoted 1 line · On Tue, 30 Nov 2021 16:34:21 +0200 "Yordan Karadzhov (VMware)"…
This patch applys on tom of the 'New tracefs APIs' patch-set.
Please post a link to the patches that this series applies on top of. Subject names are not precise (harder to find).
-- Steve
Quoted 8 lines · Steven Rostedt
Quoted 1 line · On Tue, 30 Nov 2021 16:34:21 +0200 "Yordan Karadzhov (VMware)"…
This patch applys on tom of the 'New tracefs APIs' patch-set.
Please post a link to the patches that this series applies on top of. Subject names are not precise (harder to find).
Here is the link:
https://patchwork.kernel.org/project/linux-trace-devel/list/?series=587537
thanks!
Y.
Quoted 2 lines
-- Steve