tree: a1a5d8bec09385f761b823c9ce1cd271d6af80be [path history] [tgz]
  1. BUILD.gn
  2. OWNERS
  3. README.md
  4. args.cc
  5. args.h
  6. args_test.cc
  7. compiler.h
  8. cpu_stress.cc
  9. cpu_stress.h
  10. cpu_stress_test.cc
  11. cpu_stressor.cc
  12. cpu_stressor.h
  13. cpu_stressor_test.cc
  14. cpu_workloads.cc
  15. cpu_workloads.h
  16. cpu_workloads_test.cc
  17. device.cc
  18. device.h
  19. flash_stress.cc
  20. flash_stress.h
  21. flash_stress_test.cc
  22. hwstress.cc
  23. hwstress.h
  24. hwstress_test.cc
  25. light_stress.cc
  26. light_stress.h
  27. light_stress_test.cc
  28. main.cc
  29. memory_patterns.cc
  30. memory_patterns.h
  31. memory_patterns_test.cc
  32. memory_range.cc
  33. memory_range.h
  34. memory_range_test.cc
  35. memory_stats.cc
  36. memory_stats.h
  37. memory_stats_test.cc
  38. memory_stress.cc
  39. memory_stress.h
  40. memory_stress_test.cc
  41. meta/
  42. profile_manager.cc
  43. profile_manager.h
  44. profile_manager_test.cc
  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.