From: John Kacur <jkacur@redhat.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-rt-users@vger.kernel.org,
Clark Williams <williams@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 06/10] rt-utils: Simplify trace_file_exists()
Date: Fri, 19 Sep 2025 14:42:23 -0400 (EDT) [thread overview]
Message-ID: <51d0d895-5eef-546f-a1b8-a9d87b7c2fd7@redhat.com> (raw)
In-Reply-To: <20250903111717.1391196-7-bigeasy@linutronix.de>
On Wed, 3 Sep 2025, Sebastian Andrzej Siewior wrote:
> Pass the tracefs folder prefix directly to stat instead making a copy of
> it. stat() is defined as not altering the path argument.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> src/lib/rt-utils.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/src/lib/rt-utils.c b/src/lib/rt-utils.c
> index 0e6e6056a4392..294fc9683a122 100644
> --- a/src/lib/rt-utils.c
> +++ b/src/lib/rt-utils.c
> @@ -408,10 +408,7 @@ static void close_tracemark_fd(void)
> static int trace_file_exists(char *name)
> {
> struct stat sbuf;
> - char *tracing_prefix = get_tracefs_prefix();
> - char path[MAX_PATH];
> - strcat(strcpy(path, tracing_prefix), name);
> - return stat(path, &sbuf) ? 0 : 1;
> + return stat(tracefs_prefix, &sbuf) ? 0 : 1;
> }
>
> static void tracefs_prepare(void)
> --
> 2.51.0
>
>
Signed-off-by: John Kacur <jkacur@redhat.com>
next prev parent reply other threads:[~2025-09-19 18:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 11:17 [PATCH 00/10] rt-tests: Remove debugfs usage Sebastian Andrzej Siewior
2025-09-03 11:17 ` [PATCH 01/10] README: Drop "debug" from the tracing path Sebastian Andrzej Siewior
2025-09-19 18:18 ` John Kacur
2025-09-03 11:17 ` [PATCH 02/10] rt-utils: Remove mount_debugfs() Sebastian Andrzej Siewior
2025-09-19 18:20 ` John Kacur
2025-09-03 11:17 ` [PATCH 03/10] rt-utils: Rename get_debugfileprefix() and let it look for tracefs Sebastian Andrzej Siewior
2025-09-19 18:29 ` John Kacur
2025-09-03 11:17 ` [PATCH 04/10] queuelat, rt-migrate-test: Use tracefs for tracing Sebastian Andrzej Siewior
2025-09-19 18:39 ` John Kacur
2025-09-03 11:17 ` [PATCH 05/10] rt-utils: Remove fileprefix Sebastian Andrzej Siewior
2025-09-19 18:41 ` John Kacur
2025-09-03 11:17 ` [PATCH 06/10] rt-utils: Simplify trace_file_exists() Sebastian Andrzej Siewior
2025-09-19 18:42 ` John Kacur [this message]
2025-09-03 11:17 ` [PATCH 07/10] rt-utils: Decouple writting trace-marks with trace stopping Sebastian Andrzej Siewior
2025-09-19 18:49 ` John Kacur
2025-09-03 11:17 ` [PATCH 08/10] sched_deadline: Use tracemark() from rt-utils instead cusstom implementation Sebastian Andrzej Siewior
2025-09-19 18:52 ` John Kacur
2025-09-03 11:17 ` [PATCH 09/10] sched_deadline: Check the resulting size returned from snprintf() Sebastian Andrzej Siewior
2025-09-19 18:54 ` John Kacur
2025-09-03 11:17 ` [PATCH 10/10] cyclicdeadline: Don't test for /sys/kernel/debug/sched_features Sebastian Andrzej Siewior
2025-09-19 18:55 ` John Kacur
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=51d0d895-5eef-546f-a1b8-a9d87b7c2fd7@redhat.com \
--to=jkacur@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=linux-rt-users@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=williams@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).