Fix bug in --bionic_cpu option handling.
Make sure that all the variables are properly initialized.
Remove the code that verifies the core to enable using get_schedaffinity
since that make it impossible to change the cpu for different tests.
Change the cpu_to_lock to an int, it really didn't need to be a long.
Fix a few missing tests.
Test: Ran unit tests.
Test: Built the tests and ran on different cpus, verifying that the
Test: chosen cpu was correct.
Test: Created an xml file that had different cpus for different tests
Test: and verified that it locked to each cpu properly.
Change-Id: Ie7b4ad8f306f13d6e968d118e71bb5dc0221552a
diff --git a/benchmarks/util.h b/benchmarks/util.h
index d9e10f4..0813acc 100644
--- a/benchmarks/util.h
+++ b/benchmarks/util.h
@@ -45,8 +45,8 @@
constexpr auto KB = 1024;
typedef struct {
- long cpu_to_lock;
- long num_iterations;
+ int cpu_to_lock = -1;
+ long num_iterations = 0;
std::string xmlpath;
std::vector<std::string> extra_benchmarks;
} bench_opts_t;
@@ -60,4 +60,4 @@
char* GetAlignedPtrFilled(std::vector<char>* buf, size_t alignment, size_t nbytes, char fill_byte);
-bool LockToCPU(long cpu_to_lock);
+bool LockToCPU(int cpu_to_lock);