From owner-freebsd-small Wed Jul 1 13:55:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA19925 for freebsd-small-outgoing; Wed, 1 Jul 1998 13:55:30 -0700 (PDT) (envelope-from owner-freebsd-small@FreeBSD.ORG) Received: from pedigree.cs.ubc.ca (smtp.cs.ubc.ca [142.103.6.52]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA19916 for ; Wed, 1 Jul 1998 13:55:20 -0700 (PDT) (envelope-from jwang@cs.ubc.ca) Received: from mughi.cs.ubc.ca (mughi.cs.ubc.ca [142.103.4.2]) by pedigree.cs.ubc.ca (8.8.8/8.6.9) with ESMTP id NAA10138 for ; Wed, 1 Jul 1998 13:55:18 -0700 (PDT) Received: from cascade.cs.ubc.ca (cascade.cs.ubc.ca [142.103.7.7]) by mughi.cs.ubc.ca (8.9.0/8.9.0) with SMTP id NAA06453 for ; Wed, 1 Jul 1998 13:55:14 -0700 (PDT) Message-ID: <359AA230.A5D@cs.ubc.ca> Date: Wed, 01 Jul 1998 13:55:12 -0700 From: "Jasmine(Yongqi) Wang" Organization: CS//UBC X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.6 sun4u) MIME-Version: 1.0 To: freebsd-small@FreeBSD.ORG Subject: (no subject) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG HI, there, I need to run some test to get an idea of TLB miss rate. I have found out that there is performance monitor counter in Pentium processors. I will run it on Pentium Pro. There are 4 MSRs, two for performance event select and two for counting. also there is RDMSR, WRMSR and RDPMC to use. so in my case the event type should be TLB miss and TLB hit. It's said the way it will work is to 1. set up PerfEvtSel0/1 with wrmsr 2. counter will start if 1 succeed and counter is enabled in above instruction. my questions are: RDMSR and WRMSR are only usable in Kernel mode, so should I make a small kernel or is there alternatives? when get the result back I can use RDPMC, if CR4[PCE]=1, i can get it in user mode; otherwise I can only run in kernel too. but i can't find any instruction to read CR4. There are instructions for CR0, CR2 and CR3, or I am missing sth. here? Thanks for your help, -- Jasmine. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-small" in the body of the message