All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: <linux-trace-devel@vger.kernel.org>
Cc: Sameeruddin shaik <sameeruddin.shaik8@gmail.com>,
	"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
	Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Subject: [PATCH v2 1/5] libtracefs: Close filter file descriptor on freeing of instance
Date: Thu, 8 Apr 2021 09:34:27 -0400	[thread overview]
Message-ID: <20210408133431.2023697-2-rostedt@goodmis.org> (raw)
In-Reply-To: <20210408133431.2023697-1-rostedt@goodmis.org>

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

If the instance ftrace_filter_fd is open on freeing of the instance, close
it.

Link: https://lore.kernel.org/linux-trace-devel/20210408085340.5e84064f@gandalf.local.home/

Suggested-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 src/tracefs-instance.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/tracefs-instance.c b/src/tracefs-instance.c
index bf2fabf..e222191 100644
--- a/src/tracefs-instance.c
+++ b/src/tracefs-instance.c
@@ -66,6 +66,10 @@ void tracefs_instance_free(struct tracefs_instance *instance)
 {
 	if (!instance)
 		return;
+
+	if (instance->ftrace_filter_fd >= 0)
+		close(instance->ftrace_filter_fd);
+
 	free(instance->trace_dir);
 	free(instance->name);
 	free(instance);
-- 
2.29.2


  reply	other threads:[~2021-04-08 13:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 13:34 [PATCH v2 0/5] libtracefs: Update filtering functions Steven Rostedt
2021-04-08 13:34 ` Steven Rostedt [this message]
2021-04-08 13:34 ` [PATCH v2 2/5] libtracefs: Close the filter file descriptor on exec() Steven Rostedt
2021-04-08 13:34 ` [PATCH v2 3/5] libtracefs: Move most functionality into helper function for tracefs_function_filter() Steven Rostedt
2021-04-08 13:34 ` [PATCH v2 4/5] libtracefs: Add tracefs_function_notrace() API Steven Rostedt
2021-04-08 13:34 ` [PATCH v2 5/5] libtracefs: Add a pthread_mutex per instance Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408133431.2023697-2-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=sameeruddin.shaik8@gmail.com \
    --cc=tz.stoyanov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.