Re: A factoring algorithm




Chris Card wrote:
> Phil Carmody wrote:
> > You can tell if a the memory used in a critical part of your code
> > is in the L1 cache by using performance monitoring counters, assuming
> > your processor has such a feature. Just set them up to count memory
> > accesses (or L1 hits) and L1 misses.
> I have read the Intel documentation for my processor (Pentium 4), and I
> can see in principle how to do this - program the counters using the
> WDMSR instruction, and
> read the values using the RDPMC instruction. However, how do you do it
> in practice?
> The WDMSR instruction can only be executed in the kernel as far as I
> can see, so how do I program the counters using an application running
> on Windows XP?
> And since it looks hard work to write the code, does anyone have any
> code available for this?

You need a kernel driver. Tools like Intel Vtune and AMD CodeAnalyst
(as well as our internal tools) do this regularly. In Linux a kernel
module has the correct privileges.

How you write kernel drivers/modules is another discussion altogether.


Tom

.



Relevant Pages

  • Re: A factoring algorithm
    ... > is in the L1 cache by using performance monitoring counters, ... Just set them up to count memory ... The WDMSR instruction can only be executed in the kernel as far as I ...
    (sci.crypt)
  • Shared memory between kernel driver and multiple processes
    ... I would like to allocate memory from a kernel driver (not necessarily ... Use VirtualAllocCopyEx() to re-map memory to processes. ... allocations in a File mapping ...
    (microsoft.public.windowsce.platbuilder)
  • Re: perfctr questions
    ... >I'm trying to test your performance counters stuff, but I can't get it to do ... the corresponding hardware both varies ... Should the kernel driver directly support some user-friendly ... Not even sure if an Pentium M will measure ...
    (Linux-Kernel)
  • Re: Shared memory between kernel driver and multiple processes
    ... I would like to allocate memory from a kernel driver (not necessarily ... Use VirtualAllocCopyEx() to re-map memory to processes. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Shared memory between kernel driver and multiple processes
    ... VirtualAllocCopyEx() doesn't have to be used with physical ... memory addresses. ... I would like to allocate memory from a kernel driver (not necessarily ...
    (microsoft.public.windowsce.platbuilder)

Quantcast