lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <491D987F.1000301@cosmosbay.com>
Date:	Fri, 14 Nov 2008 16:25:51 +0100
From:	Eric Dumazet <dada1@...mosbay.com>
To:	Andi Kleen <andi@...stfloor.org>,
	Robert Richter <robert.richter@....com>,
	oprofile-list@...ts.sf.net
CC:	Ingo Molnar <mingo@...e.hu>, Jiri Kosina <jkosina@...e.cz>,
	Jiri Benc <jbenc@...e.cz>, Vilem Marsik <vmarsik@...e.cz>,
	Pekka Enberg <penberg@...helsinki.fi>,
	linux-kernel@...r.kernel.org
Subject: Oprofile : need to adjust PC by 16 bytes

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]);
                }
        }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ