public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 1/3] ring-buffer: add counters for commit overrun and nmi dropped entries
Date: Thu, 30 Apr 2009 20:00:34 -0700	[thread overview]
Message-ID: <20090430200034.fb794702.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090501022400.894326175@goodmis.org>

On Thu, 30 Apr 2009 22:22:11 -0400 Steven Rostedt <rostedt@goodmis.org> wrote:

> +unsigned long ring_buffer_nmi_dropped_cpu(struct ring_buffer *buffer, int cpu)
> +{
> +	struct ring_buffer_per_cpu *cpu_buffer;
> +	unsigned long ret;
> +
> +	if (!cpumask_test_cpu(cpu, buffer->cpumask))
> +		return 0;
> +
> +	cpu_buffer = buffer->buffers[cpu];
> +	ret = cpu_buffer->nmi_dropped;
> +
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(ring_buffer_nmi_dropped_cpu);
> +
> +/**
> + * ring_buffer_commit_overrun_cpu - get the number of overruns caused by commits
> + * @buffer: The ring buffer
> + * @cpu: The per CPU buffer to get the number of overruns from
> + */
> +unsigned long
> +ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu)
> +{
> +	struct ring_buffer_per_cpu *cpu_buffer;
> +	unsigned long ret;
> +
> +	if (!cpumask_test_cpu(cpu, buffer->cpumask))
> +		return 0;
> +
> +	cpu_buffer = buffer->buffers[cpu];
> +	ret = cpu_buffer->commit_overrun;
> +
> +	return ret;
> +}

hm.  Four functions in a row, all of which differ in but a single line.

unsigned long
ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu)
{
	return some_common_function(buffer, cpu)->commit_overrun;
}

?


  reply	other threads:[~2009-05-01  3:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-01  2:22 [PATCH 0/3] [GIT PULL] tracing/ringbuffer: updates for tip Steven Rostedt
2009-05-01  2:22 ` [PATCH 1/3] ring-buffer: add counters for commit overrun and nmi dropped entries Steven Rostedt
2009-05-01  3:00   ` Andrew Morton [this message]
2009-05-01  3:11     ` Steven Rostedt
2009-05-01  3:22       ` Andrew Morton
2009-05-01  3:33         ` Steven Rostedt
2009-05-01  3:38           ` Andrew Morton
2009-05-01  3:55             ` Steven Rostedt
2009-05-01  2:22 ` [PATCH 2/3] tracing: export stats of ring buffers to userspace Steven Rostedt
2009-05-01  3:08   ` Frederic Weisbecker
2009-05-01  3:23     ` Steven Rostedt
2009-05-01 12:43       ` Frederic Weisbecker
2009-05-01  2:22 ` [PATCH 3/3] ring-buffer: make cpu buffer entries counter atomic Steven Rostedt
2009-05-01  3:06   ` Andrew Morton
2009-05-01  3:28     ` Steven Rostedt
2009-05-01 11:50   ` Ingo Molnar
2009-05-01 13:42     ` Frederic Weisbecker
2009-05-01 14:28       ` Steven Rostedt
2009-05-01 22:10         ` Frederic Weisbecker
2009-05-01 14:23     ` Steven Rostedt
2009-05-01 16:14       ` Steven Rostedt
2009-05-01 16:20         ` Ingo Molnar
2009-05-01 16:31           ` Steven Rostedt
2009-05-01 16:32             ` Steven Rostedt
2009-05-01 16:52             ` Ingo Molnar
2009-05-01 17:11               ` Steven Rostedt
2009-05-01 17:14                 ` Ingo Molnar
2009-05-01 17:36                   ` Steven Rostedt
2009-05-01 17:42                     ` Ingo Molnar
2009-05-01 17:56                       ` Steven Rostedt
2009-05-01 21:17                         ` 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=20090430200034.fb794702.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox