File: t121_malloc_fork.py

package info (click to toggle)
uftrace 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,356 kB
  • sloc: ansic: 49,770; python: 11,181; asm: 837; makefile: 769; sh: 637; cpp: 627; javascript: 191
file content (30 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env python3

from runtest import TestBase

class TestCase(TestBase):
    def __init__(self):
        TestBase.__init__(self, 'malloc-fork', ldflags='-ldl', result="""
# DURATION    TID     FUNCTION
            [22300] | __cxa_atexit() {
   1.328 us [22300] | } /* __cxa_atexit */
            [22300] | malloc() {
   0.200 us [22300] | } /* malloc */
            [22300] | main() {
            [22300] |   fork() {
 108.998 us [22300] |   } /* fork */
            [22300] |   malloc() {
   0.164 us [22300] |   } /* malloc */
            [22300] |   free() {
   0.100 us [22300] |   } /* free */
 123.077 us [22300] | } /* main */
            [22304] |   } /* fork */
            [22304] |   malloc() {
   0.128 us [22304] |   } /* malloc */
            [22304] |   free() {
   0.081 us [22304] |   } /* free */
            [22304] | } /* main */
""")

    def setup(self):
        self.option = '--no-merge -F main'