Re: [Patch] Losing many samples when profiling multiple JVMs
大平怜 <[email protected]>
| Newsgroups | gmane.linux.oprofile |
|---|---|
| Message-ID | <CAERM-Pg1uVa4Ygp5QuX7NtTQondN9QJE4wo-8-ENG+Q_NdSTiw@mail.gmail.com> |
Hi, Sorry for the late response. I was on vacation. Sorry, I totally forgot about the ABI difference between big endian and little endian on ppc.... I found the anon_remap test succeeded even with OProfile 1.0.0, where the test must have failed. I am attaching a fix patch to the test case. I changed the matching string from "anon" to " anon ", because "anon" can match not only " anon " but also the name of the binary, "anon_remap". The fixed test correctly failed with 1.0.0 but succeeded with the master branch version. Regards, Rei Odaira 2015-07-16 15:42 GMT-05:00 Will Schmidt <[email protected]>: > On Thu, 2015-07-16 at 10:43 -0400, William Cohen wrote: > > On 07/16/2015 10:27 AM, Will Schmidt wrote: > > > On Wed, 2015-07-15 at 15:03 -0400, William Cohen wrote: > > >> > > >> I tried the test on rhel7 ppc64 and it doesn't work because of the way > > >> that calls operates. The ppc64 generated code is treating the address > > >> returned by > > >> initialize_anon_func as a pointer to a descriptor rather than the > > >> address that the branch should branch to. The first 3 double word in > > >> the generated anon_func are used as a descriptor and the branch goes > > >> off to the wrong location > > >> ( > https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES > ) > > >> > > >> Is this code working on ppc64le? How is the code being compiled on > > >> your machine? Or does it have a similar problem? Any suggestions on > > >> how to best address this? > > > > > > > > > Note that the PPC64le platform (which uses the ELF ABIv2) does not use > > > function descriptors, so it is possible the code actually just works on > > > ppc64le. > > > I've not actually tried this patch, but saw the comment go past, and > > > thought I should chime in in case folks were off scratching their heads > > > in confusion.. :-) > > > > Hi Will, > > > > The problem wasn't with oprofile data collection; it was with some > > test code that was generating code and a pointer to that code. On > > ppc64be that pointer was be interpreted as a pointer to the function > > descriptor and the beginning of the function was being interpreted as > > fields of the function descriptor causing the processor to jump off to > > the wrong location. I did find information about ELF ABIv2 saying it > > didn't use function descriptors. Last night I added an ifdef to the > > anon_remap.c test in the testsuite that should only be enable > > generating function descriptor generation for powerpc64be. I tested > > that > > Ok, yeah, that code change looks good. > > > > the code worked on powerpc64be and x86-64. It would be good for > > someone with ppc64le access to verify that it still works for ppc64le. > > > > git clone git://git.code.sf.net/p/oprofile/oprofile-tests > > cd oprofile-tests/testsuite > > > > as root: > > > > runtest --tool=oprofile > > > > Thanks for the clear steps above. :-) > > I ran the suite against an assortment of Fedora/RH/SuSE/Ubuntu LE > installs and nothing pops out with obvious errors, with the exception > that a few of the environments throw an error on an XML test, which I > believe is unrelated to this change. > > I'll retest later with newer oprofile build in each of those > environments, but overall I think the change is good. > > Thanks, > -Will > > > > > -Will Cohen > > > > > ------------------------------------------------------------------------------ _______________________________________________ oprofile-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oprofile-list
oprofile-tests-anon_remap.patch
(application/octet-stream, 531 B)
diff --git a/testsuite/lib/op_workloads.exp b/testsuite/lib/op_workloads.exp
index 88676ba..661e280 100644
--- a/testsuite/lib/op_workloads.exp
+++ b/testsuite/lib/op_workloads.exp
@@ -59,5 +59,5 @@ set op_workload_table(anon_remap) \
{workloads/anon_remap_src/anon_remap.c} \
{} \
{} \
- {anon} \
+ { anon } \
}