public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>
Subject: [for-next][PATCH 2/4] ring-buffer: Use rb_page_size() instead of open coded head_page size
Date: Fri, 25 Jul 2014 10:05:16 -0400	[thread overview]
Message-ID: <20140725140612.648009076@goodmis.org> (raw)
In-Reply-To: 20140725140514.377803118@goodmis.org

[-- Attachment #1: 0002-ring-buffer-Use-rb_page_size-instead-of-open-coded-h.patch --]
[-- Type: text/plain, Size: 840 bytes --]

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

There's a helper function to get a ring buffer page size (the number
of bytes of data recorded on the page), called rb_page_size().
Use that instead of open coding it.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ring_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 35825a87d6a3..d8c267ec5cca 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -3763,7 +3763,7 @@ rb_iter_peek(struct ring_buffer_iter *iter, u64 *ts)
 	if (rb_per_cpu_empty(cpu_buffer))
 		return NULL;
 
-	if (iter->head >= local_read(&iter->head_page->page->commit)) {
+	if (iter->head >= rb_page_size(iter->head_page)) {
 		rb_inc_iter(iter);
 		goto again;
 	}
-- 
2.0.1



  parent reply	other threads:[~2014-07-25 14:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 14:05 [for-next][PATCH 0/4] ftrace: Fix the tramp count accounting Steven Rostedt
2014-07-25 14:05 ` [for-next][PATCH 1/4] ftrace: Rename ftrace_ops field from trampolines to nr_trampolines Steven Rostedt
2014-07-25 14:05 ` Steven Rostedt [this message]
2014-07-25 14:05 ` [for-next][PATCH 3/4] ftrace: Fix trampoline hash update check on rec->flags Steven Rostedt
2014-07-25 14:05 ` [for-next][PATCH 4/4] ftrace: Add warning if tramp hash does not match nr_trampolines 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=20140725140612.648009076@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@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