public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <rric@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <peterz@infradead.org>,
	Jiri Olsa <jolsa@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] perf tools: Persistent events, changes for perf tool integration
Date: Fri, 31 May 2013 15:44:45 +0200	[thread overview]
Message-ID: <20130531134445.GD2132@rric.localhost> (raw)
In-Reply-To: <20130531124805.GA8659@gmail.com>

> > On Fri, May 31, 2013 at 02:07:20PM +0200, Ingo Molnar wrote:
> > > For that I'd like to create a persistent event that just keeps
> > > running, and to which I can occasionally attach to read-only to see
> > > what's going on and maybe attach to it read-write to drain the trace
> > > entries. I.e. basically a global trace buffer. How do I achieve that
> > > with this new tooling?

Actually every system-wide event that is opened with readonly buffers
could be shared between processes, which would be the same as
connecting to a persistent event. I didn't want to implement this in a
first step, but I think this could be implemented without too much
effort.

The main problem is that at least one file descriptor needs to be open
at any time. Otherwise the event would be removed. So there is no
concept (except enabling an in-kernel event) yet to keep the event
running without any process having an event file discriptor open. Even
harder will it be to release such an event, there is no distincition
beetween detaching the event from the process or permanently removing
the event.

So the easiest would be to just open a system-wide event and then put
the process into sleep until we want to remove the event. In between
other processes (maybe duplicate on fork?) could attach to the same
buffer. Only if no process is attached to the event enymore the event
will be removed. Would that fit your purpose?

-Robert

  reply	other threads:[~2013-05-31 13:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31  9:16 [PATCH 0/4] perf tools: Persistent events, changes for perf tool integration Robert Richter
2013-05-31  9:16 ` [PATCH 1/4] perf tools: Rename flex conditions to avoid name conflicts Robert Richter
2013-05-31  9:16 ` [PATCH 2/4] perf tools: Modify event parser to update event attribute by index Robert Richter
2013-05-31  9:16 ` [PATCH 3/4] perf tools: Add attr<num> syntax to event parser Robert Richter
2013-06-03 13:54   ` Jiri Olsa
2013-06-07 14:17     ` Robert Richter
2013-05-31  9:16 ` [PATCH 4/4] perf tools: Retry mapping buffers readonly on EACCES Robert Richter
2013-06-14  2:08   ` Namhyung Kim
2013-06-14  7:29     ` Robert Richter
2013-05-31 12:07 ` [PATCH 0/4] perf tools: Persistent events, changes for perf tool integration Ingo Molnar
2013-05-31 12:24   ` Borislav Petkov
2013-05-31 12:48     ` Ingo Molnar
2013-05-31 13:44       ` Robert Richter [this message]
2013-05-31 15:31       ` Borislav Petkov

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=20130531134445.GD2132@rric.localhost \
    --to=rric@kernel.org \
    --cc=acme@ghostprotocols.net \
    --cc=bp@alien8.de \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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