[lkml]   [2009]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/2 -tip] perf_counter: parse-events.c introduce alias member in event_symbol

* Jaswinder Singh Rajput <> wrote:

> On Tue, 2009-06-23 at 10:24 +0200, Ingo Molnar wrote:
> > * Jaswinder Singh Rajput <> 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;


/* 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.)


 \ /
  Last update: 2009-06-24 10:51    [W:0.050 / U:3.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site