Page MenuHomePhabricator

[OMPT] Fix inconsistent testcases
ClosedPublic

Authored by protze.joachim on Feb 9 2018, 3:26 AM.

Details

Summary

The main change of this patch is to insert {{.*}} in current_address=[[RETURN_ADDRESS_END]]. This is needed to match any of the alternatively printed addresses.

Additionally, clang-format is applied to the two tests.

Diff Detail

Event Timeline

protze.joachim created this revision.Feb 9 2018, 3:26 AM
Hahnfeld requested changes to this revision.Feb 9 2018, 3:32 AM

I'd like to document which instructions exactly are there and why.

This revision now requires changes to proceed.Feb 9 2018, 3:32 AM
pawosm01 requested changes to this revision.EditedFeb 9 2018, 5:09 AM
pawosm01 added a subscriber: pawosm01.

Can't compile this

# command stderr:
runtime/test/ompt/synchronization/flush.c:16:5: warning: more '%' conversions than data arguments [-Wformat]
    print_current_address(1);
    ^~~~~~~~~~~~~~~~~~~~~~~
runtime/test/ompt/callback.h:106:3: note: expanded from macro 'print_current_address'
  print_possible_return_addresses(get_ompt_label_address(id))
runtime/test/ompt/callback.h:125:53: note: expanded from macro 'print_possible_return_addresses'
  printf("%" PRIu64 ": current_address=%p or %p or %p\n", ompt_get_thread_data()->value, \
runtime/test/ompt/synchronization/flush.c:16:5: error: extraneous ')' before ';'
runtime/test/ompt/callback.h:106:3: note: expanded from macro 'print_current_address'
  print_possible_return_addresses(get_ompt_label_address(id))
runtime/test/ompt/callback.h:126:70: note: expanded from macro 'print_possible_return_addresses'
         ((char *)addr) - 4, ((char *)addr) - 8), ((char *)addr) - 12)
1 warning and 1 error generated.

error: command failed with exit status: 1

There is closing bracket after - 8 which needs to be deleted.
BTW, making changes to callbask.h, can you make it non-executable?

However, please see the bug report for deeper investigation.

runtime/test/ompt/callback.h
126

Yes, this probably needs to be ((char *)addr) - 8, ((char *)addr) - 12), removing the brace before the added address.

OMPT test cases all pass after that change.

Hahnfeld resigned from this revision.Feb 17 2018, 1:59 AM

Not needed anymore.

protze.joachim retitled this revision from [OMPT] Fix some failing tests on AARCH64 to [OMPT] Fix inconsistent testcases.
protze.joachim edited the summary of this revision. (Show Details)
protze.joachim edited reviewers, added: hbae, omalyshe; removed: rovka, pawelo, pawosm01.

The initial issue in this patch is resolved by D43195. So removed the additionally printed address for AARCH64, but still allow the testcases to match any printed address.

omalyshe added inline comments.Feb 19 2018, 2:09 AM
runtime/test/ompt/synchronization/flush.c
39

MASTER_ID was assigned above, so should be verified here:
// CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]

43

Same comment as above. THREAD_ID should be verified here:
// CHECK: {{^}}[[THREAD_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]

Use the captured pattern as pointed out by Olga

protze.joachim marked 2 inline comments as done.Feb 19 2018, 3:24 AM
omalyshe accepted this revision.Feb 19 2018, 3:30 AM

LGTM.

This revision is now accepted and ready to land.Feb 19 2018, 3:30 AM
Closed by commit rL326312: [OMPT] Fix inconsistent testcases (authored by jprotze, committed by ). · Explain WhyFeb 28 2018, 1:31 AM
This revision was automatically updated to reflect the committed changes.