public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@gmail.com>
To: Lukas Beckmann <lbckmnn@mailbox.org>
Cc: John Kacur <jkacur@redhat.com>,
	rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH 1/2] cyclictest: fix growing shm stat file
Date: Mon, 9 Mar 2026 18:54:01 -0400 (EDT)	[thread overview]
Message-ID: <5356ca11-53fd-656b-d934-cf91dfb44e39@gmail.com> (raw)
In-Reply-To: <20260301212407.3146506-2-lbckmnn@mailbox.org>



On Sun, 1 Mar 2026, Lukas Beckmann wrote:

> On a received USR2 signal, the current statistics are written to a file
> in shared memory. Before that happens, it is truncated to zero to clear
> it.
> 
> However, currently the shm file keeps growing with each received signal
> because the seek pointer is not updated by ftruncate.
> 
> This is fixed by calling fseek after truncating.
> 
> Signed-off-by: Lukas Beckmann <lbckmnn@mailbox.org>
> ---
>  src/cyclictest/cyclictest.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 191945e..960c905 100644
> --- a/src/cyclictest/cyclictest.c
> +++ b/src/cyclictest/cyclictest.c
> @@ -1472,6 +1472,7 @@ static void sighand(int sig)
>  			return;
>  		}
>  		rstat_ftruncate(rstat_fd, 0);
> +		lseek(rstat_fd, 0, SEEK_SET);
>  		quiet = 0;
>  		dprintf(rstat_fd, "#---------------------------\n");
>  		dprintf(rstat_fd, "# cyclictest current status:\n");
> -- 
> 2.53.0
> 
> 
> 
Signed-off-by: John Kacur <jkacur@redhat.com>

  reply	other threads:[~2026-03-09 22:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-01 21:24 [PATCH 0/2] cyclictest: fix growing shm stat file Lukas Beckmann
2026-03-01 21:24 ` [PATCH 1/2] " Lukas Beckmann
2026-03-09 22:54   ` John Kacur [this message]
2026-03-01 21:24 ` [PATCH 2/2] cyclictest: simplify rstat_setup Lukas Beckmann
2026-03-09 22:55   ` John Kacur
2026-03-10 13:30     ` Crystal Wood
2026-03-10 16:18       ` John Kacur
2026-03-10 16:57         ` Crystal Wood

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=5356ca11-53fd-656b-d934-cf91dfb44e39@gmail.com \
    --to=jkacur@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=lbckmnn@mailbox.org \
    --cc=linux-rt-users@vger.kernel.org \
    /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