From: Mikael Pettersson <mikpe@csd.uu.se>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][1/7] perfctr-2.7.2 for 2.6.6-mm2: core
Date: Sat, 15 May 2004 16:40:31 +0200 (MEST) [thread overview]
Message-ID: <200405151440.i4FEeVR1001369@harpo.it.uu.se> (raw)
On Fri, 14 May 2004 15:59:07 -0700, Andrew Morton wrote:
>Mikael Pettersson <mikpe@csd.uu.se> wrote:
>>
>> - core driver files and kernel changes
>
>Looks like we need six system calls if we're going to do it that way.
>
>All that marshalling and unmarshalling code is a bit evil. I wonder if
>there's some way in which it can be flattened out.
>
>One option would be to present all the info to userspace as a virtual
>filesystem, although it would be a bit weird that the contents of the
>"files" depends upon the process which reads them.
>
>Maybe a mkdir() on that filesystem could create a directory which contains
>files which contain the counters for the process which made the directory?
>The directory would need to be auto-rmdir'ed on process exit. It's
>basically the same semantics as /proc/pid.
The per-process perfctrs used to be accessed via /proc/pid/perfctr,
but the /proc/pid/-now-denotes-that-posixy-process-grop-thingy
change in 2.6 broke that, so I went away from /proc/pid/ last year.
The per-process perfctrs would need their own file system mount point,
with files or directories named by actual kernel task id. readdir()
won't be fun to implement. The top-level access point can certainly
be in a special fs, the question is whether I must go further and
do that also for the individual control data fields?
The global-mode perfctrs could be accessed via /dev/cpu/$cpu/gperfctr
for per-cpu operations, and /dev/cpu/gperfctr/$file for global
operations (like start and stop). However, global-mode perfctrs
are considerably less important than per-process perfctrs, and
I'd rather remove them until the per-process stuff is done.
>But /proc/pid can be read by processes other than "pid". Does the same
>apply to the perfcntr instrumentation? (Being able to read another
>process's perfcntr info sounds useful. Is it?)
Yes, perfctr does allow "remote access". It's used to
implement monitor-other-processes like tools.
/Mikael
next reply other threads:[~2004-05-15 14:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-15 14:40 Mikael Pettersson [this message]
2004-05-16 5:39 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2004-05-16 11:52 Mikael Pettersson
2004-05-15 14:39 Mikael Pettersson
2004-05-14 14:09 Mikael Pettersson
2004-05-14 14:40 ` Christoph Hellwig
2004-05-14 22:59 ` Andrew Morton
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=200405151440.i4FEeVR1001369@harpo.it.uu.se \
--to=mikpe@csd.uu.se \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®