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