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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
AUTHOR = "Autotest Team <autotest@test.kernel.org>"
TIME = "MEDIUM"
NAME = "Sample - Using oprofile - specific power5 options"
TEST_TYPE = "client"
TEST_CLASS = "Kernel"
TEST_CATEGORY = "Functional"
 
DOC = """
Runs our sleeptest (bogus test that only sleeps for a given amount of time),
while running the oprofile profilers, with and without special parameters
passed to the profiler. This particular control shows special features of
oprofile under power 5 cpu architecture.
"""
 
import logging
 
logging.info("Testing default event")
job.profilers.add('oprofile')
job.run_test('sleeptest', seconds=5, tag='default')
job.profilers.delete('oprofile')
 
logging.info("Testing specified vmlinux")
job.profilers.add('oprofile', '/boot/vmlinux-autotest')
job.run_test('sleeptest', seconds=5, tag='vmlinux')
job.profilers.delete('oprofile')
 
logging.info("Testing one event")
job.profilers.add('oprofile', None, ['PM_RUN_CYC_GRP153:100000'])
job.run_test('sleeptest', seconds=5, tag='one')
job.profilers.delete('oprofile')
 
logging.info("Testing multiple events")
job.profilers.add('oprofile', None,
                  ['PM_RUN_CYC_GRP153:100000', 'PM_INST_CMPL_GRP153:10000'])
job.run_test('sleeptest', seconds=5, tag='multi')
job.profilers.delete('oprofile')
 
logging.info("Testing other args")
job.profilers.add('oprofile', None,
                  ['PM_RUN_CYC_GRP153:150000', 'PM_INST_CMPL_GRP153:150000'],
                  '--callgraph=3')
job.run_test('sleeptest', seconds=5, tag='other')
job.profilers.delete('oprofile')