public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH -v2 0/4] Persistent events
Date: Fri, 17 Aug 2012 09:38:15 +0200	[thread overview]
Message-ID: <20120817073815.GA21017@aftab.osrc.amd.com> (raw)
In-Reply-To: <1345154418.3708.13.camel@gandalf.local.home>

On Thu, Aug 16, 2012 at 06:00:18PM -0400, Steven Rostedt wrote:
> Do these need to be mmapped, or are they copied into another location
> (disk or network)? I had code to allow the ftrace ring buffers to be
> mmapped, but stopped that work a while ago.

Well, my angle here is that since those are persistent, i.e. always-on
events, they should be as low overhead as possible. So mmaping the
buffer is probably that since it doesn't involve any data shuffling to
and fro...

> > > I'm currently working on having perf read ftrace data, so in the near
> > > future, I plan on having some RFC patches to have perf reading from
> > > this buffer anyway.
> > 
> > Are you saying the ftrace buffer would be mmappable too now?
> 
> No, the ftrace buffer was optimized for the splice command.

Ah, the splice thing moving data between two fds.

> I would have perf do what trace-cmd does. That is, write directly into
> a file as it reads it, without ever needing the info to come into
> userspace.

Is that a real file?

Because what I was doing in the RAS daemon is mmap the buffer, read out
the logged events in userspace and work on them.

Having them go to a file which I need to open in userspace adds one more
step and I don't know how that would pan out in a critical situation of
you getting a machine check where every insn counts. And besides, in a
MCE situation you cannot be sure that the events would actually go to
file... So my current impression is that reading them direct from memory
is the fastest we can do. But this is only me and I have been wrong in
the past. Lotsa times :).

> I wasn't planning on replacing perf buffers, I was just planning on
> giving perf a tracing boost.

Cool.

> Another alternative, which would be a bit slower, would be to copy the
> pages, either into userspace (as a read) or into a location to mmap the
> buffers.

Yeah, copying is not a good idea, IMHO, due to the said above.

> I could also continue the work on allowing ftrace buffers to be
> mmapped. But if the best thing to do is just use the perf buffers,
> then we could just stick with that.

The easiest for now, I'd say, since it is already there.

> > Btw, I wanted to hear your opinion on patch 1/4 since it touches
> > ftrace/trace_events code. Can you please look at it and tell me if its
> > ok?
> > 
> I'll take a look.

Thanks.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

  reply	other threads:[~2012-08-17  7:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 17:45 [RFC PATCH -v2 0/4] Persistent events Borislav Petkov
2012-08-16 17:45 ` [RFC PATCH -v2 1/4] trace events: Interface to add files to debugfs Borislav Petkov
2012-08-16 22:06   ` Steven Rostedt
2012-08-17  7:26     ` Borislav Petkov
2012-08-16 17:45 ` [RFC PATCH -v2 2/4] perf: Add persistent events Borislav Petkov
2012-08-16 17:45 ` [RFC PATCH -v2 3/4] perf: Add persistent event facilities Borislav Petkov
2012-08-16 22:12   ` Steven Rostedt
2012-08-17  7:27     ` Borislav Petkov
2012-12-09 12:06     ` Borislav Petkov
2012-08-21 10:08   ` Peter Zijlstra
2012-08-21 10:21   ` Peter Zijlstra
2012-08-16 17:45 ` [RFC PATCH -v2 4/4] persistent test Borislav Petkov
2012-08-16 20:12 ` [RFC PATCH -v2 0/4] Persistent events Jonathan Corbet
2012-08-16 20:55   ` Borislav Petkov
2012-08-16 21:13     ` Steven Rostedt
2012-08-16 21:41       ` Borislav Petkov
2012-08-16 22:00         ` Steven Rostedt
2012-08-17  7:38           ` Borislav Petkov [this message]
2012-08-17 15:20             ` Steven Rostedt
2012-08-17 17:06               ` Peter Zijlstra
2012-08-21 10:30 ` Peter Zijlstra
2012-08-21 13:11   ` Borislav Petkov
2012-08-21 13:41     ` Steven Rostedt
2012-08-21 13:50       ` Borislav Petkov
2012-08-21 14:03         ` 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=20120817073815.GA21017@aftab.osrc.amd.com \
    --to=bp@amd64.org \
    --cc=corbet@lwn.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox