README 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. This is performance measurement for nix.
  2. Each directory named with a number represents a single measure to be taken.
  3. (e.g., 1/ 2/ ...)
  4. A bench directory may be also named k1, k2, k....
  5. All k benchs run affter all std. benchs. They are meant to install ad-hoc
  6. kernels for measurement.
  7. The script actually running the benchs is runbenchs, which should be run from
  8. cpustart during the machine boot process only if it's found at /cfg/$sysname
  9. That is, include
  10. test -x /cfg/$sysname/runbenchs && /cfg/$sysname/runbenchs
  11. in your cpustart file.
  12. It is not meant to start the bench sequence by hand.
  13. To (re)run all the benchmarks, you should run ./Benchs instead.
  14. See 1/ for a template. Copy it to your own and tweak it at will.
  15. To start benchs, run the script ./Benchs in clu, which would
  16. change the boot sequence such that the machine starts to run benchs
  17. (perhaps installing different kernels and rebooting) until all ones
  18. have been run or one has failed.
  19. Each directory must contain:
  20. - kern: a script used to compile and install a kernel.
  21. if no such file is found, no new kernel is installed. the current one
  22. is used. Otherwise, the indicated kernel is installed and the machine
  23. reboots using this kernel.
  24. - runbench: a script used to run a bench. This is mandatory.
  25. - whichever other files must be available for the benchs to run.
  26. Benchs generate within each test directory whichever files they want.
  27. By convention, repeated times measured get into TIMES, and debug counters
  28. get into COUNTERS. The last line in TIMES reports the average.
  29. Repeated timing is done by Time. See the bench in ./1 as a template.
  30. As a result of running an to control when to run them, these files are
  31. generated:
  32. - koutput: a file keeping the output for a kern that did run
  33. - output: a file keeping the output for a test that did run,
  34. this includes also /dev/debug and /dev/sysstat
  35. - FAIL: an empty file, reporting that a test did fail.
  36. - KMESG: copy of /dev/kmesg after booting a installed kernel
  37. BEWARE that if you install a kernel for a bench then that kernel is used
  38. for all following ones.
  39. As a convention, benchs installing a kernel should be named k0, k1, ...
  40. test 1 installs the std kernel, so that all benchs use the regular kernel.
  41. The Time script used to measure the mean of repeated runs also gathers the
  42. output of /dev/debug, and the cumulative value of /dev/sysstat for 10 runs.
  43. To create benchs for the same test using multiple parameter values, create
  44. different directories for each value. That we we keep the output for each one
  45. in a different place, under control. For example:
  46. Replicating bench 1 for 1 to 32 cores, the first one is going to be bench #31:
  47. First create and adapt the first benchmark
  48. mkdir 31
  49. dircp 1 31
  50. rm -f 31/^(koutput output FAIL KMESG)
  51. B 31/kern
  52. B 31/runbench
  53. Now replicate this one, changing the parameter for each of the new ones:
  54. for(x in `{seq 31}){ d=`{echo $x + 31|hoc} {mkdir $d; dircp 31 $d; sed 's/ck 1$/ck '^$x^'/' < 31/003048ff2106 >$d/003048ff2106}}
  55. Then run ./Benchs
  56. for(x in `{seq 30}){ d=`{echo $x + 67|hoc} ; nc=`{echo $x + 2 | hoc}; echo dir $d echo $nc cores ; ; sed 's/ck 2$/ck '^$nc^'/' < 67/003048ff2106 >$d/003048ff2106}
  57. Beware that many benchs are made assuming the kernel is implemented in a
  58. certain way, at least, those depending on a particular kernel.
  59. That means that, for example, if you clear benchs 1-99, you might have to
  60. rely on /n/nixdump/2012/0123/sys/src/nix sources; otherwise the kernel might
  61. not compile, or you might be measuring something else.
  62. In short: feel free to clear only the benchmarks you are responsible for.
  63. You should know what you are measuring in any case.