File: t130_thread_exec.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 (35 lines) | stat: -rw-r--r-- 1,045 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
31
32
33
34
35
#!/usr/bin/env python3

from runtest import TestBase

class TestCase(TestBase):
    def __init__(self):
        TestBase.__init__(self, 'thread-exec', """
# DURATION    TID     FUNCTION
            [23290] | main() {
  29.452 us [23290] |   pthread_create();
            [23292] | thread_func() {
            [23292] |   execl() {
            [23290] |   main() {
            [23290] |     a() {
            [23290] |       b() {
            [23290] |         c() {
   0.379 us [23290] |           getpid();
   0.772 us [23290] |         } /* c */
   1.159 us [23290] |       } /* b */
   1.289 us [23290] |     } /* a */
   1.461 us [23290] |   } /* main */

uftrace stopped tracing with remaining functions
================================================
task: 23290
[0] main
""")

    def build(self, name, cflags='', ldflags=''):
        ret  = TestBase.build(self, 'abc', cflags, ldflags)
        ret += TestBase.build(self, self.name, cflags, ldflags + ' -pthread')
        return ret

    def setup(self):
        self.option = '-N ^__'