public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Andi Kleen <andi@firstfloor.org>,
	Robert Richter <robert.richter@amd.com>,
	oprofile-list@lists.sf.net
Cc: Ingo Molnar <mingo@elte.hu>, Jiri Kosina <jkosina@suse.cz>,
	Jiri Benc <jbenc@suse.cz>, Vilem Marsik <vmarsik@suse.cz>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-kernel@vger.kernel.org
Subject: Oprofile : need to adjust PC by 16 bytes
Date: Fri, 14 Nov 2008 16:25:51 +0100	[thread overview]
Message-ID: <491D987F.1000301@cosmosbay.com> (raw)
In-Reply-To: <491CA0DC.8070405@cosmosbay.com>

Very strange results on my Intel E5450 CPU

I found that I have to bias regs->ip by 16 bytes in order to have
correct profiling.

Does it rings a bell to anyone ?

opcontrol --version
opcontrol: oprofile 0.9.4 compiled on Nov  3 2008 06:45:57

Thank you

diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index 3f1b81a..051fb16 100644
--- a/arch/x86/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
@@ -131,7 +131,9 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
                        continue;
                rdmsrl(msrs->counters[i].addr, val);
                if (CTR_OVERFLOWED(val)) {
+                       regs->ip -= 0x10;
                        oprofile_add_sample(regs, i);
+                       regs->ip += 0x10;
                        wrmsrl(msrs->counters[i].addr, -reset_value[i]);
                }
        }


  reply	other threads:[~2008-11-14 15:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 20:57 Oprofile [still] doesn't work on 2.6.28-rc4 on certain CPU Jiri Kosina
2008-11-13 21:24 ` Ingo Molnar
2008-11-13 21:27   ` Jiri Kosina
2008-11-13 21:37     ` Ingo Molnar
2008-11-13 21:49       ` Eric Dumazet
2008-11-14 15:25         ` Eric Dumazet [this message]
2008-11-14 15:59           ` Oprofile : need to adjust PC by 16 bytes Andi Kleen
2008-11-14 16:02             ` Eric Dumazet
2008-11-14 17:01           ` Mikael Pettersson
2008-11-14 17:21             ` Eric Dumazet
2008-11-14 17:50               ` Andi Kleen
2008-11-15 16:30                 ` Eric Dumazet
2008-11-15 18:36                   ` Andi Kleen
2008-11-17 15:02                     ` stephane eranian
2008-11-17 15:16                       ` Eric Dumazet
2008-11-17 15:24                       ` Andi Kleen
2008-11-14 10:09     ` Oprofile [still] doesn't work on 2.6.28-rc4 on certain CPU Robert Richter
2008-11-14 11:12       ` Jiri Kosina
2008-11-13 21:33   ` Maynard Johnson

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=491D987F.1000301@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=andi@firstfloor.org \
    --cc=jbenc@suse.cz \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oprofile-list@lists.sf.net \
    --cc=penberg@cs.helsinki.fi \
    --cc=robert.richter@amd.com \
    --cc=vmarsik@suse.cz \
    /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