From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> Now that trace-cmd depends on libtracefs 1.2, have filter_command use the tracefs_instance_file_append() as it had originally when first added, instead of open coding it for libtracefs 1.1. Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- tracecmd/trace-record.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index 5219d60b..ba9542ff 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -4556,20 +4556,7 @@ enum filter_type { static int filter_command(struct tracefs_instance *instance, const char *cmd) { - char *path; - int ret; - int fd; - - path = tracefs_instance_get_file(instance, "set_ftrace_filter"); - if (!path) - return -1; - fd = open(path, O_WRONLY); - tracefs_put_tracing_file(path); - if (fd < 0) - return -1; - ret = write(fd, cmd, strlen(cmd)); - close(fd); - return ret; + return tracefs_instance_file_append(instance, "set_ftrace_filter", cmd); } static int write_func_filter(enum filter_type type, struct buffer_instance *instance, -- 2.29.2