Commit | Line | Data |
---|---|---|
a50481e7 | 1 | #!/usr/bin/env python3 |
2ffbd362 | 2 | from ctftestsuite.stress import MetadataTestAssitant |
a50481e7 | 3 | |
a50481e7 | 4 | |
2ffbd362 | 5 | class TestAssistant(MetadataTestAssitant): |
9926ec7f | 6 | what = '{size} callsites' |
a50481e7 | 7 | |
9926ec7f PP |
8 | def write_metadata(self, f): |
9 | p1 = \ | |
cc0ca792 | 10 | '''event { |
9926ec7f PP |
11 | name = myevent; |
12 | }; | |
a50481e7 | 13 | |
9926ec7f | 14 | ''' |
a50481e7 | 15 | |
9926ec7f PP |
16 | callsite_fmt = \ |
17 | '''callsite {{ | |
18 | name = "myevent"; | |
19 | func = "myfunc{i}"; | |
20 | file = "myfile{i}"; | |
21 | line = {i}; | |
22 | ip = 0x{i}; | |
23 | }}; | |
a50481e7 | 24 | |
9926ec7f | 25 | ''' |
a50481e7 | 26 | |
cc0ca792 | 27 | f.write(self.BASIC_PROLOGUE) |
9926ec7f | 28 | f.write(p1) |
a50481e7 | 29 | |
9926ec7f PP |
30 | for i in range(self.size): |
31 | callsite = callsite_fmt.format(i=i) | |
32 | f.write(callsite) | |
a50481e7 | 33 | |
a50481e7 | 34 | |
9926ec7f | 35 | if __name__ == '__main__': |
2ffbd362 PP |
36 | test_assistant = TestAssistant() |
37 | test_assistant.main() |