Added "--hugepage-size" command line option.

This commit is contained in:
XMRig 2021-02-01 05:06:24 +07:00
parent 09624c4f9b
commit 4c3425a958
No known key found for this signature in database
GPG key ID: 446A53638BE94409
4 changed files with 14 additions and 4 deletions

View file

@ -85,6 +85,7 @@ public:
BenchHashKey = 1047, BenchHashKey = 1047,
BenchTokenKey = 1048, BenchTokenKey = 1048,
DmiKey = 1049, DmiKey = 1049,
HugePageSizeKey = 1050,
// xmrig common // xmrig common
CPUPriorityKey = 1021, CPUPriorityKey = 1021,

View file

@ -125,9 +125,10 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
BaseTransform::transform(doc, key, arg); BaseTransform::transform(doc, key, arg);
switch (key) { switch (key) {
case IConfig::AVKey: /* --av */ case IConfig::AVKey: /* --av */
case IConfig::CPUPriorityKey: /* --cpu-priority */ case IConfig::CPUPriorityKey: /* --cpu-priority */
case IConfig::ThreadsKey: /* --threads */ case IConfig::ThreadsKey: /* --threads */
case IConfig::HugePageSizeKey: /* --hugepage-size */
return transformUint64(doc, key, static_cast<uint64_t>(strtol(arg, nullptr, 10))); return transformUint64(doc, key, static_cast<uint64_t>(strtol(arg, nullptr, 10)));
case IConfig::HugePagesKey: /* --no-huge-pages */ case IConfig::HugePagesKey: /* --no-huge-pages */
@ -306,6 +307,9 @@ void xmrig::ConfigTransform::transformUint64(rapidjson::Document &doc, int key,
case IConfig::CPUPriorityKey: /* --cpu-priority */ case IConfig::CPUPriorityKey: /* --cpu-priority */
return set(doc, CpuConfig::kField, CpuConfig::kPriority, arg); return set(doc, CpuConfig::kField, CpuConfig::kPriority, arg);
case IConfig::HugePageSizeKey: /* --hugepage-size */
return set(doc, CpuConfig::kField, CpuConfig::kHugePages, arg);
default: default:
break; break;
} }

View file

@ -71,6 +71,8 @@ static const option options[] = {
{ "nicehash", 0, nullptr, IConfig::NicehashKey }, { "nicehash", 0, nullptr, IConfig::NicehashKey },
{ "no-color", 0, nullptr, IConfig::ColorKey }, { "no-color", 0, nullptr, IConfig::ColorKey },
{ "no-huge-pages", 0, nullptr, IConfig::HugePagesKey }, { "no-huge-pages", 0, nullptr, IConfig::HugePagesKey },
{ "no-hugepages", 0, nullptr, IConfig::HugePagesKey },
{ "hugepage-size", 1, nullptr, IConfig::HugePageSizeKey },
{ "pass", 1, nullptr, IConfig::PasswordKey }, { "pass", 1, nullptr, IConfig::PasswordKey },
{ "print-time", 1, nullptr, IConfig::PrintTimeKey }, { "print-time", 1, nullptr, IConfig::PrintTimeKey },
{ "retries", 1, nullptr, IConfig::RetriesKey }, { "retries", 1, nullptr, IConfig::RetriesKey },

View file

@ -83,6 +83,9 @@ static inline const std::string &usage()
u += " --cpu-memory-pool=N number of 2 MB pages for persistent memory pool, -1 (auto), 0 (disable)\n"; u += " --cpu-memory-pool=N number of 2 MB pages for persistent memory pool, -1 (auto), 0 (disable)\n";
u += " --cpu-no-yield prefer maximum hashrate rather than system response/stability\n"; u += " --cpu-no-yield prefer maximum hashrate rather than system response/stability\n";
u += " --no-huge-pages disable huge pages support\n"; u += " --no-huge-pages disable huge pages support\n";
# ifdef XMRIG_OS_LINUX
u += " --hugepage-size=N custom hugepage size in kB\n";
# endif
u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n"; u += " --asm=ASM ASM optimizations, possible values: auto, none, intel, ryzen, bulldozer\n";
# if defined(__x86_64__) || defined(_M_AMD64) # if defined(__x86_64__) || defined(_M_AMD64)
@ -155,7 +158,7 @@ static inline const std::string &usage()
u += " -l, --log-file=FILE log all output to a file\n"; u += " -l, --log-file=FILE log all output to a file\n";
u += " --print-time=N print hashrate report every N seconds\n"; u += " --print-time=N print hashrate report every N seconds\n";
# ifdef XMRIG_FEATURE_NVML # if defined(XMRIG_FEATURE_NVML) || defined(XMRIG_FEATURE_ADL)
u += " --health-print-time=N print health report every N seconds\n"; u += " --health-print-time=N print health report every N seconds\n";
# endif # endif
u += " --no-color disable colored output\n"; u += " --no-color disable colored output\n";