在我真个malloc的执行过程中共调用了8次的syswrite的系统调用,其中有两次来自于__lib_write, 两次来自于__memmove_avx_unaligned,然后__memmove_avx_unaligned中有两次是来自于funca,有两次是来自于funb,所以在总共的8次调用中,有两次是来自于funcb,有两次来自于funca.
这里并不是一个时间的关系呢;
Samples: 8 of event 'syscalls:sys_enter_write, Event count (approx.): 8 Children Self Command Shared Object Symbol ▒ - 100.00% 100.00% malloc malloc [.] __libc_write ▒ - 25.00% 0xa3437 ▒ __libc_write ▒ - 25.00% 0x860f20f983483fe1 ▒ __memmove_avx_unaligned ▒ generic_start_main ▒ - main ▒ - 12.50% funcb ▒ func1 ▒ func2 ▒ func3 ▒ __libc_write ▒ - 12.50% funca ▒ func1 ▒ func2 ▒ func3 ▒ __libc_write ▒ - 25.00% 0xa3031300a3437 ▒ __libc_write ▒ - 12.50% 0xa303130353532 ▒ __libc_write ▒ - 12.50% 0xa303130343132 ▒ __libc_write ▒ + 25.00% 0.00% malloc malloc [.] func3 ◆ + 25.00% 0.00% malloc [unknown] [.] 0x00000000000a3437 ▒ + 25.00% 0.00% malloc [unknown] [.] 0x000a3031300a3437 ▒ + 25.00% 0.00% malloc malloc [.] func2 ▒ + 25.00% 0.00% malloc malloc [.] func1 ▒ + 25.00% 0.00% malloc malloc [.] main ▒ + 25.00% 0.00% malloc malloc [.] generic_start_main ▒ + 25.00% 0.00% malloc malloc [.] __memmove_avx_unaligned ▒ + 25.00% 0.00% malloc [unknown] [.] 0x860f20f983483fe1 ▒ + 12.50% 0.00% malloc [unknown] [.] 0x000a303130343132 ▒ + 12.50% 0.00% malloc [unknown] [.] 0x000a303130353532 ▒ + 12.50% 0.00% malloc malloc [.] funca ▒ + 12.50% 0.00% malloc malloc [.] funcb ▒ ▒ ▒
为了能够更加精确地看到软件事件的发生,我们选择一个比较生僻的系统调用来观察 perf_event_open