mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2 -tip] perf_counter: parse-events.c introduce alias member in event_symbol
Date: Wed, 24 Jun 2009 10:48:25 +0200	[thread overview]
Message-ID: <20090624084825.GB18713@elte.hu> (raw)
In-Reply-To: <1245765732.3776.17.camel@localhost.localdomain>


* Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:

> On Tue, 2009-06-23 at 10:24 +0200, Ingo Molnar wrote:
> > * Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
> > 
> > > 
> > > perf test also need some command to execute otherwise it will also 
> > > show long list of <inactive>
> > 
> > I think what it should do is to execute test-cases _internally_. Not 
> > just execute some random command on the system and hope for events.
> 
> Can you suggest some good test cases where we can get numbers for 
> almost all the events on each and every run.

the testcases should be specific to the counter type. Some counters 
are easy (such as cycles or instructions - you in fact cannot even 
get zero out of them even if you tried) - some are harder - such as 
migrations, or cache-misses or page-faults.

Small functions that trigger them for sure would do the trick. For 
example, to provoke a minor page fault:

static void trigger_minor_page_fault(void)
{
	void *page;

	page = mmap(0, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_ANONYMOUS, -1, 0);

	/* Clearing the page will trigger a minor fault: */
	memset(page, 0, PAGE_SIZE);

	munmap(page, PAGE_SIZE);
}

These small test-functions should be attached to the event array as 
function pointers - hence the generic testing code would just do a 
->event.trigger_event() callback, it wouldnt need to know much about 
the event itself.

> > >  context-switches                                         7956
> > >  CPU-migrations                                              7
> > 
> > this needs to be provoked intentionally via sched_setaffinity(): 
> > first migrate to cpu0, then to cpu1.
> 
> There should be some option from user or we test it each time.

If this is builtin-test.c - then yes, testing it all the time would 
be a good default. (there might be other aspects of testing that 
would require options to this command in the future.)

	Ingo

  reply	other threads:[~2009-06-24  8:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 11:13 [PATCH 1/2 -tip] perf_counter: parse-events.c define separate declarations for H/W and S/W events Jaswinder Singh Rajput
2009-06-22 11:14 ` [PATCH 2/2 -tip] perf_counter: parse-events.c introduce alias member in event_symbol Jaswinder Singh Rajput
2009-06-22 11:32   ` Ingo Molnar
2009-06-22 13:00     ` Jaswinder Singh Rajput
2009-06-22 13:23       ` Jaswinder Singh Rajput
2009-06-22 14:10       ` Ingo Molnar
2009-06-22 19:55         ` Jaswinder Singh Rajput
2009-06-22 20:07           ` Jaswinder Singh Rajput
2009-06-23  8:27             ` Ingo Molnar
2009-06-23  8:24           ` Ingo Molnar
2009-06-23 14:02             ` Jaswinder Singh Rajput
2009-06-24  8:48               ` Ingo Molnar [this message]
2009-06-22 11:38   ` [tip:perfcounters/urgent] perf_counter tools: Introduce " tip-bot for Jaswinder Singh Rajput
2009-06-22 11:38 ` [tip:perfcounters/urgent] perf_counter tools: Define separate declarations for H/W and S/W events tip-bot for Jaswinder Singh Rajput

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=20090624084825.GB18713@elte.hu \
    --to=mingo@elte.hu \
    --cc=jaswinder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®