Skip to content

Commit

Permalink
Merge branch 'master' into iX-rdrnd-catOther
Browse files Browse the repository at this point in the history
  • Loading branch information
khuey authored Dec 27, 2024
2 parents 86da8bb + fa2eaa8 commit 5c3fa16
Show file tree
Hide file tree
Showing 101 changed files with 28,004 additions and 20,609 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
# We only use a non-zero build # when making multiple manual builds in one day.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=11.0.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
# We only use a non-zero build # when making multiple manual builds in one day.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=11.0.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=11.0.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -285,7 +285,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=11.0.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -374,7 +374,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=11.0.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -457,7 +457,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=11.0.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
Expand Down Expand Up @@ -541,7 +541,7 @@ jobs:
# XXX: See x86 job comments on sharing the default ver# with CMakeLists.txt.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER="11.0.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export VERSION_NUMBER="11.2.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
Expand Down
33 changes: 28 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,16 @@ if (TARGET_ARCH MATCHES "^arm64" OR TARGET_ARCH MATCHES "^aarch64")
set(AARCH64 1)
set(X64 1)
message(STATUS "Building for AArch64")
if (ANDROID)
set(ANDROID64 1)
endif ()
elseif (TARGET_ARCH MATCHES "^arm")
set(ARM 1) # This means AArch32.
set(X64 OFF)
message(STATUS "Building for ARM")
if (ANDROID)
set(ANDROID32 1)
endif ()
elseif (TARGET_ARCH MATCHES "^riscv64")
set(RISCV64 1)
set(X64 1)
Expand Down Expand Up @@ -575,7 +581,7 @@ endif (EXISTS "${PROJECT_SOURCE_DIR}/.svn")

# N.B.: When updating this, update all the default versions in ci-package.yml
# and ci-docs.yml. We should find a way to share (xref i#1565).
set(VERSION_NUMBER_DEFAULT "11.0.${VERSION_NUMBER_PATCHLEVEL}")
set(VERSION_NUMBER_DEFAULT "11.2.${VERSION_NUMBER_PATCHLEVEL}")
# do not store the default VERSION_NUMBER in the cache to prevent a stale one
# from preventing future version updates in a pre-existing build dir
set(VERSION_NUMBER "" CACHE STRING "Version number: leave empty for default")
Expand Down Expand Up @@ -692,6 +698,7 @@ if (UNIX)
endif (NOT CMAKE_COMPILER_IS_GNUCC)

check_if_linker_is_gnu_gold(LINKER_IS_GNU_GOLD)
check_if_linker_is_llvm_lld(LINKER_IS_LLVM_LLD)

# FIXME i#2949: static 32-bit release-build linking with gcc 7.3.1 fails when
# static C++ clients like drmemtrace or drmemtrace_raw2trace are linked in.
Expand Down Expand Up @@ -821,6 +828,7 @@ if (UNIX)
# (see i#1034 where this caused problems in the past).
set(BASE_CFLAGS "${BASE_CFLAGS} -funsigned-char")
# Ubuntu defaults to -fstack-protector these days, which depends on app TLS.
CHECK_C_COMPILER_FLAG("-no-pie" no_pie_avail)
CHECK_C_COMPILER_FLAG("-fno-stack-protector" no_stack_protector_avail)
if (no_stack_protector_avail)
set(BASE_CFLAGS "${BASE_CFLAGS} -fno-stack-protector")
Expand Down Expand Up @@ -875,14 +883,14 @@ if (UNIX)
endif ()
# there's no cmake warning control so we hardcode it
set(WARN "-Wall -Werror -Wwrite-strings -Wvla")
CHECK_C_COMPILER_FLAG("-Wno-unused-but-set-variable" nounused_avail)
if (nounused_avail)
set(WARN "${WARN} -Wno-unused-but-set-variable")
endif (nounused_avail)
if (NOT CMAKE_COMPILER_IS_CLANG)
# Old gcc's ignore unknown -W flags, but -Wall -Werror causes clang to
# complain that it doesn't recognize it.
# Actually this is not true: gcc 4.1.2 aborts on unknown -W so we check
CHECK_C_COMPILER_FLAG("-Wno-unused-but-set-variable" nounused_avail)
if (nounused_avail)
set(WARN "${WARN} -Wno-unused-but-set-variable")
endif (nounused_avail)
# XXX i#3792: DynamoRIO manages '\0' termination and error states itself in
# too many places. In order to activate this warning, this code needs to get
# re-factored for no good reason.
Expand All @@ -908,6 +916,21 @@ if (UNIX)
set(WARN "${WARN} -Wno-dangling-pointer")
endif ()
else (NOT CMAKE_COMPILER_IS_CLANG)
# Clang emits this warning when a function is used without a defined
# prototype, however clang can't find function prototpes in #define macros.
# If function prototypes are moved out of #define macros then this warning
# can be re-enabled.
CHECK_C_COMPILER_FLAG("-Wno-deprecated-non-prototype" nodeprecated_prototype_avail)
if (nodeprecated_prototype_avail)
set(WARN "${WARN} -Wno-deprecated-non-prototype")
endif (nodeprecated_prototype_avail)
# Clang emits this warning due to the assembly shared between arm and
# aarch64 in os.c not specifying register widths. If the shared code is
# split into arm and aarch64 versions, then this warning can be re-enabled.
CHECK_C_COMPILER_FLAG("-Wno-asm-operand-widths" noasm_operand_widths)
if (noasm_operand_widths)
set(WARN "${WARN} -Wno-asm-operand-widths")
endif (noasm_operand_widths)
# clang turns off color when it's writing to a pipe, but the user may still
# wish to force color if it eventually goes to a terminal.
option(CLANG_COLOR_DIAGNOSTICS "force colored clang diagnostics" OFF)
Expand Down
14 changes: 9 additions & 5 deletions api/docs/code_reviews.dox
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,11 @@ appear. Do not simply reply at the top level, as such comments are more
difficult to follow as a conversation thread with context.

After making changes in response to review comments, commit those changes
locally as a new commit on top of your original commit. If the reviewer
requested changes to the commit message, use a new proposed final commit
message as the message for this change commit so that the reviewer can
review the new message.
locally as a new commit on top of your original commit (do not squash the
new changes into the original commit; use separate commits). If the reviewer
requested changes to the commit message or title, edit those directly in
the pull request text boxes as those are what become the final commit
message.

Project members should then push the new commit to the pull request via:

Expand All @@ -215,7 +216,10 @@ separate commit (these separate commits will all be squashed together upon mergi
When the requested changes have been pushed, request a re-review from the reviewer so they know that the pull request is ready for another round of reviewing.
This can be done by clicking the re-review button next to the reviewer's name at the top of the right sidebar on the pull request page.

The final squash-and-merge step will squash these additional commits with the original to make a single commit that will be fast-forward-merged into master (see below for more details).
The final squash-and-merge step will squash these additional commits with the
original to make a single commit that will be fast-forward-merged into master (see
below for more details). The final master branch merge commit's title and
description come directly from the pull request title and description.

# Updating from Master

Expand Down
24 changes: 12 additions & 12 deletions api/docs/download.dox
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,29 @@ The source code is available:

For the very latest changes since the last official release, you can download \ref page_weekly_builds.

The [11.0.0 release](https://github.com/DynamoRIO/dynamorio/releases/tag/release_11.0.0):
The [11.2.0 release](https://github.com/DynamoRIO/dynamorio/releases/tag/release_11.2.0):

- [DynamoRIO-Windows-11.0.0.zip](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.0.0/DynamoRIO-Windows-11.0.0.zip)
- [DynamoRIO-Windows-11.2.0.zip](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.2.0/DynamoRIO-Windows-11.2.0.zip)

- [DynamoRIO-Linux-11.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.0.0/DynamoRIO-Linux-11.0.0.tar.gz)
- [DynamoRIO-Linux-11.2.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.2.0/DynamoRIO-Linux-11.2.0.tar.gz)

- [DynamoRIO-ARM-Linux-EABIHF-11.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.0.0/DynamoRIO-ARM-Linux-EABIHF-11.0.0.tar.gz)
- [DynamoRIO-ARM-Linux-EABIHF-11.2.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.2.0/DynamoRIO-ARM-Linux-EABIHF-11.2.0.tar.gz)

- [DynamoRIO-ARM-Android-EABI-11.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.0.0/DynamoRIO-ARM-Android-EABI-11.0.0.tar.gz)
- [DynamoRIO-ARM-Android-EABI-11.2.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.2.0/DynamoRIO-ARM-Android-EABI-11.2.0.tar.gz)

- [DynamoRIO-AArch64-Linux-11.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.0.0/DynamoRIO-AArch64-Linux-11.0.0.tar.gz)
- [DynamoRIO-AArch64-Linux-11.2.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.2.0/DynamoRIO-AArch64-Linux-11.2.0.tar.gz)

The prior [10.0.0 release](https://github.com/DynamoRIO/dynamorio/releases/tag/release_10.0.0):
The [11.1.0 release](https://github.com/DynamoRIO/dynamorio/releases/tag/release_11.1.0):

- [DynamoRIO-Windows-10.0.0.zip](https://github.com/DynamoRIO/dynamorio/releases/download/release_10.0.0/DynamoRIO-Windows-10.0.0.zip)
- [DynamoRIO-Windows-11.1.0.zip](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-Windows-11.1.0.zip)

- [DynamoRIO-Linux-10.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_10.0.0/DynamoRIO-Linux-10.0.0.tar.gz)
- [DynamoRIO-Linux-11.1.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-Linux-11.1.0.tar.gz)

- [DynamoRIO-ARM-Linux-EABIHF-10.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_10.0.0/DynamoRIO-ARM-Linux-EABIHF-10.0.0.tar.gz)
- [DynamoRIO-ARM-Linux-EABIHF-11.1.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-ARM-Linux-EABIHF-11.1.0.tar.gz)

- [DynamoRIO-ARM-Android-EABI-10.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_10.0.0/DynamoRIO-ARM-Android-EABI-10.0.0.tar.gz)
- [DynamoRIO-ARM-Android-EABI-11.1.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-ARM-Android-EABI-11.1.0.tar.gz)

- [DynamoRIO-AArch64-Linux-10.0.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_10.0.0/DynamoRIO-AArch64-Linux-10.0.0.tar.gz)
- [DynamoRIO-AArch64-Linux-11.1.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-AArch64-Linux-11.1.0.tar.gz)


***************************************************************************
Expand Down
39 changes: 35 additions & 4 deletions api/docs/release.dox
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,43 @@ Dr. Memory Framework (DRMF) in the same package as DynamoRIO. DRMF
provides the umbra, drsyscall, and drsymcache Extensions for use by
clients.

The changes between version \DR_VERSION and 11.0.0 include the following compatibility
The changes between version \DR_VERSION and 11.2.0 include the following compatibility
changes:
- No compatibility changes yet.

Further non-compatibility-affecting changes include:
- No changes yet.

**************************************************
<hr>

The changes between version 11.2.0 and 11.1.0 include the following compatibility
changes:
- Added #dynamorio::drmemtrace::TRACE_ENTRY_VERSION_RETIRED_INSTRUCTIONS_ONLY to increase the
trace version for drmemtraces with uncompleted instructions removed.

Further non-compatibility-affecting changes include:
- Added instr_get_operation_size() and instr_set_operation_size() APIs for
#DR_ISA_REGDEPS #instr_t.

**************************************************
<hr>

The changes between version 11.1.0 and 11.0.0 include the following compatibility
changes:
- Removed uncompleted instructions and the corresponding memrefs from drmemtraces.
Instructions which are fetched but not completed due to asynchronous signal or
fault are removed. A new marker
#dynamorio::drmemtrace::TRACE_MARKER_TYPE_UNCOMPLETED_INSTRUCTION was added
to indicate an uncompleted instruction was removed. The value of the marker
is the encoding of the removed instruction up to a pointer's length. Added
#OFFLINE_FILE_VERSION_RETIRED_INSTRUCTIONS_ONLY to increase the trace version
for drmemtraces with uncompleted instructions removed.
is the encoding of the removed instruction up to a pointer's length.
OFFLINE_FILE_VERSION_RETIRED_INSTRUCTIONS_ONLY was added by mistake and it was changed to
#OFFLINE_FILE_VERSION_NO_OP.

- Moved module file read logic into read_module_file() in raw2trace_shared, and
removed raw2trace_directory_t::initialize_module_file() since the
read_module_file() can be directly used without having to pull in the whole
raw2trace_directory_t.

Further non-compatibility-affecting changes include:
- Added X64 Linux support to dr_create_memory_dump(). This API has the same
Expand All @@ -143,6 +170,10 @@ Further non-compatibility-affecting changes include:
- Added the AArch64 FPMR register as DR_REG_FPMR.
- Added OPSZ_addr which chooses the appropriate operand size on X86 from 2/4/8 based
on the 32/64 bit mode and the presence or absence of the address size prefix.
- Fixed the order of operands for the vpexpandd/vpexpandq opcodes (previously the
source and destination operands were reversed).
- Fixed the VEX-encoded forms of vaesdec/vaesdeclast/vaesenc/vaesenclast/vpclmulqdq
to obey VEX.L, which they previously ignored.

**************************************************
<hr>
Expand Down
9 changes: 7 additions & 2 deletions api/samples/div.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* **********************************************************
* Copyright (c) 2014 Google, Inc. All rights reserved.
* Copyright (c) 2014-2024 Google, Inc. All rights reserved.
* Copyright (c) 2008 VMware, Inc. All rights reserved.
* **********************************************************/

Expand Down Expand Up @@ -137,8 +137,13 @@ event_app_instruction(void *drcontext, void *tag, instrlist_t *bb, instr_t *inst
/* if find div, insert a clean call to our instrumentation routine */
opnd_t opnd;
if (instr_is_div(instr, &opnd)) {
opnd_t div_opnd;
if (opnd_is_reg(opnd))
div_opnd = opnd_create_reg(reg_to_pointer_sized(opnd_get_reg(opnd)));
else
div_opnd = opnd;
dr_insert_clean_call(drcontext, bb, instr, (void *)callback, false /*no fp save*/,
2, OPND_CREATE_INTPTR(instr_get_app_pc(instr)), opnd);
2, OPND_CREATE_INTPTR(instr_get_app_pc(instr)), div_opnd);
}
return DR_EMIT_DEFAULT;
}
8 changes: 5 additions & 3 deletions clients/drcachesim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ add_exported_library(drmemtrace_reuse_distance STATIC tools/reuse_distance.cpp)
add_exported_library(drmemtrace_histogram STATIC tools/histogram.cpp)
add_exported_library(drmemtrace_reuse_time STATIC tools/reuse_time.cpp)
add_exported_library(drmemtrace_basic_counts STATIC tools/basic_counts.cpp)
add_exported_library(drmemtrace_opcode_mix STATIC tools/opcode_mix.cpp)
add_exported_library(drmemtrace_opcode_mix STATIC
tools/opcode_mix.cpp tracer/raw2trace_shared.cpp)
add_exported_library(drmemtrace_syscall_mix STATIC tools/syscall_mix.cpp)
add_exported_library(drmemtrace_view STATIC tools/view.cpp)
add_exported_library(drmemtrace_view STATIC
tools/view.cpp tracer/raw2trace_shared.cpp)
add_exported_library(drmemtrace_func_view STATIC tools/func_view.cpp)
add_exported_library(drmemtrace_invariant_checker STATIC tools/invariant_checker.cpp)
add_exported_library(drmemtrace_schedule_stats STATIC tools/schedule_stats.cpp)
Expand Down Expand Up @@ -1202,7 +1204,7 @@ if (BUILD_TESTS)
add_executable(tool.drcacheoff.skip_unit_tests tests/skip_unit_tests.cpp)
configure_DynamoRIO_standalone(tool.drcacheoff.skip_unit_tests)
target_link_libraries(tool.drcacheoff.skip_unit_tests drmemtrace_analyzer
drmemtrace_view drmemtrace_raw2trace test_helpers)
drmemtrace_view test_helpers ${zlib_libs})
add_win32_flags(tool.drcacheoff.skip_unit_tests)
use_DynamoRIO_extension(tool.drcacheoff.skip_unit_tests drreg_static)
use_DynamoRIO_extension(tool.drcacheoff.skip_unit_tests drcovlib_static)
Expand Down
22 changes: 18 additions & 4 deletions clients/drcachesim/common/trace_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,23 @@ typedef enum {
* post-syscall timestamp actually containing the pre-syscall time.
*/
TRACE_ENTRY_VERSION_FREQUENT_TIMESTAMPS = 6,
/*
* The trace supports #TRACE_MARKER_TYPE_UNCOMPLETED_INSTRUCTION. The marker is used
* to indicate an instruction started to execute but didn't retire. The instruction
* was either preempted by an asynchronous signal or caused a fault. The instruction
* and corresponding memrefs are removed from the trace.
*
* The marker value is the raw encoding bytes of the instruction up to the
* length of a pointer. The encoding will be incomplete for instructions
* with long encodings. It is best-effort to help understand the sequence of
* generated code where encodings are not available offline. The PC of this
* instruction is available in a subsequent
* #dynamorio::drmemtrace::TRACE_MARKER_TYPE_KERNEL_EVENT marker.
*/
TRACE_ENTRY_VERSION_RETIRED_INSTRUCTIONS_ONLY =
7, /**< Trace version which has only retired instructions in drmemtraces.*/
/** The latest version of the trace format. */
TRACE_ENTRY_VERSION = TRACE_ENTRY_VERSION_FREQUENT_TIMESTAMPS,
TRACE_ENTRY_VERSION = TRACE_ENTRY_VERSION_RETIRED_INSTRUCTIONS_ONLY,
} trace_version_t;

/** The type of a trace entry in a #memref_t structure. */
Expand Down Expand Up @@ -963,9 +978,8 @@ typedef enum {
#define OFFLINE_FILE_VERSION_ENCODINGS 6
#define OFFLINE_FILE_VERSION_XFER_ABS_PC \
7 /**< Use the absolute PC for kernel interruption PC for 64-bit mode.*/
#define OFFLINE_FILE_VERSION_RETIRED_INSTRUCTIONS_ONLY \
8 /**< Trace version which has only retired instructions in drmemtraces.*/
#define OFFLINE_FILE_VERSION OFFLINE_FILE_VERSION_RETIRED_INSTRUCTIONS_ONLY
#define OFFLINE_FILE_VERSION_NO_OP 8 /**< There are no changes in this version.*/
#define OFFLINE_FILE_VERSION OFFLINE_FILE_VERSION_NO_OP

/**
* Bitfields used to describe the high-level characteristics of both an
Expand Down
Loading

0 comments on commit 5c3fa16

Please sign in to comment.