Skip to content

Commit

Permalink
Merge branch 'master' into i6662-public_v2_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
edeiana authored Jan 10, 2025
2 parents c4dc713 + 59352ff commit b3c7f0a
Show file tree
Hide file tree
Showing 24 changed files with 347 additions and 105 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.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.3.$((`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.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.3.$((`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.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.3.$((`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.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.3.$((`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.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.3.$((`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.2.$((`git log -n 1 --format=%ct` / (60*60*24)))
export VERSION_NUMBER=11.3.$((`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.2.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export VERSION_NUMBER="11.3.$((`git log -n 1 --format=%ct` / (60*60*24)))"
export PREFIX="cronbuild-"
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# **********************************************************
# Copyright (c) 2010-2024 Google, Inc. All rights reserved.
# Copyright (c) 2010-2025 Google, Inc. All rights reserved.
# Copyright (c) 2009-2010 VMware, Inc. All rights reserved.
# Copyright (c) 2018 Arm Limited All rights reserved.
# **********************************************************
Expand Down Expand Up @@ -581,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.2.${VERSION_NUMBER_PATCHLEVEL}")
set(VERSION_NUMBER_DEFAULT "11.3.${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 @@ -1868,6 +1868,13 @@ if (WIN32 AND NOT DISABLE_ZLIB)
set(ZLIB_FOUND OFF)
else ()
find_package(ZLIB)
# FindZLIB doesn't give us any library split so we manually
# convert to static.
set(ZLIB_STATIC_LIBRARIES "")
foreach (lib ${ZLIB_LIBRARIES})
string(REGEX REPLACE "\\.so$" ".a" newlib "${lib}")
list(APPEND ZLIB_STATIC_LIBRARIES ${newlib})
endforeach ()
endif ()
# On Ubuntu 14.10, 32-bit builds fail to link with -lsnappy, just ignore.
if (UNIX AND X64)
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.2.0 release](https://github.com/DynamoRIO/dynamorio/releases/tag/release_11.2.0):
The [11.3.0 release](https://github.com/DynamoRIO/dynamorio/releases/tag/release_11.3.0):

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

- [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-Linux-11.3.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.3.0/DynamoRIO-Linux-11.3.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-Linux-EABIHF-11.3.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.3.0/DynamoRIO-ARM-Linux-EABIHF-11.3.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-ARM-Android-EABI-11.3.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.3.0/DynamoRIO-ARM-Android-EABI-11.3.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)
- [DynamoRIO-AArch64-Linux-11.3.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.3.0/DynamoRIO-AArch64-Linux-11.3.0.tar.gz)

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

- [DynamoRIO-Windows-11.1.0.zip](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-Windows-11.1.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.1.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-Linux-11.1.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.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-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.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-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.1.0.tar.gz](https://github.com/DynamoRIO/dynamorio/releases/download/release_11.1.0/DynamoRIO-AArch64-Linux-11.1.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)


***************************************************************************
Expand Down
25 changes: 20 additions & 5 deletions api/docs/release.dox
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ******************************************************************************
* Copyright (c) 2010-2024 Google, Inc. All rights reserved.
* Copyright (c) 2010-2025 Google, Inc. All rights reserved.
* Copyright (c) 2011 Massachusetts Institute of Technology All rights reserved.
* Copyright (c) 2008-2010 VMware, Inc. All rights reserved.
* ******************************************************************************/
Expand Down Expand Up @@ -124,20 +124,35 @@ 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.2.0 include the following compatibility
The changes between version \DR_VERSION and 11.3.0 include the following compatibility
changes:
- No compatibility changes yet.

Further non-compatibility-affecting changes include:
- No changes yet.
- Added support for statically linking clients and the DynamoRIO library into
a pure-static application via a new configure_DynamoRIO_static_client() CMake
function and new "_drstatic" static library CMake targets for the provided
extension libraries.

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

The changes between version 11.3.0 and 11.2.0 include the following compatibility
changes:
- No compatibility changes yet.

Further non-compatibility-affecting changes include:
- Allow v2p.textproto file in a trace directory. This file is present in public traces.
- Allow v2p.textproto file to have one missing virtual_address field, which indicates
virtual_address == 0x0. Necessary in case a trace accesses virtual address 0x0.

**************************************************
<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.
- 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
Expand Down
55 changes: 46 additions & 9 deletions clients/drcachesim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# **********************************************************
# Copyright (c) 2015-2024 Google, Inc. All rights reserved.
# Copyright (c) 2015-2025 Google, Inc. All rights reserved.
# **********************************************************

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -98,6 +98,7 @@ if (ZLIB_FOUND)
"until then, disabling zip output and fast seeking")
set(zip_reader "")
set(zlib_libs ${ZLIB_LIBRARIES})
set(zlib_static_libs ${ZLIB_STATIC_LIBRARIES})
set(ZIP_FOUND OFF)
else ()
file(GLOB minizip_srcs "${minizip_dir}/*.c")
Expand All @@ -117,6 +118,7 @@ if (ZLIB_FOUND)
install_exported_target(minizip ${INSTALL_CLIENTS_LIB})
set(zip_reader reader/zipfile_file_reader.cpp)
set(zlib_libs ${ZLIB_LIBRARIES} minizip)
set(zlib_static_libs ${ZLIB_STATIC_LIBRARIES} minizip)
endif ()
else ()
# XXX: We could ship with a zlib for Windows, or build the third_party/zlib.
Expand Down Expand Up @@ -473,9 +475,13 @@ if (NOT AARCH64 AND NOT APPLE)
endif ()
target_link_libraries(scheduler_launcher ${zlib_libs})

macro(add_drmemtrace name type)
macro(add_drmemtrace name type static_DR no_main)
if (${type} STREQUAL "STATIC")
set(ext_sfx "_static")
if (${static_DR})
set(ext_sfx "_drstatic")
else ()
set(ext_sfx "_static")
endif ()
else ()
set(ext_sfx "")
endif ()
Expand Down Expand Up @@ -519,7 +525,14 @@ macro(add_drmemtrace name type)
endif()

add_library(${name} ${type} ${drmemtrace_srcs})
configure_DynamoRIO_client(${name})
if (${no_main})
append_property_list(TARGET ${name} COMPILE_DEFINITIONS "DRMEMTRACE_NO_MAIN")
endif ()
if (${static_DR})
configure_DynamoRIO_static_client(${name})
else ()
configure_DynamoRIO_client(${name})
endif()
use_DynamoRIO_extension(${name} drmgr${ext_sfx})
use_DynamoRIO_extension(${name} drsyms${ext_sfx})
use_DynamoRIO_extension(${name} drwrap${ext_sfx})
Expand All @@ -536,7 +549,11 @@ macro(add_drmemtrace name type)
if (libsnappy)
target_link_libraries(${name} snappy)
endif ()
target_link_libraries(${name} ${zlib_libs})
if (${static_DR})
target_link_libraries(${name} ${zlib_static_libs})
else ()
target_link_libraries(${name} ${zlib_libs})
endif ()
if (liblz4)
target_link_libraries(${name} lz4)
endif ()
Expand All @@ -547,8 +564,13 @@ macro(add_drmemtrace name type)
install_target(${name} ${INSTALL_CLIENTS_LIB})
endmacro()

add_drmemtrace(drmemtrace SHARED)
add_drmemtrace(drmemtrace_static STATIC)
add_drmemtrace(drmemtrace SHARED OFF OFF)
# This static library links with the DR shared library and has dr_client_main:
add_drmemtrace(drmemtrace_static STATIC OFF OFF)
# This static library links with the DR shared library and has no dr_client_main:
add_drmemtrace(drmemtrace_nomain STATIC OFF ON)
# This static library links with the DR static library and has dr_client_main:
add_drmemtrace(drmemtrace_drstatic STATIC ON OFF)
append_property_list(TARGET drmemtrace_static COMPILE_DEFINITIONS "DRMEMTRACE_STATIC")
# We export drmemtrace.h to the same place as the analysis tool headers
# for simplicity, rather than sticking it into ext/include or sthg.
Expand Down Expand Up @@ -1083,7 +1105,7 @@ if (BUILD_TESTS)
if (LINUX) # Uses mremap.
add_executable(tool.drcacheoff.burst_maps tests/burst_maps.cpp)
configure_DynamoRIO_static(tool.drcacheoff.burst_maps)
use_DynamoRIO_static_client(tool.drcacheoff.burst_maps drmemtrace_static)
use_DynamoRIO_static_client(tool.drcacheoff.burst_maps drmemtrace_nomain)
target_link_libraries(tool.drcacheoff.burst_maps test_helpers)
add_win32_flags(tool.drcacheoff.burst_maps)
endif ()
Expand Down Expand Up @@ -1130,10 +1152,25 @@ if (BUILD_TESTS)
append_property_list(TARGET tool.drcacheoff.burst_client
COMPILE_DEFINITIONS "TEST_APP_DR_CLIENT_MAIN")
configure_DynamoRIO_static(tool.drcacheoff.burst_client)
use_DynamoRIO_static_client(tool.drcacheoff.burst_client drmemtrace_static)
use_DynamoRIO_static_client(tool.drcacheoff.burst_client drmemtrace_nomain)
target_link_libraries(tool.drcacheoff.burst_client test_helpers)
# A nop, keep it for the future Windows support.
add_win32_flags(tool.drcacheoff.burst_client)

# Test a pure-static-link app.
# We ignore "warning: Using 'dlopen' in statically linked applications requires
# at runtime the shared libraries from the glibc version used for linking".
# XXX: We can only successfully build this if static libpthread is available,
# which is only recent glibc 2.34+ such as Ubuntu22+. We also limit to 64-bit
# due to pain building 32-bit on a 64-bit machine.
if (X64 AND "${libpthread}" MATCHES ".a$")
add_executable(tool.drcacheoff.purestatic tests/burst_static.cpp)
append_property_list(TARGET tool.drcacheoff.purestatic
LINK_FLAGS "-static -Wl,--no-export-dynamic")
configure_DynamoRIO_static(tool.drcacheoff.purestatic)
use_DynamoRIO_static_client(tool.drcacheoff.purestatic drmemtrace_drstatic)
target_link_libraries(tool.drcacheoff.purestatic test_helpers)
endif ()
endif ()

if (NOT RISCV64) # TODO i#3544: Port tests to RISC-V 64
Expand Down
46 changes: 46 additions & 0 deletions clients/drcachesim/tests/offline-purestatic.templatex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
pre-DR init
pre-DR start
pre-DR detach
DynamoRIO statistics:
*Peak threads under DynamoRIO control : *1
.*
all done
pre-DR init
pre-DR start
pre-DR detach
DynamoRIO statistics:
*Peak threads under DynamoRIO control : *1
.*
all done
pre-DR init
pre-DR start
pre-DR detach
DynamoRIO statistics:
*Peak threads under DynamoRIO control : *1
.*
all done
Cache simulation results:
Core #0 \(traced CPU\(s\): #0\)
L1I0 .* stats:
Hits: *[0-9,\.]*
Misses: *[0-9,\.]*
Compulsory misses: *[0-9,\.]*
Invalidations: *0
.* Miss rate: [0-3][,\.]..%
L1D0 .* stats:
Hits: *[0-9,\.]*
Misses: *[0-9,\.]*
Compulsory misses: *[0-9,\.]*
Invalidations: *0
.* Miss rate: [0-3][,\.]..%
Core #1 \(traced CPU\(s\): \)
Core #2 \(traced CPU\(s\): \)
Core #3 \(traced CPU\(s\): \)
LL .* stats:
Hits: *[0-9,\.]*
Misses: *[0-9,\.]*
Compulsory misses: *[0-9,\.]*
Invalidations: *0
.* Local miss rate: *[0-9,.]*%
Child hits: *[0-9,\.]*
Total miss rate: [0-1][,\.]..%
17 changes: 10 additions & 7 deletions clients/drcachesim/tracer/tracer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ******************************************************************************
* Copyright (c) 2011-2024 Google, Inc. All rights reserved.
* Copyright (c) 2011-2025 Google, Inc. All rights reserved.
* Copyright (c) 2010 Massachusetts Institute of Technology All rights reserved.
* ******************************************************************************/

Expand Down Expand Up @@ -2538,14 +2538,17 @@ drmemtrace_client_main(client_id_t id, int argc, const char *argv[])
*/

/* To support statically linked multiple clients, we add drmemtrace_client_main
* as the real client init function and make dr_client_main a weak symbol.
* We could also use alias to link dr_client_main to drmemtrace_client_main.
* A simple call won't add too much overhead, and works both in Windows and Linux.
* To automate the process and minimize the code change, we should investigate the
* approach that uses command-line link option to alias two symbols.
* as the real client init function and let a separate dr_client_main call
* drmemtrace_client_main. Since dynamorio_static now provides its own weak
* dr_client_main symbol, we can't simply always provide a weak dr_client_main here:
* it must either be present and strong or not present, controlled by the
* DRMEMTRACE_NO_MAIN define.
*/
DR_EXPORT WEAK void
#ifndef DRMEMTRACE_NO_MAIN
DR_EXPORT
void
dr_client_main(client_id_t id, int argc, const char *argv[])
{
dynamorio::drmemtrace::drmemtrace_client_main(id, argc, argv);
}
#endif
Loading

0 comments on commit b3c7f0a

Please sign in to comment.