summaryrefslogtreecommitdiff
path: root/benchmarks/gem_wsim.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-05-09 09:39:17 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-05-09 10:38:26 +0100
commit8540b918665733fbc991715e3849e60e551113c9 (patch)
tree852f06a9261460bfd2c9976b3ef00781b892db5e /benchmarks/gem_wsim.c
parent7736d7ebb141b5e0bdfdcfa68001e4e00f59838d (diff)
gem_wsim: Seed random numbers per client
It makes more sense for the sequence of random batch durations to be different between different clients. Also add a new command line option (-S) to enable forcing the same sequence if so can be useful for testing. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks/gem_wsim.c')
-rw-r--r--benchmarks/gem_wsim.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 91d6fb7f..17460571 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -133,6 +133,7 @@ static int fd;
#define RT (1<<3)
#define VCS2REMAP (1<<4)
#define INITVCSRR (1<<5)
+#define SYNCEDCLIENTS (1<<6)
#define VCS_SEQNO_IDX(engine) (((engine) - VCS1) * 16)
#define VCS_SEQNO_OFFSET(engine) (VCS_SEQNO_IDX(engine) * sizeof(uint32_t))
@@ -925,7 +926,7 @@ run_workload(unsigned int id, struct workload *wrk,
clock_gettime(CLOCK_MONOTONIC, &t_start);
- hars_petruska_f54_1_random_seed(0);
+ hars_petruska_f54_1_random_seed((flags & SYNCEDCLIENTS) ? 0 : id);
for (j = 0; run && (background || j < repeat); j++) {
clock_gettime(CLOCK_MONOTONIC, &wrk->repeat_start);
@@ -1129,6 +1130,8 @@ static void print_help(void)
" -b <n> Load balancing to use. (0: rr, 1: qd, 2: rt, 3: rtr)\n"
" -2 Remap VCS2 to BCS.\n"
" -R Round-robin initial VCS assignment per client.\n"
+" -S Synchronize the sequence of random batch durations\n"
+" between clients.\n"
);
}
@@ -1193,7 +1196,7 @@ int main(int argc, char **argv)
fd = drm_open_driver(DRIVER_INTEL);
intel_register_access_init(intel_get_pci_device(), false, fd);
- while ((c = getopt(argc, argv, "q2Rc:n:r:xw:W:t:b:h")) != -1) {
+ while ((c = getopt(argc, argv, "q2RSc:n:r:xw:W:t:b:h")) != -1) {
switch (c) {
case 'W':
if (master_workload >= 0) {
@@ -1231,6 +1234,9 @@ int main(int argc, char **argv)
case 'R':
flags |= INITVCSRR;
break;
+ case 'S':
+ flags |= SYNCEDCLIENTS;
+ break;
case 'b':
switch (strtol(optarg, NULL, 0)) {
case 0: