diff options
author | 2016-02-03 12:09:17 -0800 | |
---|---|---|
committer | 2016-02-03 12:09:17 -0800 | |
commit | 119282ba7b1ac3236d6dcdb93b8d2b5199ea2d61 (patch) | |
tree | 5576b271105dd3f5c6e562064d496e526d6f4e00 | |
parent | 4253522c76fd7694a621dc62a7092ffa6e802e15 (diff) | |
parent | 7f1b65b8c6ee61d6868069c595cd57d98dc752ee (diff) |
Merge pull request #5039 from vjpai/limit_cores
Fix core limit dummy code for non-Linux cases
-rw-r--r-- | test/cpp/qps/limit_cores.cc | 7 | ||||
-rw-r--r-- | test/cpp/qps/limit_cores.h | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/test/cpp/qps/limit_cores.cc b/test/cpp/qps/limit_cores.cc index c2f3ad8fde..fad9a323af 100644 --- a/test/cpp/qps/limit_cores.cc +++ b/test/cpp/qps/limit_cores.cc @@ -36,7 +36,6 @@ #include <grpc/support/cpu.h> #include <grpc/support/log.h> #include <grpc/support/port_platform.h> -#include <vector> namespace grpc { namespace testing { @@ -46,11 +45,11 @@ namespace testing { #define _GNU_SOURCE #endif #include <sched.h> -int LimitCores(const int *cores, int cores_size) { +int LimitCores(const int* cores, int cores_size) { const int num_cores = gpr_cpu_num_cores(); int cores_set = 0; - cpu_set_t *cpup = CPU_ALLOC(num_cores); + cpu_set_t* cpup = CPU_ALLOC(num_cores); GPR_ASSERT(cpup); const size_t size = CPU_ALLOC_SIZE(num_cores); CPU_ZERO_S(size, cpup); @@ -74,7 +73,7 @@ int LimitCores(const int *cores, int cores_size) { } #else // LimitCores is not currently supported for non-Linux platforms -int LimitCores(std::vector<int> core_vec) { return gpr_cpu_num_cores(); } +int LimitCores(const int*, int) { return gpr_cpu_num_cores(); } #endif } // namespace testing } // namespace grpc diff --git a/test/cpp/qps/limit_cores.h b/test/cpp/qps/limit_cores.h index 5c0d1e315d..5482904a3c 100644 --- a/test/cpp/qps/limit_cores.h +++ b/test/cpp/qps/limit_cores.h @@ -34,8 +34,6 @@ #ifndef TEST_QPS_LIMIT_CORES_H #define TEST_QPS_LIMIT_CORES_H -#include <vector> - namespace grpc { namespace testing { /// LimitCores: allow this worker to only run on the cores specified in the |