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#4474: Port client.dr_options test to AARCH64 #6869

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions suite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2729,10 +2729,15 @@ if (NOT ARM) # FIXME i#1551: fix bugs on ARM
torunonly_ci(client.truncate.thread-churn-2 win32.threadchurn client.truncate.dll
client-interface/truncate.c "2" "" "")
endif (WIN32)
if (NOT AARCH64) # FIXME i#1569: get working on AArch64
tobuild_ci(client.dr_options client-interface/dr_options.c
"" "-native_exec_list foo.dll,bar.dll -opt_cleancall 3 -thread_private" "")
endif (NOT AARCH64)

# TODO i#1884: Add support for -thread_private caches on ARM and AArch64
if (AARCH64)
set (boolean_option "-disable_traces")
else ()
set (boolean_option "-thread_private")
endif (AARCH64)
tobuild_ci(client.dr_options client-interface/dr_options.c
"" "-native_exec_list foo.dll,bar.dll -opt_cleancall 3 ${boolean_option}" "")
endif (NOT ARM)
tobuild_ci(client.unregister client-interface/unregister.c "" "" "")
if (NOT ARM AND NOT RISCV64) # FIXME i#2094: implement cleancall optimizations on ARM
Expand Down
14 changes: 12 additions & 2 deletions suite/tests/client-interface/dr_options.dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@

#include <string.h>

// TODO i#1884: Add support for -thread_private caches on ARM and AArch64
#ifdef AARCH64
static const char *BOOLEAN_OPTION = "disable_traces";
static const bool USING_PRIVATE_CACHES = false;
#else
static const char *BOOLEAN_OPTION = "thread_private";
static const bool USING_PRIVATE_CACHES = true;
#endif

DR_EXPORT void
dr_init(client_id_t client_id)
{
Expand All @@ -56,13 +65,14 @@ dr_init(client_id_t client_id)
ASSERT(int_option == 3);

/* Query existing boolean option. */
success = dr_get_integer_option("thread_private", &int_option);
success = dr_get_integer_option(BOOLEAN_OPTION, &int_option);
ASSERT(success);
ASSERT(int_option == 1);

/* For major behavior changing options, we expose dedicated query APIs which
* should match the value read from the arbitrary query API.
*/
ASSERT(dr_using_all_private_caches());
ASSERT(dr_using_all_private_caches() == USING_PRIVATE_CACHES);

ASSERT(dr_running_under_dynamorio());

Expand Down
Loading