Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#4328 AArch64 prefetch and flush instrs: Add trace types for prefetch instructions #4341

Merged
merged 29 commits into from
Jul 20, 2020

Conversation

abhinav92003
Copy link
Contributor

Adds new trace types for AArch64 prfm and prfum instructions. These prefetch instructions have multiple variants based on:

  • prefetch target: this may be the L1, L2 or L3 cache
  • prefetch policy: either temporal or non-temporal
  • type: prefetch may be for load, instruction or store

Also makes changes to account for these new prefetch trace types in drcachesim.

Issue: #4328

… prefetch instrs.

Adds new trace types for AArch64 prfm and prfum instructions. These prefetch instructions have multiple variants based on:
- prefetch target: this may be the L1, L2 or L3 cache
- prefetch policy: either temporal or non-temporal
- type: prefetch may be for load, instruction or store

Also makes changes to account for these new prefetch trace types in drcachesim.

Issue: #4328
Based on logs the aarch64-linux-gnu-gcc cross-compiler is missing, which is causing 'no such instruction' errors for AArch64 prfm/prfum instructions in prefetch_aarch64_app.c. Verified locally that it compiles with aarch64-linux-gnu-gcc.
Also, remove macro added earlier which is not the solution.
@derekbruening
Copy link
Contributor

Install missing cross compiler for DYNAMORIO_A64_ON_X86_ONLY.

Please revert this part -- the whole point of the a64-on-x86 is to analyze aarch64 traces on x86. There should be no cross-compiler. See #4318, #1684, PR #4325.

This is required to fix the DYNAMORIO_A64_ON_X86_ONLY Travis build.
__builtin_prefetch is not invoked when the test is compiled with -m32. This leads to zero prefetch counts.
Didn't realise that I had used this before. Even though alternative operators are C++ standard, it might be better to avoid them for clarity.
@abhinav92003
Copy link
Contributor Author

Travis is failing for macOS: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/355707609. I couldn't find any useful information to debug this in the log, except that it exited with code 2. @derekbruening any idea what may be the cause?

@abhinav92003 abhinav92003 marked this pull request as ready for review June 30, 2020 08:47
@derekbruening
Copy link
Contributor

Travis is failing for macOS: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/355707609. I couldn't find any useful information to debug this in the log, except that it exited with code 2. @derekbruening any idea what may be the cause?

See #4223. Somehow when the Mac build/tests fail the output is truncated. Maybe a Travis bug. Do you have a Mac you could repro on?

clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
suite/tests/CMakeLists.txt Outdated Show resolved Hide resolved
suite/tests/client-interface/prefetch_aarch64_app.c Outdated Show resolved Hide resolved
suite/tests/client-interface/prefetch_app.c Outdated Show resolved Hide resolved
suite/tests/client-interface/prefetch_aarch64_app.c Outdated Show resolved Hide resolved
This is an attempt to fix the truncated log issue for macOS on Travis. It was suggested as a workaround at travis-ci/travis-ci#8973
…ed on AArch64.

We expect that testing for exact prefetch counts will be flaky. Hence, we modify existing output templates to accept any non-zero value of prefetch counts. To test exact counts, we use a checked-in offline trace instead.
Some tests are unable to read the trace file, probably because zlib is absent.
This is required because these trace types got rearranged in a previous commit.
Copy link
Contributor

@derekbruening derekbruening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding the detailed tests and the arch-agnostic enums.

…h types.

Based on documentation, some AArch64 prefetch encodings are not accessible using prfop.
@abhinav92003 abhinav92003 merged commit cdc24cb into master Jul 20, 2020
@abhinav92003 abhinav92003 deleted the i4328-drmemtrace-handle-aarch64-prefetch branch July 20, 2020 16:50
derekbruening added a commit that referenced this pull request Jul 27, 2020
Fixes a gcc 9.3 build warning introduced by cdc24cb PR #4341.

Issue: #4328
derekbruening added a commit that referenced this pull request Jul 27, 2020
Fixes a gcc 9.3 build warning introduced by cdc24cb PR #4341.

Issue: #4328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants