public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: perf: some questions about perf software events
Date: Wed, 24 Nov 2010 12:35:36 +0100	[thread overview]
Message-ID: <m3tyj73qev.fsf@gmail.com> (raw)

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.

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 ?

Thanks
-- 
		Franck

             reply	other threads:[~2010-11-24 11:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 11:35 Franck Bui-Huu [this message]
2010-11-24 11:41 ` perf: some questions about perf software events Peter Zijlstra
2010-11-27 13:28   ` Franck Bui-Huu
2010-11-30 22:44     ` Peter Zijlstra
2010-12-02 20:52       ` Franck Bui-Huu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tyj73qev.fsf@gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox