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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1290598906.2072.461.camel@laptop>
Date:	Wed, 24 Nov 2010 12:41:46 +0100
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Franck Bui-Huu <vagabon.xyz@...il.com>
Cc:	lkml <linux-kernel@...r.kernel.org>,
	Francis Moreau <francis.moro@...il.com>
Subject: Re: perf: some questions about perf software events

On Wed, 2010-11-24 at 12:35 +0100, Franck Bui-Huu wrote:
> Hello Peter,
> 
> I've still a couple of questions after looking at the software events
> code, hope you don't mind.
> 
> For pure software events (ie excluding {task,cpu}-clock), does it make
> sense to set a sample frequency ? I would have done something like this:
> 
> 
> diff --git a/kernel/perf_event.c b/kernel/perf_event.c
> index 31515200..df27fd8 100644
> --- a/kernel/perf_event.c
> +++ b/kernel/perf_event.c
> @@ -4671,6 +4671,8 @@ static int perf_swevent_init(struct perf_event *event)
>  
>  	if (event->attr.type != PERF_TYPE_SOFTWARE)
>  		return -ENOENT;
> +	if (event->attr.freq)
> +		return -EINVAL;
>  
>  	switch (event_id) {
>  	case PERF_COUNT_SW_CPU_CLOCK:
> 
> 
> 
> That is for no 'contiguous' events, setting a sampling frequency doesn't
> really make sense since for example you could set a frequency to 1000 HZ
> for the software ALIGNMENT_FAULT event and never get any samplings or at
> least getting sampling but with a totally different rate. And the
> current code doesn't look to handle sample_freq anyway.

All the freq bits are in the generic code, it re-computes the rate on
the timer-tick as well as on each event occurrence. 

Freq driven sampling should work just fine with swevents.

> Also I'm currently not seeing any real differences between cpu-clock and
> task-clock events. They both seem to count the time elapsed when the
> task is running on a CPU. Am I wrong ?

No, Francis already noticed that, I probably wrecked it when I added the
multi-pmu stuff, its on my todo list to look at (Francis also handed me
a little patchlet), but I keep getting distracted with other stuff :/
--
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