All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Donnefort <vdonnefort@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 3/3] kbuffer: Update kbuf->next in kbuffer_refresh()
Date: Mon, 8 Jan 2024 16:47:23 +0000	[thread overview]
Message-ID: <ZZwnG9foWd7H4vfa@google.com> (raw)
In-Reply-To: <20240108112853.2574015e@gandalf.local.home>

On Mon, Jan 08, 2024 at 11:28:53AM -0500, Steven Rostedt wrote:
> On Mon, 8 Jan 2024 11:11:29 +0000
> Vincent Donnefort <vdonnefort@google.com> wrote:
> 
> > Yeah it seems that the update_pointers() is not enough. 
> > 
> > kbuffer_next_event(kbuf, NULL) will make sure curr is also up to date and will
> > do the update until an event type we can read. With that change I don't see any
> > spurious "mmiotrace_rw" on the output.
> 
> 
> Ah you're right. Try this.
> 
> -- Steve
> 
> diff --git a/src/kbuffer-parse.c b/src/kbuffer-parse.c
> index 1e1d168..5651797 100644
> --- a/src/kbuffer-parse.c
> +++ b/src/kbuffer-parse.c
> @@ -180,6 +180,7 @@ static int calc_index(struct kbuffer *kbuf, void *ptr)
>  	return (unsigned long)ptr - (unsigned long)kbuf->data;
>  }
>  
> +static int next_event(struct kbuffer *kbuf);
>  static int __next_event(struct kbuffer *kbuf);
>  
>  /*
> @@ -323,12 +324,8 @@ int kbuffer_refresh(struct kbuffer *kbuf)
>  	kbuf->size = (unsigned int)flags & COMMIT_MASK;
>  
>  	/* Update next to be the next element */
> -	if (kbuf->size != old_size && kbuf->curr == old_size) {
> -		if (kbuf->flags & KBUFFER_FL_OLD_FORMAT)
> -			old_update_pointers(kbuf);
> -		else
> -			update_pointers(kbuf);
> -	}
> +	if (kbuf->size != old_size && kbuf->curr == kbuf->next)
> +		next_event(kbuf);
>  
>  	return 0;
>  }

That worked!

      reply	other threads:[~2024-01-08 16:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 19:37 [PATCH 0/3] kbuffer: Some minor fixes Steven Rostedt
2024-01-05 19:37 ` [PATCH 1/3] libtraceevent Documentation: Fix tep_kbuffer() prototype Steven Rostedt
2024-01-05 19:37 ` [PATCH 2/3] kbuffer: Add event if the buffer just fits in kbuffer_read_buffer() Steven Rostedt
2024-01-05 19:37 ` [PATCH 3/3] kbuffer: Update kbuf->next in kbuffer_refresh() Steven Rostedt
2024-01-05 21:01   ` Vincent Donnefort
2024-01-08 11:11     ` Vincent Donnefort
2024-01-08 16:28       ` Steven Rostedt
2024-01-08 16:47         ` Vincent Donnefort [this message]

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=ZZwnG9foWd7H4vfa@google.com \
    --to=vdonnefort@google.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.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 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.