forked from namhyung/uftrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
t010_forkexec.py
34 lines (29 loc) · 991 Bytes
/
t010_forkexec.py
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
#!/usr/bin/env python
from runtest import TestBase
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'forkexec', """
# DURATION TID FUNCTION
[ 9874] | main() {
142.145 us [ 9874] | fork();
[ 9874] | waitpid() {
473.298 us [ 9875] | } /* fork */
[ 9875] | execl() {
[ 9875] | main() {
[ 9875] | a() {
[ 9875] | b() {
[ 9875] | c() {
0.976 us [ 9875] | getpid();
1.992 us [ 9875] | } /* c */
2.828 us [ 9875] | } /* b */
3.658 us [ 9875] | } /* a */
7.713 us [ 9875] | } /* main */
2.515 ms [ 9874] | } /* waitpid */
2.708 ms [ 9874] | } /* main */
""")
def build(self, name, cflags='', ldflags=''):
ret = TestBase.build(self, 'abc', cflags, ldflags)
ret += TestBase.build(self, self.name, cflags, ldflags)
return ret
def setup(self):
self.option = '-F main'