Skip to content

Commit

Permalink
Merge branch 'master' into i6662-v2p-tlb-simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
edeiana authored Sep 17, 2024
2 parents ce2db1b + 3cda8c8 commit 89298dd
Show file tree
Hide file tree
Showing 15 changed files with 815 additions and 335 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/ci-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ jobs:
CI_BRANCH: ${{ github.ref }}

- name: Upload Artifacts
uses: actions/upload-artifact@v2
# This points to the latest upload-artifact v4.x.x.
uses: actions/upload-artifact@v4
with:
name: linux-tarball
path: DynamoRIO-Linux-${{ steps.version.outputs.version_number }}.tar.gz
Expand Down Expand Up @@ -215,7 +216,8 @@ jobs:
CI_BRANCH: ${{ github.ref }}

- name: Upload AArch64
uses: actions/upload-artifact@v2
# This points to the latest upload-artifact v4.x.x.
uses: actions/upload-artifact@v4
with:
name: aarch64-tarball
path: DynamoRIO-AArch64-Linux-${{ steps.version.outputs.version_number }}.tar.gz
Expand Down Expand Up @@ -303,7 +305,8 @@ jobs:
CI_BRANCH: ${{ github.ref }}

- name: Upload ARM
uses: actions/upload-artifact@v2
# This points to the latest upload-artifact v4.x.x.
uses: actions/upload-artifact@v4
with:
name: arm-tarball
path: DynamoRIO-ARM-Linux-EABIHF-${{ steps.version.outputs.version_number }}.tar.gz
Expand Down Expand Up @@ -393,7 +396,8 @@ jobs:
CI_BRANCH: ${{ github.ref }}

- name: Upload Artifacts
uses: actions/upload-artifact@v2
# This points to the latest upload-artifact v4.x.x.
uses: actions/upload-artifact@v4
with:
name: android-tarball
path: DynamoRIO-ARM-Android-EABI-${{ steps.version.outputs.version_number }}.tar.gz
Expand Down Expand Up @@ -484,7 +488,8 @@ jobs:
CI_BRANCH: ${{ github.ref }}

- name: Upload Artifacts
uses: actions/upload-artifact@v2
# This points to the latest upload-artifact v4.x.x.
uses: actions/upload-artifact@v4
with:
name: windows-zip
path: DynamoRIO-Windows-${{ steps.version.outputs.version_number }}.zip
Expand Down Expand Up @@ -562,7 +567,8 @@ jobs:
prerelease: false

- name: Download Linux
uses: actions/[email protected]
# This points to the latest download-artifact v4.x.x.
uses: actions/download-artifact@v4
with:
name: linux-tarball
- name: Upload Linux
Expand All @@ -577,7 +583,8 @@ jobs:
asset_content_type: application/x-gzip

- name: Download AArch64
uses: actions/[email protected]
# This points to the latest download-artifact v4.x.x.
uses: actions/download-artifact@v4
with:
name: aarch64-tarball
- name: Upload AArch64
Expand All @@ -592,7 +599,8 @@ jobs:
asset_content_type: application/x-gzip

- name: Download ARM
uses: actions/[email protected]
# This points to the latest download-artifact v4.x.x.
uses: actions/download-artifact@v4
with:
name: arm-tarball
- name: Upload ARM
Expand All @@ -607,7 +615,8 @@ jobs:
asset_content_type: application/x-gzip

- name: Download Android
uses: actions/[email protected]
# This points to the latest download-artifact v4.x.x.
uses: actions/download-artifact@v4
with:
name: android-tarball
- name: Upload Android
Expand All @@ -622,7 +631,8 @@ jobs:
asset_content_type: application/x-gzip

- name: Download Windows
uses: actions/[email protected]
# This points to the latest download-artifact v4.x.x.
uses: actions/download-artifact@v4
with:
name: windows-zip
- name: Upload Windows
Expand Down
12 changes: 8 additions & 4 deletions clients/drcachesim/analyzer_multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,17 @@ analyzer_multi_tmpl_t<RecordType, ReaderType>::init_dynamic_schedule()
op_sched_order_time.get_value() ? sched_type_t::DEPENDENCY_TIMESTAMPS
: sched_type_t::DEPENDENCY_IGNORE,
sched_type_t::SCHEDULER_DEFAULTS, op_verbose.get_value());
sched_ops.quantum_duration = op_sched_quantum.get_value();
if (op_sched_time.get_value())
sched_ops.time_units_per_us = op_sched_time_per_us.get_value();
if (op_sched_time.get_value()) {
sched_ops.quantum_unit = sched_type_t::QUANTUM_TIME;
sched_ops.quantum_duration_us = op_sched_quantum.get_value();
} else {
sched_ops.quantum_duration_instrs = op_sched_quantum.get_value();
}
sched_ops.syscall_switch_threshold = op_sched_syscall_switch_us.get_value();
sched_ops.blocking_switch_threshold = op_sched_blocking_switch_us.get_value();
sched_ops.block_time_scale = op_sched_block_scale.get_value();
sched_ops.block_time_max = op_sched_block_max_us.get_value();
sched_ops.block_time_multiplier = op_sched_block_scale.get_value();
sched_ops.block_time_max_us = op_sched_block_max_us.get_value();
sched_ops.randomize_next_input = op_sched_randomize.get_value();
sched_ops.honor_direct_switches = !op_sched_disable_direct_switches.get_value();
#ifdef HAS_ZIP
Expand Down
45 changes: 31 additions & 14 deletions clients/drcachesim/common/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,13 +897,19 @@ droption_t<bool> op_core_serial(
"How the scheduling is performed is controlled by a set "
"of options with the prefix \"sched_\" along with -cores.");

droption_t<double>
op_sched_time_per_us(DROPTION_SCOPE_ALL, "sched_time_per_us", 1000.,
"Wall-clock microseconds per simulated microsecond",
"Wall-clock microseconds per simulated microsecond.");

droption_t<int64_t>
// We pick 6 million to match 2 instructions per nanosecond with a 3ms quantum.
op_sched_quantum(DROPTION_SCOPE_ALL, "sched_quantum", 6 * 1000 * 1000,
// We pick 10 million to match 2 instructions per nanosecond with a 5ms quantum.
op_sched_quantum(DROPTION_SCOPE_ALL, "sched_quantum", 10 * 1000 * 1000,
"Scheduling quantum",
"Applies to -core_sharded and -core_serial. "
"Scheduling quantum: in microseconds of wall-clock "
"time if -sched_time is set; otherwise in instructions.");
"Scheduling quantum in instructions, unless -sched_time is set in "
"which case this value is multiplied by -sched_time_per_us to "
"produce a quantum in wall-clock microseconds.");

droption_t<bool>
op_sched_time(DROPTION_SCOPE_ALL, "sched_time", false,
Expand Down Expand Up @@ -932,23 +938,27 @@ droption_t<uint64_t> op_sched_blocking_switch_us(
"-core_serial. ");

droption_t<double> op_sched_block_scale(
DROPTION_SCOPE_ALL, "sched_block_scale", 10., "Input block time scale factor",
"The scale applied to the microsecond latency of blocking system calls. A higher "
"value here results in blocking syscalls keeping inputs unscheduled for longer. "
"This should roughly equal the slowdown of instruction record processing versus the "
"original (untraced) application execution.");

// We have a max to avoid outlier latencies that are already a second or more from
// scaling up to tens of minutes. We assume a cap is representative as the outliers
DROPTION_SCOPE_ALL, "sched_block_scale", 0.1, "Input block time scale factor",
"A system call considered to block (see -sched_blocking_switch_us) will "
"block in the trace scheduler for an amount of simulator time equal to its "
"as-traced latency in trace-time microseconds multiplied by this parameter "
"and by -sched_time_per_us in simulated microseconds, subject to a "
"maximum of --sched_block_max_us. A higher value here results in blocking "
"syscalls keeping inputs unscheduled for longer. There is indirect "
"overhead inflating the as-traced times, so a value below 1 is typical.");

// We have a max to avoid outlier latencies from scaling up to extreme times. There is
// some inflation in the as-traced latencies and some can be inflated more than others.
// We assume a cap is representative as the outliers
// likely were not part of key dependence chains. Without a cap the other threads all
// finish and the simulation waits for tens of minutes further for a couple of outliers.
// The cap remains a flag and not a constant as different length traces and different
// speed simulators need different idle time ranges, so we need to be able to tune this
// to achieve desired cpu usage targets. The default value was selected to avoid unduly
// long idle times with local analyzers; it may need to be increased with more
// heavyweight analyzers/simulators.
droption_t<uint64_t> op_sched_block_max_us(DROPTION_SCOPE_ALL, "sched_block_max_us",
250000,
// TODO i#6959: Once we have -exit_if_all_unscheduled raise this.
droption_t<uint64_t> op_sched_block_max_us(DROPTION_SCOPE_ALL, "sched_block_max_us", 2500,
"Maximum blocked input time, in microseconds",
"The maximum blocked time, after scaling with "
"-sched_block_scale.");
Expand Down Expand Up @@ -995,6 +1005,13 @@ droption_t<bool> op_sched_disable_direct_switches(
"switch being determined by latency and the next input in the queue. The "
"TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH markers are not removed from the trace.");

droption_t<double> op_sched_time_units_per_us(
DROPTION_SCOPE_ALL, "sched_time_units_per_us", 100.,
"Time units per simulated microsecond",
"Time units (currently wall-clock time) per simulated microsecond. This scales all "
"of the -sched_*_us values as it converts wall-clock time into the simulated "
"microseconds measured by those options.");

// Schedule_stats options.
droption_t<uint64_t>
op_schedule_stats_print_every(DROPTION_SCOPE_ALL, "schedule_stats_print_every",
Expand Down
1 change: 1 addition & 0 deletions clients/drcachesim/common/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ extern dynamorio::droption::droption_t<int> op_kernel_trace_buffer_size_shift;
#endif
extern dynamorio::droption::droption_t<bool> op_core_sharded;
extern dynamorio::droption::droption_t<bool> op_core_serial;
extern dynamorio::droption::droption_t<double> op_sched_time_per_us;
extern dynamorio::droption::droption_t<int64_t> op_sched_quantum;
extern dynamorio::droption::droption_t<bool> op_sched_time;
extern dynamorio::droption::droption_t<bool> op_sched_order_time;
Expand Down
Loading

0 comments on commit 89298dd

Please sign in to comment.