Я пытаюсь выяснить / измерить время выполнения каждой функции в процессе демона, используя perf и используя perf perf и скрипт сценария для его извлечения. Вот пример:
bgpd 5899 [007] 1039837.097947: probe_bgpd:in10: (472cd0)
472cd0 bgp_announce_route+0x0 (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.097989: probe_bgpd:in9: (471b30)
471b30 bgp_announce_table+0x0 (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098031: probe_bgpd:out9__return: (471b30 <- 47304f)
47304f bgp_announce_route+0x37f (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098045: probe_bgpd:out10__return: (472cd0 <- 47382b)
47382b bgp_peer_initial_announce+0x77b (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098058: probe_bgpd:in10: (472cd0)
472cd0 bgp_announce_route+0x0 (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098069: probe_bgpd:out10__return: (472cd0 <- 47382b)
47382b bgp_peer_initial_announce+0x77b (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098080: probe_bgpd:in10: (472cd0)
472cd0 bgp_announce_route+0x0 (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098090: probe_bgpd:out10__return: (472cd0 <- 47382b)
47382b bgp_peer_initial_announce+0x77b (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098101: probe_bgpd:in10: (472cd0)
472cd0 bgp_announce_route+0x0 (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098112: probe_bgpd:out10__return: (472cd0 <- 4739fd)
4739fd bgp_peer_initial_announce+0x94d (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098123: probe_bgpd:in10: (472cd0)
472cd0 bgp_announce_route+0x0 (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098133: probe_bgpd:out10__return: (472cd0 <- 4739fd)
4739fd bgp_peer_initial_announce+0x94d (/usr/bin/bgpd)
bgpd 5899 [007] 1039837.098144: probe_bgpd:in10: (472cd0)
472cd0 bgp_announce_route+0x0 (/usr/bin/bgpd)
Итак, очевидно, что функции вызываются внутри друг друга и несколько раз. Я не могу выяснить, какая запись связана с каким возвратом. Есть ли способ выяснить это?
Вот мой "perf probe -l":
probe_bgpd:in (on bgp_process in /usr/bin/bgpd)
probe_bgpd:in1 (on bgp_vrf_process in /usr/bin/bgpd)
probe_bgpd:in10 (on bgp_announce_route in /usr/bin/bgpd)
probe_bgpd:in11 (on bgp_clear_all_routes in /usr/bin/bgpd)
probe_bgpd:in12 (on bgp_rib_withdraw_process in /usr/bin/bgpd)
probe_bgpd:in2 (on bgp_info_sort in /usr/bin/bgpd)
probe_bgpd:in3 (on bgp_announce_check in /usr/bin/bgpd)
probe_bgpd:in4 (on bgp_sort_ri_list in /usr/bin/bgpd)
probe_bgpd:in5 (on bgp_rib_withdraw in /usr/bin/bgpd)
probe_bgpd:in6 (on bgp_update in /usr/bin/bgpd)
probe_bgpd:in7 (on bgp_withdraw in /usr/bin/bgpd)
probe_bgpd:in8 (on bgp_peer_process_nlri in /usr/bin/bgpd)
probe_bgpd:in9 (on bgp_announce_table in /usr/bin/bgpd)
probe_bgpd:out10__return (on bgp_announce_route%return in /usr/bin/bgpd)
probe_bgpd:out11__return (on bgp_clear_all_routes%return in /usr/bin/bgpd)
probe_bgpd:out12__return (on bgp_rib_withdraw_process%return in /usr/bin/bgpd)
probe_bgpd:out1__return (on bgp_vrf_process%return in /usr/bin/bgpd)
probe_bgpd:out2__return (on bgp_info_sort%return in /usr/bin/bgpd)
probe_bgpd:out3__return (on bgp_announce_check%return in /usr/bin/bgpd)
probe_bgpd:out4__return (on bgp_sort_ri_list%return in /usr/bin/bgpd)
probe_bgpd:out5__return (on bgp_rib_withdraw%return in /usr/bin/bgpd)
probe_bgpd:out6__return (on bgp_update%return in /usr/bin/bgpd)
probe_bgpd:out7__return (on bgp_withdraw%return in /usr/bin/bgpd)
probe_bgpd:out8__return (on bgp_peer_process_nlri%return in /usr/bin/bgpd)
probe_bgpd:out9__return (on bgp_announce_table%return in /usr/bin/bgpd)
probe_bgpd:out__return (on bgp_process%return in /usr/bin/bgpd)
Как прочитать сценарий perf и придать некоторое значение выводу?