mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ranjith kumar <ranjit_kumar_b4u@yahoo.co.uk>
To: linux-kernel@vger.kernel.org
Subject: writing to performance monitoring register
Date: Wed, 13 Dec 2006 06:08:02 +0000 (GMT)	[thread overview]
Message-ID: <20061213060802.78275.qmail@web27404.mail.ukl.yahoo.com> (raw)

Hi,
    I want to measure number of last level cache
misses in Pentium 4 processor. In IA-32 programmers
manuals it was given that there are (architectural=
same across all IA-32 processors)perfomance monitoring
counters starting at address   0c1H and
performance_event_select registers starting at address
186H. 

1) When I tried to run a kernel module to write some
value in performance event select register (with
address 186H) by wrmsr instruction, the system is
hanging.Why?
The program is :
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
//#include<xmmintrin.h>
int i,j,k=0;
unsigned int xx,yy,xx1,yy1,xx2,yy2;
unsigned int t1,t2,t3,t4,BIG=0xffffffff;
int init_module(void)
{

asm volatile (" movl $0x186, %%ecx;"
	      " movl $0x0,   %%edx;"
	      " movl $0x0009412E, %%eax;"
	      " wrmsr;"
		:
		:
		:"%eax","%edx","%ecx"); 


printk(KERN_INFO " Initially %u=t1 %u=t2 %u=t3 %u=t4
\n",t1,t2,t3,t4);
 return 0;
}


void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world \n");
}
-------------------------------------------------------
 2) Why I am getting compilation errors when I tried
to include <xmmintrin.h> or <stdio.h> ....files?

Thanks in advane.


		
___________________________________________________________ 
All New Yahoo! Mail – Tired of Vi@gr@! come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html

                 reply	other threads:[~2006-12-13  6:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061213060802.78275.qmail@web27404.mail.ukl.yahoo.com \
    --to=ranjit_kumar_b4u@yahoo.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®