lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 6 Dec 2009 12:50:40 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Paul Mackerras <paulus@...ba.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf/sched: fix for getting task's execute time


* Peter Zijlstra <peterz@...radead.org> wrote:

> On Sun, 2009-12-06 at 12:05 +0100, Peter Zijlstra wrote:
> > On Sun, 2009-12-06 at 18:57 +0800, Xiao Guangrong wrote:
> > > In current code, we get task's execute time by reading
> > > "/proc/<pid>/sched" file, it's wrong if the task is created
> > > by pthread_create(), because every thread task has same pid.
> > > So, the correct way is reading "/proc/<ppid>/task/<tid>/sched"
> > > file.
> > > 
> > > This patch also remove redundant include files since <sys/types.h>
> > > is included in "perf.h"
> > 
> > We really should not be using these proc files but instead make sure
> > this information gets transferred through a tracepoint or similar.
> > 
> > Reading these proc files is too prone to races.

yeah. Ideally we'd want all valuable information that is available via 
/proc to be available via perf events as well. In the future it should 
be possible to run perf even without /proc mounted for example.

Furthermore it's good for consistency and simplicity as well, plus it's 
faster too to get the information from the perf syscall and mmap-ed 
ringbuffer than to read things via /proc. No need for ASCII conversion, 
fixed record formats, fast streaming and buffering, no read() overhead, 
etc.

> We can probably get the runtime by grouping a task-clock swcounter 
> with an appropriate other event.

Would be lovely.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ