Eric Li | e0493a4 | 2010-11-15 13:05:43 -0800 | [diff] [blame] | 1 | AUTHOR = "Autotest Team <autotest@test.kernel.org>" |
| 2 | TIME = "SHORT" |
| 3 | NAME = "Sample - More profilers" |
| 4 | TEST_TYPE = "client" |
| 5 | TEST_CLASS = "Kernel" |
| 6 | TEST_CATEGORY = "Functional" |
| 7 | |
| 8 | DOC = """ |
| 9 | Runs sleeptest with differnt profilers present in the autotest tree. Also, |
| 10 | it shows the convenience logging methods, such as logging.info and |
| 11 | logging.error. |
| 12 | """ |
| 13 | |
| 14 | import logging |
| 15 | |
| 16 | for profiler in ('readprofile', 'oprofile', 'catprofile', 'lockmeter'): |
| 17 | try: |
| 18 | logging.info("Testing profiler %s", profiler) |
| 19 | job.profilers.add(profiler) |
| 20 | job.run_test('sleeptest', seconds=5, tag=profiler) |
| 21 | job.profilers.delete(profiler) |
| 22 | except: |
| 23 | logging.error("Test of profiler %s failed", profiler) |
| 24 | raise |