Re: [linux-audio-dev] New "plugin"

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] New "plugin"
From: Paul Sladen (paul_AT_sladen.org)
Date: Wed Dec 06 2000 - 12:43:51 EET


On Fri, 1 Dec 2000, Frank Neumann wrote:

> > OK, can i suggest a better way, one that would give us really hard
> > numbers ? Modify applyplugin to do this:
> >
> > #include <asm/msr.h>
> >
> > .
> > .
> > .
> > unsigned long then, now;
> > rdtscl (then);
> > plugin->run (nframes);
> > rdtscl (now);
> >
> > plugin_cycles = now - then;
> >
> > /* you know have an close-to-exact cycle count for the
> > execution of the plugin. collect the results in an array
> > with a spread of about 1000 cycles, then at program end,
> > average the array and print the result.
> > */
> >
> > This would be a much more useful and generic number (though its
> > obviously intel/x86 specific).
>
> Just one small comment here: the Time Stamp register on Pentium class (and
> above) CPUs is 64 bits wide. By using only the lower 32 bits as in your
> example, you will quickly see overflows. Example: On a 400 MHz machine,
> you'll have 2^32/400000000 = approximately 10 seconds. So you'll have an
> overflow after 10 seconds, which might be reached easily by some of the
> more complex plugins. It might be better to also include the upper 32
> bits, 'cause this gives you 2^64/400MHz = some 533759 days before overflow,
> which should be enough for a while on today's CPUs. :-)

Never mind what happens if a task-switch occures during execution.
Interupt etc.

Paul

--
e: paul_AT_sladen.org   t: 0115 922 7162


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Dec 06 2000 - 13:09:46 EET