README 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. $Id: README,v 1.2 2001/08/10 19:23:11 vipin Exp $
  2. This is the README file for the JitterTest (and friends)
  3. program.
  4. This program is used to measure what the jitter of a
  5. real time task would be under "standard" Linux.
  6. More particularly, what is the effect of running
  7. a real time task under Linux with background
  8. JFFS file system activity.
  9. The jitter is measured in milli seconds (ms) from
  10. the expected time of arrival of a signal from a
  11. periodic timer (set by the task) to when the
  12. task actually gets the signal.
  13. This jitter is then stored in a file specified
  14. (or the default output file "jitter.dat").
  15. The data may also be sent out to the console by
  16. writing to /dev/console (See help options. This is
  17. highly desirable specially if you have redirected
  18. your console to the serial port and are storing it
  19. as a minicom log on another computer for later analysis
  20. using some tools provided here).
  21. This is particularly useful if you have a serial
  22. console and are outputting "interesting" info
  23. from inside some kernel task or driver.
  24. (or something as simple as a "df" program running
  25. periodically and redirecting o/p to the console).
  26. One "interesting" thing that I have measured
  27. is the effect of FLASH chip erases on the jitter
  28. of a real time task.
  29. One can do that by putting a printk at the
  30. beginning of the flash erase routine in the MTD
  31. flash chip driver.
  32. Now you will get jitter data interspersed with
  33. flash sector erase events. Other printk's can also
  34. be placed at suspected jitter causing locations in
  35. the system.
  36. EXECUTING THE PROGRAM "JitterTest"
  37. You may specify a file to be read by the
  38. program every time it wakes up (every cycle).
  39. This file is created and filled with some junk
  40. data. The purpose of this is to test the jitter
  41. of the program if it were reading from- say
  42. a JFFS (Journaling Flash File System) file system.
  43. By specifying the complete paths of the read and write
  44. (o/p) files you can test the jitter a POSIX type
  45. real time task will experience under Linux, under
  46. various conditions.
  47. These can be as follows:
  48. 1. O/P file on ram file system, no i/p file.
  49. In this case you would presumably generate other
  50. "typical" background activity for your system and
  51. examine the worst case jitter experienced by
  52. a task that is neither reading nor writing to
  53. a file system.
  54. Other cases could be:
  55. 2. O/P to ram fs, I/P from JFFS (type) fs:
  56. This is specially useful to test the proper
  57. operation of erase suspend type of operation
  58. in JFFS file systems (with an MTD layer that
  59. supports it).
  60. In this test you would generate some background
  61. write/erase type activity that would generate
  62. chip erases. Since this program is reading from
  63. the same file system, you contrast the latencies
  64. with those obtained with writes going to the same
  65. fs.
  66. 3. Both read and writes to (or just write to) JFFS
  67. file system:
  68. Here you would test for latencies experienced by
  69. a program if it were writing (and optionally also
  70. reading) from a JFFS fs.
  71. Grabing a kernel profile:
  72. This program can also conditionally grab a kernel profile.
  73. Specify --grab_kprofile on the cmd line as well as
  74. a "threshold" parameter (see help options by -?).
  75. Any jitter greater than this "threshold" will cause the
  76. program to read the /proc/profile file and dump it in
  77. a local file with increasing file numbers. It will also
  78. output the filename at that time to the console file specified.
  79. This will allow you to corelate later in time the various profiles
  80. with data in your console file and what was going on at that time.
  81. These profile files may then be later examined by running them through
  82. ksymoops.
  83. Make sure you specify "profile=2" on the kernel command line
  84. when you boot the kernel if you want to use this functionality.
  85. Signalling the JFFS[2] GC task:
  86. You can also force this program to send a SIGSTOP/SIGCONT to the
  87. JFFS (or JFFS2) gc task by specifing --siggc <pid> on the cmd line.
  88. This will let you investigate the effect of forcing the gc task to
  89. wake up and do its thing when you are not writing to the fs and to
  90. force it to sleep when you want to write to the fs.
  91. These are just various tools to investigate the possibility of
  92. achieving minimal read/write latency when using JFFS[2].
  93. You need to manually do a "ps aux" and look up the PID of the gc
  94. thread and provide it to the program.
  95. EXECUTING THE PROGRAM "plotJittervsFill"
  96. This program is a post processing tool that will extract the jitter
  97. times as printed by the JitterTest program in its console log file
  98. as well as the data printed by the "df" command.
  99. This "df" data happens to be in the console log because you will
  100. run the shell file fillJffs2.sh on a console when you are doing
  101. your jitter test.
  102. This shell script copies a specified file to another specified file
  103. every programmable seconds. It also does a "df" and redirects output
  104. to /dev/console where it is mixed with the output from JitterTest.
  105. All this console data is stored on another computer, as all this data
  106. is being outputted to the serial port as you have redirected the console
  107. to the serial port (that is the only guaranteed way to not loose any
  108. console log or printk data).
  109. You can then run this saved console log through this program and it
  110. will output a very nice text file with the %fill in one col and
  111. corrosponding jitter values in the second. gnuplot then does a
  112. beautifull plot of this resulting file showing you graphically the
  113. jitters encountered at different fill % of your JFFS[2] fs.
  114. OTHER COMMENTS:
  115. Use the "-w BYTES" cmd line parameter to simulate your test case.
  116. Not everyone has the same requirements. Someone may want to measure
  117. the jitter of JFFS2 with 500 bytes being written every 500ms. Others
  118. may want to measure the system performance writing 2048 bytes every
  119. 5 seconds.
  120. RUNNING MULTIPLE INSTANCES:
  121. Things get real interesting when you run multiple instances of this
  122. program *at the same time*.
  123. You could have one version running as a real time task (by specifing
  124. the priority with the -p cmd line parameter), not interacting with
  125. any fs or at the very least not reading and writing to JFFS[2].
  126. At the same time you could have another version running as a regular
  127. task (by not specifing any priority) but reading and writing to JFFS[2].
  128. This way you can easily measure the blocking performance of the real time
  129. task while another non-real time task interacts with JFFS[2] in the back ground.
  130. You get the idea.
  131. WATCH OUT!
  132. Be particularly careful of running this program as a real time task AND
  133. writing to JFFS[2]. Any blocks will cause your whole system to block till
  134. any garbage collect initiated by writes by this task complete. I have measured
  135. these blocks to be of the order of 40-50 seconds on a reasonably powerful
  136. 32 bit embedded system.