summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2007-10-24 17:57:02 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2007-10-24 17:57:02 +0000
commit0b7585b7a2d18ed891350058bf8e28630e502fa2 (patch)
treebe6c661daada706c7abcb5053f48e4c549e3667d
parent095a8f3234cd3183e9177d1ea4178a2d01aae4b8 (diff)
Remove idle loop counter.
ok art deraadt
-rw-r--r--share/man/man4/man4.amd64/pctr.48
-rw-r--r--share/man/man4/man4.i386/pctr.48
-rw-r--r--sys/arch/amd64/amd64/pctr.c5
-rw-r--r--sys/arch/amd64/include/pctr.h3
-rw-r--r--sys/arch/i386/i386/locore.s6
-rw-r--r--sys/arch/i386/i386/pctr.c5
-rw-r--r--sys/arch/i386/include/pctr.h3
-rw-r--r--usr.bin/pctr/pctr.c3
8 files changed, 10 insertions, 31 deletions
diff --git a/share/man/man4/man4.amd64/pctr.4 b/share/man/man4/man4.amd64/pctr.4
index 0546918a8f2..0b22176b85e 100644
--- a/share/man/man4/man4.amd64/pctr.4
+++ b/share/man/man4/man4.amd64/pctr.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pctr.4,v 1.3 2007/10/21 09:50:22 jmc Exp $
+.\" $OpenBSD: pctr.4,v 1.4 2007/10/24 17:56:52 mikeb Exp $
.\"
.\" Pentium performance counter driver for OpenBSD.
.\" Copyright 1996 David Mazieres <dm@lcs.mit.edu>.
@@ -7,7 +7,7 @@
.\" permitted provided that due credit is given to the author and the
.\" OpenBSD project by leaving this copyright notice intact.
.\"
-.Dd $Mdocdate: October 21 2007 $
+.Dd $Mdocdate: October 24 2007 $
.Dt PCTR 4 amd64
.Os
.Sh NAME
@@ -50,7 +50,6 @@ struct pctrst {
u_int pctr_fn[PCTR_NUM];
pctrval pctr_tsc;
pctrval pctr_hwc[PCTR_NUM];
- pctrval pctr_idl;
};
.Ed
.Pp
@@ -67,9 +66,6 @@ ioctls (see below).
contains the actual value of the hardware counters.
.Em pctr_tsc
is a free-running, 64-bit cycle counter.
-Finally,
-.Em pctr_idl
-is a 64-bit count of idle-loop iterations.
.Pp
The functions of the counters can be programmed with ioctls
.Dv PCIOCS0 ,
diff --git a/share/man/man4/man4.i386/pctr.4 b/share/man/man4/man4.i386/pctr.4
index a7eb6c38c40..e750232a254 100644
--- a/share/man/man4/man4.i386/pctr.4
+++ b/share/man/man4/man4.i386/pctr.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pctr.4,v 1.24 2007/10/21 09:50:22 jmc Exp $
+.\" $OpenBSD: pctr.4,v 1.25 2007/10/24 17:56:54 mikeb Exp $
.\"
.\" Pentium performance counter driver for OpenBSD.
.\" Copyright 1996 David Mazieres <dm@lcs.mit.edu>.
@@ -7,7 +7,7 @@
.\" permitted provided that due credit is given to the author and the
.\" OpenBSD project by leaving this copyright notice intact.
.\"
-.Dd $Mdocdate: October 21 2007 $
+.Dd $Mdocdate: October 24 2007 $
.Dt PCTR 4 i386
.Os
.Sh NAME
@@ -50,7 +50,6 @@ struct pctrst {
u_int pctr_fn[PCTR_NUM];
pctrval pctr_tsc;
pctrval pctr_hwc[PCTR_NUM];
- pctrval pctr_idl;
};
.Ed
.Pp
@@ -67,9 +66,6 @@ ioctls (see below).
contains the actual value of the hardware counters.
.Em pctr_tsc
is a free-running, 64-bit cycle counter.
-Finally,
-.Em pctr_idl
-is a 64-bit count of idle-loop iterations.
.Pp
The functions of the counters can be programmed with ioctls
.Dv PCIOCS0 ,
diff --git a/sys/arch/amd64/amd64/pctr.c b/sys/arch/amd64/amd64/pctr.c
index e47f4ddb6e8..fb1bbd43498 100644
--- a/sys/arch/amd64/amd64/pctr.c
+++ b/sys/arch/amd64/amd64/pctr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.c,v 1.3 2007/10/24 06:30:21 mikeb Exp $ */
+/* $OpenBSD: pctr.c,v 1.4 2007/10/24 17:56:56 mikeb Exp $ */
/*
* Copyright (c) 2007 Mike Belopuhov
@@ -44,8 +44,6 @@
#define usepctr ((pctr_isamd || pctr_isintel) && \
((cpu_id >> 8) & 15) >= 6)
-u_int64_t pctr_idlcnt; /* Gets incremented in locore.S */
-
int pctr_isamd;
int pctr_isintel;
@@ -153,7 +151,6 @@ pctrioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
pctrrd(st);
else if (usetsc)
st->pctr_tsc = rdtsc();
- st->pctr_idl = pctr_idlcnt;
return (0);
}
case PCIOCS0:
diff --git a/sys/arch/amd64/include/pctr.h b/sys/arch/amd64/include/pctr.h
index 18e7f6fc14e..427bcb52ee0 100644
--- a/sys/arch/amd64/include/pctr.h
+++ b/sys/arch/amd64/include/pctr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.h,v 1.2 2007/10/17 02:30:26 deraadt Exp $ */
+/* $OpenBSD: pctr.h,v 1.3 2007/10/24 17:56:57 mikeb Exp $ */
/*
* Pentium performance counter driver for OpenBSD.
@@ -22,7 +22,6 @@ struct pctrst {
u_int pctr_fn[PCTR_NUM]; /* Current settings of counters */
pctrval pctr_tsc; /* Free-running 64-bit cycle counter */
pctrval pctr_hwc[PCTR_NUM]; /* Values of the hardware counters */
- pctrval pctr_idl; /* Iterations of the idle loop */
};
/* Bit values in fn fields and PIOCS ioctl's */
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index ff5a97e22ce..84f8fc71ae7 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.116 2007/10/10 15:53:51 art Exp $ */
+/* $OpenBSD: locore.s,v 1.117 2007/10/24 17:56:58 mikeb Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
@@ -1446,10 +1446,6 @@ ENTRY(cpu_idle_cycle)
#if NAPM > 0
call _C_LABEL(apm_cpu_idle)
#else
-#if NPCTR > 0
- addl $1,_C_LABEL(pctr_idlcnt)
- adcl $0,_C_LABEL(pctr_idlcnt)+4
-#endif
sti
hlt
#endif
diff --git a/sys/arch/i386/i386/pctr.c b/sys/arch/i386/i386/pctr.c
index dfb4905afb5..2ba407964c1 100644
--- a/sys/arch/i386/i386/pctr.c
+++ b/sys/arch/i386/i386/pctr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.c,v 1.24 2007/10/24 06:30:25 mikeb Exp $ */
+/* $OpenBSD: pctr.c,v 1.25 2007/10/24 17:56:58 mikeb Exp $ */
/*
* Pentium performance counter driver for OpenBSD.
@@ -31,8 +31,6 @@
#define usepctr ((pctr_isamd || pctr_isintel) && \
((cpu_id >> 8) & 15) >= 6)
-u_int64_t pctr_idlcnt; /* Gets incremented in locore.S */
-
int pctr_isamd;
int pctr_isintel;
@@ -188,7 +186,6 @@ pctrioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
if (usetsc)
st->pctr_tsc = rdtsc();
}
- st->pctr_idl = pctr_idlcnt;
return (0);
}
case PCIOCS0:
diff --git a/sys/arch/i386/include/pctr.h b/sys/arch/i386/include/pctr.h
index d92d05fbe7e..8dcc8f228e1 100644
--- a/sys/arch/i386/include/pctr.h
+++ b/sys/arch/i386/include/pctr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.h,v 1.14 2007/10/17 14:54:32 deraadt Exp $ */
+/* $OpenBSD: pctr.h,v 1.15 2007/10/24 17:56:59 mikeb Exp $ */
/*
* Pentium performance counter driver for OpenBSD.
@@ -22,7 +22,6 @@ struct pctrst {
u_int pctr_fn[PCTR_NUM]; /* Current settings of counters */
pctrval pctr_tsc; /* Free-running 64-bit cycle counter */
pctrval pctr_hwc[PCTR_NUM]; /* Values of the hardware counters */
- pctrval pctr_idl; /* Iterations of the idle loop */
};
/* Bit values in fn fields and PIOCS ioctl's */
diff --git a/usr.bin/pctr/pctr.c b/usr.bin/pctr/pctr.c
index 7cacab9d3db..c7594ff5a54 100644
--- a/usr.bin/pctr/pctr.c
+++ b/usr.bin/pctr/pctr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pctr.c,v 1.15 2007/10/17 14:54:30 deraadt Exp $ */
+/* $OpenBSD: pctr.c,v 1.16 2007/10/24 17:57:01 mikeb Exp $ */
/*
* Copyright (c) 2007 Mike Belopuhov, Aleksey Lomovtsev
@@ -348,7 +348,6 @@ pctr_printvals(struct pctrst *st)
pctr_fn2str(st->pctr_fn[i]));
if (tsc_avail)
printf(" tsc = %16llu\n", st->pctr_tsc);
- printf(" idl = %16llu\n", st->pctr_idl);
break;
}
}