diff options
author | Kostya Serebryany <kcc@google.com> | 2015-05-12 18:51:57 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-05-12 18:51:57 +0000 |
commit | 9690fcf12eee2c91b106991b3aad7b0e65c0c1b3 (patch) | |
tree | d391f453af9fab0a907542830c43d0a2ca952400 /llvm/lib/Fuzzer/FuzzerUtil.cpp | |
parent | 4744ec6da984f155450683c4aa223678278050a7 (diff) | |
download | bcm5719-llvm-9690fcf12eee2c91b106991b3aad7b0e65c0c1b3.tar.gz bcm5719-llvm-9690fcf12eee2c91b106991b3aad7b0e65c0c1b3.zip |
[lib/Fuzzer] guess the right number of workers if -jobs=N is given but -workers=M is not. Update the docs.
llvm-svn: 237163
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerUtil.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerUtil.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerUtil.cpp b/llvm/lib/Fuzzer/FuzzerUtil.cpp index 3635f39a10d..dc7154ca385 100644 --- a/llvm/lib/Fuzzer/FuzzerUtil.cpp +++ b/llvm/lib/Fuzzer/FuzzerUtil.cpp @@ -61,4 +61,12 @@ void SetTimer(int Seconds) { assert(Res == 0); } +int NumberOfCpuCores() { + FILE *F = popen("nproc", "r"); + int N = 0; + fscanf(F, "%d", &N); + fclose(F); + return N; +} + } // namespace fuzzer |