tree: 80278e58d2272f1aeba3b860917df6c7d928c09b [path history] [tgz]
  1. meta/
  2. args.cc
  3. args.h
  4. args_test.cc
  5. BUILD.gn
  6. compiler.h
  7. cpu_stress.cc
  8. cpu_stress.h
  9. cpu_stress_test.cc
  10. cpu_stressor.cc
  11. cpu_stressor.h
  12. cpu_stressor_test.cc
  13. cpu_workloads.cc
  14. cpu_workloads.h
  15. cpu_workloads_test.cc
  16. device.cc
  17. device.h
  18. flash_stress.cc
  19. flash_stress.h
  20. flash_stress_test.cc
  21. hwstress.cc
  22. hwstress.h
  23. hwstress_test.cc
  24. light_stress.cc
  25. light_stress.h
  26. light_stress_test.cc
  27. main.cc
  28. memory_patterns.cc
  29. memory_patterns.h
  30. memory_patterns_test.cc
  31. memory_range.cc
  32. memory_range.h
  33. memory_range_test.cc
  34. memory_stats.cc
  35. memory_stats.h
  36. memory_stats_test.cc
  37. memory_stress.cc
  38. memory_stress.h
  39. memory_stress_test.cc
  40. OWNERS
  41. profile_manager.cc
  42. profile_manager.h
  43. profile_manager_test.cc
  44. README.md
  45. status.cc
  46. status.h
  47. status_test.cc
  48. temperature_sensor.cc
  49. temperature_sensor.h
  50. temperature_sensor_test.cc
  51. testing_util.h
  52. util.cc
  53. util.h
  54. util_test.cc
garnet/bin/hwstress/README.md

hwstress

hwstress is a tool for exercising hardware components, such as CPU, RAM, and flash. It can be used both to test that hardware is correctly functioning (revealing bad RAM, bad flash, or system heating problems), and also as a system load generator (for example, running the CPU at 50% utilization and consuming 50% of RAM).

Usage

hwstress <subcommand> [options]

Attempts to stress hardware components by placing them under high load.

Subcommands:
  cpu                    Perform a CPU stress test.
  flash                  Perform a flash stress test.
  light                  Perform a device light / LED stress test.
  memory                 Perform a RAM stress test.

Global options:
  -d, --duration=<secs>  Test duration in seconds. A value of "0" (the default)
                         indicates to continue testing until stopped.
  -l, --logging-level    Level of logging to show: terse, normal (the default)
                         or verbose.
  -h, --help             Show this help.

CPU test options:
  -u, --utilization=<percent>
                         Percent of system CPU to use. A value of
                         100 (the default) indicates that all the
                         CPU should be used, while 50 would indicate
                         to use 50% of CPU. Must be strictly greater
                         than 0, and no more than 100.
  -w, --workload=<name>  Run a specific CPU workload. The full list
                         can be determined by using "--workload=list".
                         If not specified, each of the internal
                         workloads will be iterated through repeatedly.
  -p, --cpu-cores=<cores>
                         CPU cores to run the test on. A comma separated list
                         of CPU indices. If not specified all the CPUs will be
                         tested.

Flash test options:
  -c, --cleanup-test-partitions
                         Cleanup all existing flash test partitions in the
                         system, and then exit without testing. Can be used
                         to clean up persistent test partitions left over from
                         previous flash tests which did not exit cleanly.
  -f, --fvm-path=<path>  Path to Fuchsia Volume Manager.
  -i, --iterations=<number>
                         Number of full write/read cycles to perform before finishing the test.
  -m, --memory=<size>    Amount of flash memory to test, in megabytes.

Light test options:
  --light-on-time=<seconds>
                         Time in seconds each "on" blink should be.
                         Defaults to 0.5.
  --light-off-time=<seconds>
                         Time in seconds each "off" blink should be.
                         Defaults to 0.5.

Memory test options:
  -m, --memory=<size>    Amount of RAM to test, in megabytes.
  --percent-memory=<percent>
                         Percentage of total system RAM to test.

Test details

CPU

The CPU stress test will run various workloads across all the CPUs in the system. The workloads are a mix of integer and floating point arithmetic, and have basic checks that performed calculations were correct.

RAM

The RAM stress tests attempt to:

  • Find bad bits in RAM by writing patterns (both random data and deterministic patterns) and verifying that they can be correctly read back again.

  • Find RAM affected by the Row hammer vulnerability.

Flash

The flash stress tests writes unique values to each sector of flash, and verifies that the written data can be correctly read back again.

The flash tests create a raw partition to allow direct communication to the flash device, bypassing Fuchsia's filesystem layers. To do this safely, the test will only exercise block devices managed by FVM. The test will create a raw partition, exercise the partition, and then remove the partition when finished:

# Create and test a 100MiB partition on block device 000.
hwstress flash --fvm-path=/dev/class/block/000/fvm --memory=100

If the test is aborted before finishing, the test partition may not be cleaned up, and the space allocated to the partition not freed. The partition will be removed if the system is rebooted, or by running:

# Remove all hwstress test partitions in the system.
hwstress flash --cleanup-test-partitions

See also

  • loadgen (src/zircon/bin/loadgen) which has many threads performing cycles of idle / CPU work, useful for exercising the kernel's scheduler.

  • kstress (src/zircon/bin/kstress) which is designed to stress test the kernel itself.