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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 8 Aug 2009 18:13:42 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Brice Goglin <Brice.Goglin@...ia.fr>
Cc:	Frédéric Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>, paulus@...ba.org,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf report: Display per-thread event counters


* Brice Goglin <Brice.Goglin@...ia.fr> wrote:

> Ingo Molnar wrote:
> >> [...] But I don't see yet where I am suppose to get something like 
> >> PERF_READ_EVENT in builtin-stat.c so I haven't touched it yet.
> >>     
> >
> > Yeah. 'perf stat' is not really getting events but is doing a 
> > read-out of the counter value(s) and constructs its 'read event' 
> > that way. So you wont find PERF_READ_EVENT in builtin-stat.c, you'll 
> > find:
> >
> >                 res = read(fd[cpu][counter], single_count, nv * sizeof(u64));
> >
> > in read_counter(). The printout is then done in print_counter().
> 
> Is there a way to get per-thread counters there? I wrote the code 
> to gather per-cpu counters there, but I don't see any way to get 
> the corresponding thread-id.
> 
> I looked at perf record to get some help. But I don't see where 
> the PERF_EVENT_READ are generated. I guess they are directly 
> generated by the kernel, read by perf record, and written as is to 
> the output file?

Inherited counters are not accessible to the parent context. (they 
dont even have any fds instantiated, for performance and 
transparency reasons.)

I think perf stat could be enhanced to work not via reading the raw 
counters but by doing a mini "perf-record" internally, mmap the 
samples buffer and getting all the events there?

	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