Re: [PATCH][1/6] perfctr-2.7.3 for 2.6.7-rc1-mm1: core

From: Mikael Pettersson
Date: Tue Jun 22 2004 - 16:08:55 EST


Christoph Hellwig writes:
> On Tue, Jun 22, 2004 at 04:38:06PM +0200, Mikael Pettersson wrote:
> > Swiching to open() on /proc/<pid>/<tid>/perfctr followed by ioctl()s
> > would be easy to implement. But people @ LKML are sometimes violently
> > opposed to ioctl()s, that's why the switch to syscalls happended.
>
> I don't remember the details anymore, but lots of the syscalls could
> really be read/write on special files. I'll look through the code again
> and send out draft API document.

I've thought about this, but the FS with multiple files approach
has several problems:

1. An open file descriptor no longer suffices as a user-space handle.
This is because we don't have fd = open("%d/file",dirfd) type
system calls.

2. A mini-fs under /proc/<pid>/<tid>/perfctr/ disappears when the
process disappears. Currently, a process' perfctr state lives
as long as references remains, whether via the process task_struct,
or via some open file descriptor. One use for this is in
remote-control applications, where it avoids enforcing
parent/child relationships on monitor/target processes.

Going with a mini-fs is possible (though painful to implement), but
the remote-control feature would have to be constrained to a debugger
like model. In particular, the whole notion of using an fd as a handle
to a state object with its own lifetime would have to be ditched.

/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/