Re: 2.6.7-rc2-mm1

Mikael Pettersson
2004-06-01T13:44:16Z

Christoph Hellwig writes:
> > - merged perfctr. No documentation though :(
>
> +/* tid is the actual task/thread id (népid, stored as ->pid),
> + pid/tgid is that 2.6 thread group id crap (stored as ->tgid) */
> +asmlinkage long sys_vperfctr_open(int tid, int creat)
> +{
> + struct file *filp;
> + struct task_struct *tsk;
> + struct vperfctr *perfctr;
> + int err;
> + int fd;
> +
> + if (!vperfctr_fs_init_done())
> + return -ENODEV;
> + filp = vperfctr_get_filp();
> + if (!filp)
> + return -ENOMEM;
> + err = fd = get_unused_fd();
>
> This really, really screams "I want to be a special file", so the interface
> still doesn't look okay. Probably in /proc/pid.

Been there, done that. open() on /proc/{$pid,self}/perfctr with
or without O_CREAT was the "get initial access" interface for
several years, until the semantics of /proc/$pid (and /proc/self)
completely changed in 2.6.0-test6.

Virtual perfctrs wants something that denotes the real kernel
task, not that process-is-a-group-of-kernel-threads crap.

/Mikael