mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: small perfctr bug or misunderstanding
@ 2004-07-03 14:58 Mikael Pettersson
  2004-07-04  1:15 ` bert hubert
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2004-07-03 14:58 UTC (permalink / raw)
  To: ahu; +Cc: linux-kernel

On Sat, 3 Jul 2004 16:08:29 +0200, bert hubert wrote:
>Mikael, thanks for the low-level-api.txt documentation. Will vperfctr_* see
>some documentation? Want me to whip up manpages?

Docs for the syscalls will appear shortly.

>So far perfctr has been very useful to me already - I now know parts of
>PowerDNS that are completely memory bound, which I so far only suspected.
>Are the global counters available? There is a note in the perfctl
>distribution that says they aren't?

Currently no; I removed them while we've been debating the
API to the (IMO more important) per-process counters.
I intend to add them back once the current stuff has been
Linus-approved.

>One thing - on my Pentium M I'm unable to get more than one counter going
>simultaneously, I get 'Operation not permitted'. Perfex reports that
>supposedly two are possible.

Classic beginner's mistake :-)

>  void addCounter(unsigned int v, unsigned int unit=0) 
>  {
>    int count=d_control.cpu_control.nractrs;
>
>    d_control.cpu_control.evntsel[count] = v | (1 << 16) | (1 << 22) | (unit << 8); 
>    d_control.cpu_control.pmc_map[count] = count;
>    d_control.cpu_control.nractrs++; // no support for .nrictrs
>  }

Quoting from Documentation/perfctr/low-level-x86.txt:

>Intel P6
>--------
>The evntsel values are mapped directly onto the counters'
>EVNTSEL control registers.
>
>The global enable bit (22) in EVNTSEL0 must be set. That bit is
>reserved in EVNTSEL1.
>...
>AMD K7/K8
>---------
>Similar to Intel P6. The main difference is that each evntsel has
>its own enable bit, which must be set.

The driver sees ENABLE set in EVNTSEL1 on your P-M,
and properly returns an error.

The proper way is for user-space to consider a set of
events (not yet added to the control struct), and to
use the current CPU type to format the control and
handle any quirks. For P6 vs K7 the differences are
minor, but to program the P4 you _really_ need helper
procedures.

/Mikael

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PATCH][2.6.7-mm5] perfctr low-level documentation
@ 2004-07-03 10:28 Mikael Pettersson
  2004-07-03 14:08 ` small perfctr bug or misunderstanding bert hubert
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2004-07-03 10:28 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

On Fri, 2 Jul 2004 15:44:14 -0700, Andrew Morton wrote:
>Mikael Pettersson <mikpe@csd.uu.se> wrote:
>>
>> I'm
>> considering Christoph Hellwig's suggestion of moving
>> the API back to /proc/<pid>/, but with multiple files
>> and open/read/write/mmap instead of ioctl. I believe I
>> can make that work, but it would take a couple of days
>> to implement properly. Please indicate if you would like
>> this change or not.
>
>What would be the advantages of such a change?

Eliminating the 6 or so new syscalls I was forced
to add when nuking the old ioctl() API.

There would be a /proc/<pid>/<tid>/perfctr/ directory
with files representing the control data, counter
state, general info, and auxiliary control ops.

/Mikael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-04  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-03 14:58 small perfctr bug or misunderstanding Mikael Pettersson
2004-07-04  1:15 ` bert hubert
  -- strict thread matches above, loose matches on Subject: below --
2004-07-03 10:28 [PATCH][2.6.7-mm5] perfctr low-level documentation Mikael Pettersson
2004-07-03 14:08 ` small perfctr bug or misunderstanding bert hubert

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®