Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Mar 1999 00:03:21 -0600 (CST)
From:      Mohit Aron <aron@cs.rice.edu>
To:        freebsd-hackers@freebsd.org
Subject:   bug in performance monitoring code
Message-ID:  <199903150603.AAA01202@cs.rice.edu>

next in thread | raw e-mail | index | archive | help
Hi,
	there's a bug in the performance monitoring code in the file
/sys/i386/i386/perfmon.c that implements ioctl calls to the device
/dev/perfmon. I'm using FreeBSD-3.1 running on a Pentium-Pro processor. 

The problem is that the Intel performance counters are 40 bits wide and
reading them using the rdmsr instruction results in the higher 24 bits of
the 64 bit value to be undefined (as stated in Intel's manuals). However, the
code in perfmon.c doesn't clear the higher 24 bits after calling rdmsr().

Here's a sample output of the /usr/share/examples/perfmon program (this
particular example montiors the floating point operations in 1 second):
% perfmon -u -e -s 1 -l 1 193
  1: 61572651155456
  total: 61572651155456.000000
  mean: 61572651155456.000000
  clocks (at 166-MHz): 166827310


Here's the sample output after applying a fix to /sys/i386/i386/perfmon.c:
% perfmon -u -e -s 1 -l 1 193
  1: 0
  total: 0.000000
  mean: 0.000000
  clocks (at 166-MHz): 166632751




- Mohit Aron
  aron@cs.rice.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903150603.AAA01202>