This is an archive of the discontinued LLVM Phabricator instance.

[ppc64le] [lldb] [testsuite] Fix false FAILs on ppc64le with no hw watchpoints
Changes PlannedPublic

Authored by jankratochvil on May 9 2021, 4:11 PM.

Details

Reviewers
mgorny
labath
JDevlieghere
jhibbits
nemanjai
Group Reviewers
Restricted Project
Summary

Hardware watchpoints availability differs between hardware (and it also depends on Linux kernel version).
On POWER9, altivec supported, 2.2 (pvr 004e 1202) the testsuite had 67 FAILs, with this patch it has 23 FAILs (probably no longer watchpoint related).
The problem is UNSUPPORTED keyword can list only a triple and some PowerPC hardware can do hw watchpoints. Therefore I had to implement the UNSUPPORTED category in code.
67 FAILs: https://people.redhat.com/jkratoch/lldb-4b8962940322fe732126ec583013ecb5b6a1112e-ppc64le.log
23 FAILs: https://people.redhat.com/jkratoch/lldb-4b8962940322fe732126ec583013ecb5b6a1112e-fix-ppc64le.log

Diff Detail

Event Timeline

jankratochvil created this revision.May 9 2021, 4:11 PM
jankratochvil requested review of this revision.May 9 2021, 4:11 PM
jankratochvil planned changes to this revision.May 9 2021, 11:39 PM

I forgot it should be also checking it is PowerPC.

jankratochvil added a reviewer: Restricted Project.

Is there any command we can run to directly get the number of h/w watchpoints?

I'm thinking that a lot of these are:

try:
  doThing()
except:
  if we got this specific error

Then you could have this at the start of each test instead:

if not self.HasWatchpoints():
   self.skipTest(...)

Where HasWatchpoints runs that command. If there isn't a specific command you could do something silly like watch main and see if it succeeds then remove the watchpoint.

Failing that you could make some skipIfErrorNoWatchpoints(err) just to reduce the duplication.

lldb/test/API/commands/watchpoints/hello_watchpoint/TestMyFirstWatchpoint.py
68

Is the arch check here needed, also should it include powerpc64be? (not very familiar with powerpc but your title says ppc64*)

I don't think it would harm to not check the arch.

jankratochvil planned changes to this revision.May 19 2021, 7:56 AM
jankratochvil marked an inline comment as done.

Is there any command we can run to directly get the number of h/w watchpoints?

Not aware of, I will check and/or code some, thanks for the review.

lldb/test/API/commands/watchpoints/hello_watchpoint/TestMyFirstWatchpoint.py
68

Is the arch check here needed, also should it include powerpc64be? (not very familiar with powerpc but your title says ppc64*)

ppc64be is not supported by LLDB (and I expect it will never be as PowerPC has moved BE->LE).

I don't think it would harm to not check the arch.

I think it would harm. As if there is a regression LLDB falsely reports 0 watchpoints on all arches the testsuite will not find it out. Sure this possible uncaught regression affects also PPC but one cannot do anything with it there.

jankratochvil retitled this revision from [ppc64le] [lldb] [testsuite] Fix false FAILs on ppc64* with no hw watchpoints to [ppc64le] [lldb] [testsuite] Fix false FAILs on ppc64le with no hw watchpoints.May 19 2021, 7:57 AM
DavidSpickett added inline comments.May 19 2021, 8:40 AM
lldb/test/API/commands/watchpoints/hello_watchpoint/TestMyFirstWatchpoint.py
68
I think it would harm. As if there is a regression LLDB falsely reports 0 watchpoints on all arches the testsuite will not find it out. Sure this possible uncaught regression affects also PPC but one cannot do anything with it there.

True, I didn't think of it that way.

If there isn't a specific command you could do something silly like watch main and see if it succeeds then remove the watchpoint.

Or you could watch address 0, there's no requirement for it to be a symbol.