On Wed, 24 Mar 2021 15:43:28 +0530 Sameeruddin Shaik <sameeruddin.shaik8@xxxxxxxxx> wrote: > > - We can have a tracefs_read_function_filter() that returns an array of > > strings which ends with a NULL pointer (and needs to be freed with > > tracefs_list_free(), and have this: > > > > save_filters = tracefs_read_function_filter(instance); > > are we going to use the tracefs_read_function_filter() function to > read the set_ftrace_file for getting written filters? Yes, why not? But it would not return probes, only filters. That is, the set_ftrace_filter also shows probes, and they are different. But the tracefs_read_function_filter() should not return them. For them, we should have a tracefs_read_function_probes() API. -- Steve > > > > ret = tracefs_function_filter(instance, filters, NULL, true, &errs); > > if (ret > 0 && errs) { > > /* Modified but failed */ > > int i, j; > > for (i = 0; filters[i]; i++) > > ; > > for (j = 0; errs[i]; j++) > > ; > > if (i == j) > > /* all filters failed! Put back the original */ > > tracefs_function_filter(instance, save_filters, NULL, false, NULL); > > }