优先使用STREAM方法进行无root权限内存测试 (Prioritize STREAM method for no-root memory testing) #2
+24
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题描述 (Problem Description)
当前系统检测到无root权限时,DD和Sysbench测试方法会直接回退到mbw测试,跳过了STREAM方法。但STREAM方法实际上不需要root权限,应该被优先尝试。
Currently, when the system is detected to have no root permissions, DD and Sysbench test methods directly fall back to mbw testing, skipping the STREAM method. However, STREAM method actually doesn't require root permissions and should be tried first.
修复内容 (Changes Made)
1. 修改无root权限逻辑
DDTest()函数:当检测到无root权限时,优先尝试StreamTest()SysBenchTest()函数:当检测到无root权限时,优先尝试StreamTest()simpleMemoryTest()(mbw)2. 改进帮助信息
-m参数描述,明确列出所有可用的测试方法:stream, dd, sysbench, winsat, or auto3. 完善文档说明
测试验证 (Verification)
行为变更 (Behavior Changes)
之前的优先级 (Previous Priority):
现在的优先级 (Current Priority):
这确保了STREAM方法在所有场景下都有最高优先级,符合其高性能内存带宽测试的定位。
相关文件 (Files Changed)
memory/macos_linux_mem.go- 核心逻辑修改cmd/main.go- 帮助信息优化README.md- 文档更新.gitignore- 构建产物清理Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
hits.spiritlhl.net./main -m auto -l en(dns block)./main -m dd -l zh(dns block)./main -m sysbench -l en(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.