Skip to content

Instantly share code, notes, and snippets.

@danielhams
Created March 7, 2020 10:53
Show Gist options
  • Select an option

  • Save danielhams/c10841e80a1abf61b0f7b42f8f293dcf to your computer and use it in GitHub Desktop.

Select an option

Save danielhams/c10841e80a1abf61b0f7b42f8f293dcf to your computer and use it in GitHub Desktop.
Using two new threads in C++
0mS[ 1] (14107): was sent signal SIGUSR1 by pid 14110
0mS[ 1] par(14107:4294981371): received signal SIGUSR1 (handler 0x10002ac8)
0mS[ 1] par(14107:4294981371): END-pause() errno = 4 (Interrupted function call)
0mS[ 1] par(14107:4294981371): sigreturn(0x7ffd7ad0) OK
0mS[ 1] testprog(14107:4294981371): execve("./testprog", 0x7ffd7f40, 0x7ffd7f48)
1mS[ 1] testprog(14107:4294981371): END-execve() OK
1mS[ 1] testprog(14107:4294981371): sysconf(_SC_CAP) = 1
1mS[ 1] testprog(14107:4294981371): syssgi(SGI_PROC_ATTR_GET, 0xfb3daf0, 0x7ffd7ec0, 0, 0, 0) = 0
1mS[ 1] testprog(14107:4294981371): getuid() = 55695, euid=55695
1mS[ 1] testprog(14107:4294981371): getuid() = 55695, euid=55695
1mS[ 1] testprog(14107:4294981371): getgid() = 20 egid=20
1mS[ 1] testprog(14107:4294981371): getgid() = 20 egid=20
1mS[ 1] testprog(14107:4294981371): open("/lib32/rld", O_RDONLY, 04) = 4
1mS[ 1] testprog(14107:4294981371): read(4, <7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00>..., 512) = 512
1mS[ 1] testprog(14107:4294981371): elfmap(4, 0x7ffd7d54, 2) = 0xfb60000
1mS[ 1] testprog(14107:4294981371): close(4) OK
1mS[ 1] testprog(14107:4294981371): getpagesize() = 16384
2mS[ 1] testprog(14107:4294981371): syssgi(0x5c, 0, 0x3d, 0, 0xfbd61b1, 0x52) = 0
2mS[ 1] testprog(14107:4294981371): sysinfo(_MIPS_SI_PROCESSORS, 0x7ffd7da0, 257) = 23
2mS[ 1] testprog(14107:4294981371): open("/dev/zero", O_RDONLY, 01757300000) = 4
2mS[ 1] testprog(14107:4294981371): mmap(0xfbd8000, 32768, PROT_WRITE|PROT_READ, MAP_PRIVATE, 4, 0) = 0xfbd8000
2mS[ 1] testprog(14107:4294981371): close(4) OK
2mS[ 1] testprog(14107:4294981371): open("/usr/people/dan/Temp/testpthread/sgug-rse-cpp/libtestlib.so", O_RDONLY, 05) = 4
2mS[ 1] testprog(14107:4294981371): read(4, <7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00>..., 512) = 512
2mS[ 1] testprog(14107:4294981371): elfmap(4, 0x7ffd5ee0, 2) = 0x5ffe0000
2mS[ 1] testprog(14107:4294981371): close(4) OK
2mS[ 1] testprog(14107:4294981371): syssgi(SGI_USE_FP_BCOPY, 0, 0x4d0, 0xffffffff, 0x4c0, 0x1) = 0
2mS[ 1] testprog(14107:4294981371): open("/usr/people/dan/Temp/testpthread/sgug-rse-cpp/libstdc++.so.6", O_RDONLY, 05) errno = 2 (No such file or directory)
2mS[ 1] testprog(14107:4294981371): open("/usr/sgug/lib32/libstdc++.so.6", O_RDONLY, 05) = 4
2mS[ 1] testprog(14107:4294981371): read(4, <7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00>..., 512) = 512
2mS[ 1] testprog(14107:4294981371): elfmap(4, 0x7ffd5dd0, 2) = 0x4000000
2mS[ 1] testprog(14107:4294981371): close(4) OK
2mS[ 1] testprog(14107:4294981371): open("/dev/zero", O_RDONLY, 01757340000) = 4
3mS[ 1] testprog(14107:4294981371): mmap(0xfbe0000, 65536, PROT_WRITE|PROT_READ, MAP_PRIVATE, 4, 0) = 0xfbe0000
3mS[ 1] testprog(14107:4294981371): close(4) OK
3mS[ 1] testprog(14107:4294981371): open("/usr/people/dan/Temp/testpthread/sgug-rse-cpp/libm.so", O_RDONLY, 05) errno = 2 (No such file or directory)
3mS[ 1] testprog(14107:4294981371): open("/usr/sgug/lib32/libm.so", O_RDONLY, 05) errno = 2 (No such file or directory)
3mS[ 1] testprog(14107:4294981371): open("/usr/lib32/libm.so", O_RDONLY, 05) = 4
3mS[ 1] testprog(14107:4294981371): read(4, <7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00>..., 512) = 512
3mS[ 1] testprog(14107:4294981371): elfmap(4, 0x7ffd5df0, 2) = 0x12a0000
3mS[ 1] testprog(14107:4294981371): close(4) OK
3mS[ 1] testprog(14107:4294981371): open("/usr/people/dan/Temp/testpthread/sgug-rse-cpp/libgcc_s.so.1", O_RDONLY, 05) errno = 2 (No such file or directory)
3mS[ 1] testprog(14107:4294981371): open("/usr/sgug/lib32/libgcc_s.so.1", O_RDONLY, 05) = 4
3mS[ 1] testprog(14107:4294981371): read(4, <7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00>..., 512) = 512
3mS[ 1] testprog(14107:4294981371): elfmap(4, 0x7ffd5df0, 2) = 0x4200000
3mS[ 1] testprog(14107:4294981371): close(4) OK
4mS[ 1] testprog(14107:4294981371): open("/usr/people/dan/Temp/testpthread/sgug-rse-cpp/libc.so.1", O_RDONLY, 05) errno = 2 (No such file or directory)
4mS[ 1] testprog(14107:4294981371): open("/usr/sgug/lib32/libc.so.1", O_RDONLY, 05) errno = 2 (No such file or directory)
4mS[ 1] testprog(14107:4294981371): open("/usr/people/dan/Temp/testpthread/sgug-rse-cpp/libpthread.so", O_RDONLY, 05) errno = 2 (No such file or directory)
4mS[ 1] testprog(14107:4294981371): open("/usr/sgug/lib32/libpthread.so", O_RDONLY, 05) errno = 2 (No such file or directory)
4mS[ 1] testprog(14107:4294981371): open("/usr/lib32/libpthread.so", O_RDONLY, 05) = 4
4mS[ 1] testprog(14107:4294981371): read(4, <7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00>..., 512) = 512
4mS[ 1] testprog(14107:4294981371): elfmap(4, 0x7ffd5df0, 2) = 0xc050000
4mS[ 1] testprog(14107:4294981371): close(4) OK
18mS[ 1] testprog(14107:4294981371): getpagesize() = 16384
18mS[ 1] testprog(14107:4294981371): getrlimit(0x8, 0x7ffd7dd0) OK
18mS[ 1] testprog(14107:4294981371): open("/dev/zero", O_RDWR, 01401600000) = 4
18mS[ 1] testprog(14107:4294981371): mmap(0, 360448, PROT_WRITE|PROT_READ, MAP_PRIVATE|MAP_AUTORESRV, 4, 0) = 0x4238000
18mS[ 1] testprog(14107:4294981371): mmap(0x4238000, 360448, PROT_WRITE|PROT_READ, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0x4238000
18mS[ 1] testprog(14107:4294981371): close(4) OK
18mS[ 1] testprog(14107:4294981371): prctl(PR_INIT_THREADS, 0x58000, 0x3) = 0
19mS[ 1] testprog(14107:4294981371): sysconf(_SC_CLK_TCK) = 100
19mS[ 1] testprog(14107:4294981371): sigaction(48, {flags=SA_RESTART handler=0xc061ea4 mask=[<none>]}, 0) OK
19mS[ 1] testprog(14107:4294981371): sysmp(MP_NAPROCS) = 2
19mS[ 1] testprog(14107:4294981371): sigaction(47, {flags=SA_SIGINFO handler=0xc058018 mask=[SIGHUP SIGINT SIGQUIT SIGILL SIGTRAP SIGABRT SIGEMT SIGFPE SIGKILL SIGBUS SIGSEGV SIGSYS SIGPIPE SIGALRM SIGTERM SIGUSR1 SIGUSR2 SIGCLD SIGPWR SIGWINCH SIGURG SIGPOLL SIGSTOP SIGTSTP SIGCONT SIGTTIN SIGTTOU SIGVTALRM SIGPROF SIGXCPU SIGXFSZ 32-64]}, 0) OK
19mS[ 1] testprog(14107:4294981371): getpagesize() = 16384
19mS[ 1] testprog(14107:4294981371): brk(0x10018000) OK
19mS[ 1] testprog(14107:4294981371): ulimit(4, 0) = 1024
19mS[ 1] testprog(14107:4294981371): syssgi(SGI_USE_FP_BCOPY, 0, 0x2408, 0xffffffff, 0x2400, 0x1) = 0
19mS[ 1] testprog(14107:4294981371): brk(0x1001c000) OK
19mS[ 1] testprog(14107:4294981371): brk(0x10020000) OK
19mS[ 1] testprog(14107:4294981371): brk(0x10024000) OK
20mS[ 1] testprog(14107:4294981371): syssgi(SGI_TOSSTSAVE) OK
20mS[ 1] testprog(14107:4294981371): ioctl(1, __OLD_TCGETA, <bad indirect __old_termio param - len 30>) OK
20mS[ 1] testprog(14107:4294981371): write(1, "Main begin\n", 11) = 11
21mS[ 1] testprog(14107:4294981371): write(1, "get_value thread is 65536\n", 26) = 26
21mS[ 1] testprog(14107:4294981371): getpagesize() = 16384
21mS[ 1] testprog(14107:4294981371): brk(0x1004c000) OK
21mS[ 1] testprog(14107:4294981371): mprotect(0x10024000, 16384, 0) OK
21mS[ 1] testprog(14107:4294981371): brk(0x10074000) OK
21mS[ 1] testprog(14107:4294981371): mprotect(0x1004c000, 16384, 0) OK
21mS[ 1] testprog(14107:4294981371): nsproc(0xfa68790, PR_SPROC|PR_SFDS|PR_SDIR|PR_SUMASK|PR_SULIMIT|PR_SID|PR_SADDR|PR_NOLIBC(0x20000ff), 0x10047c20, 0, 0x2)
22mS[ 1] testprog(14107:4294981376): END-nsproc() = 0
22mS[ 1] testprog(14107:4294981376): prctl(PR_THREAD_CTL, PR_THREAD_BLOCK, 0x200000, 0xc068d58)
22mS[ 1] testprog(14107:4294981371): END-nsproc() = 1
22mS[ 1] testprog(14107:4294981371): write(1, "thread 65537 doit 1\n", 20) = 20
22mS[ 1] testprog(14107:4294981371): prctl(PR_THREAD_CTL, PR_THREAD_UNBLOCK, 0x1, 0) = 0
22mS[ 1] testprog(14107:4294981376): END-prctl() = 0
22mS[ 1] testprog(14107:4294981376): write(1, "thread 65538 doit 2\n", 20) = 20
22mS[ 1] testprog(14107:4294981376): gettimeofday({sec=1583578140, usec=335911}) OK
22mS[ 1] testprog(14107:4294981376): sysconf(_SC_CLK_TCK) = 100
22mS[ 1] testprog(14107:4294981376): sginap(101)
23mS[ 1] testprog(14107:4294981371): gettimeofday({sec=1583578140, usec=336107}) OK
23mS[ 1] testprog(14107:4294981371): sginap(101)
1032mS[ 1] testprog(14107:4294981371): END-sginap() = 0
1032mS[ 1] testprog(14107:4294981371): gettimeofday({sec=1583578141, usec=345961}) OK
1032mS[ 1] testprog(14107:4294981371): write(1, "thread 65537 breakonme 1\n", 25) = 25
1033mS[ 1] testprog(14107:4294981371): prctl(PR_THREAD_CTL, PR_THREAD_BLOCK, 0x200000, 0xc068d58)
1033mS[ 1] testprog(14107:4294981376): END-sginap() = 0
1033mS[ 1] testprog(14107:4294981376): gettimeofday({sec=1583578141, usec=346450}) OK
1033mS[ 1] testprog(14107:4294981376): write(1, "thread 65538 breakonme 2\n", 25) = 25
1033mS[ 1] testprog(14107:4294981376): prctl(PR_THREAD_CTL, PR_THREAD_UNBLOCK, 0, 0) = 0
1033mS[ 1] testprog(14107:4294981376): prctl(PR_THREAD_CTL, PR_THREAD_BLOCK, 0x10048838, 0xc068d58)
1033mS[ 1] testprog(14107:4294981371): END-prctl() = 0
1033mS[ 1] testprog(14107:4294981371): write(1, "Main end. value is 8\n", 21) = 21
1033mS[ 1] testprog(14107:4294981371): exit(0)
1034mS[ 1] testprog(14107:4294981376): received signal SIGKILL
System call summary:
Average Total
Name #Calls Time(ms) Time(ms)
-----------------------------------------
sginap 2 1010.15 2020.31
execve 1 1.40 1.40
elfmap 6 0.17 1.04
open 17 0.05 0.80
prctl 6 0.12 0.70
nsproc 1 0.54 0.54
write 7 0.04 0.28
read 6 0.03 0.15
ioctl 1 0.13 0.13
mmap 4 0.03 0.11
brk 6 0.01 0.06
close 9 0.01 0.05
mprotect 2 0.02 0.04
syssgi 5 0.00 0.02
sigaction 2 0.01 0.01
gettimeofday 4 0.00 0.01
getpagesize 4 0.00 0.01
sysconf 3 0.00 0.01
sigreturn 1 0.01 0.01
sysinfo 1 0.00 0.00
sysmp 1 0.00 0.00
ulimit 1 0.00 0.00
getrlimit 1 0.00 0.00
getuid 2 0.00 0.00
getgid 2 0.00 0.00
exit 1 0.00 0.00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment