Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perf-profiler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matheus Stolet
perf-profiler
Commits
f75b9247
Commit
f75b9247
authored
3 months ago
by
stolet
Browse files
Options
Downloads
Patches
Plain Diff
Add more functions to breakdown different stacks
parent
be312fd6
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
config.c
+1
-1
1 addition, 1 deletion
config.c
postprocessing/exp_analysis.py
+3
-1
3 additions, 1 deletion
postprocessing/exp_analysis.py
postprocessing/profiling.py
+5
-1
5 additions, 1 deletion
postprocessing/profiling.py
postprocessing/splittcp.py
+134
-6
134 additions, 6 deletions
postprocessing/splittcp.py
with
143 additions
and
9 deletions
config.c
+
1
−
1
View file @
f75b9247
...
...
@@ -19,7 +19,7 @@ static struct config_counter default_counters[] = {
{
"BR_INST_RETIRED:NEAR_TAKEN"
,
400009
},
{
"BR_MISP_RETIRED:ALL_BRANCHES"
,
400009
},
{
"CPU_CLK_THREAD_UNHALTED:ONE_THREAD_ACTIVE"
,
2000003
},
//
{ "CPU_CLK_THREAD_UNHALTED:REF_XCLK_ANY", 2503 },
{
"CPU_CLK_THREAD_UNHALTED:REF_XCLK_ANY"
,
2503
},
{
"CPU_CLK_UNHALTED:ONE_THREAD_ACTIVE"
,
2503
},
{
"CPU_CLK_UNHALTED"
,
500003
},
{
"CPU_CLK_UNHALTED:REF_XCLK"
,
2503
},
...
...
This diff is collapsed.
Click to expand it.
postprocessing/exp_analysis.py
+
3
−
1
View file @
f75b9247
...
...
@@ -32,6 +32,9 @@ elif sys.argv[2] == 'stcp-fp':
elif
sys
.
argv
[
2
]
==
'
stcp-app
'
:
tids
=
find_tids_prefix
(
md
,
'
echo-w
'
)
classifier
=
classify_stcp_app
elif
sys
.
argv
[
2
]
==
'
stcp-netserver
'
:
tids
=
find_tids_prefix
(
md
,
'
netserver
'
)
classifier
=
classify_stcp_app
elif
sys
.
argv
[
2
]
==
'
stcp
'
:
tids_app
=
find_tids_prefix
(
md
,
'
echo-w
'
)
tids_stcp
=
find_tids_prefix
(
md
,
'
stcp-fp-
'
)
...
...
@@ -45,7 +48,6 @@ elif sys.argv[2] == 'ix':
tids
=
find_tids_prefix
(
md
,
'
ix
'
)
classifier
=
classify_ix
sgs
=
sgs_filter
(
sgs
,
lambda
a
:
a
[
'
tid
'
]
in
tids
)
sgs
=
sgs_aggregate
(
sgs
,
lambda
a
:
a
.
mask_out
(
'
tid
'
))
...
...
This diff is collapsed.
Click to expand it.
postprocessing/profiling.py
+
5
−
1
View file @
f75b9247
...
...
@@ -143,7 +143,10 @@ class SGAnalysis(object):
if
x
is
not
None
:
return
x
return
getattr
(
self
,
'
get_
'
+
ev
)()
try
:
return
getattr
(
self
,
'
get_
'
+
ev
)()
except
Exception
:
return
0
def
add
(
self
,
a
,
b
):
...
...
@@ -175,6 +178,7 @@ class SGAnalysis(object):
def
load_file
(
path
):
with
open
(
path
,
'
r
'
)
as
f
:
data
=
json
.
load
(
f
)
return
load_from_object
(
data
)
def
load_exp_file
(
path
):
...
...
This diff is collapsed.
Click to expand it.
postprocessing/splittcp.py
+
134
−
6
View file @
f75b9247
...
...
@@ -5,8 +5,15 @@ def classify_stcp(attrs):
'
poll_queues
'
,
'
fast_appctx_poll_pf
'
,
'
fast_appctx_poll_fetch
'
,
'
fast_appctx_poll_fetch_all
'
,
'
fast_appctx_poll_fetch_active
'
'
fast_appctx_poll_pf_active
'
,
'
fast_appctx_poll_pf_all
'
,
'
flow_poll_skiplist
'
,
'
poll_active_queues
'
,
'
fast_appctx_poll_bump
'
,
'
qman_set
'
,
'
tas_qman_set
'
,
'
utils_rng_gen32
'
,
'
fast_flows_bump
'
,
'
poll_qman_fwd.isra.6
'
,
...
...
@@ -14,28 +21,40 @@ def classify_stcp(attrs):
'
tx_phase2
'
:
set
([
'
qman_poll
'
,
'
tas_qman_poll
'
,
'
poll_qman
'
,
'
fast_flows_qman
'
,
'
fast_flows_qman_pfbufs
'
,
'
fast_flows_qman_pf
'
,
'
flow_tx_read
'
,
'
fast_flows_qman_pfbufs
'
,
'
flow_tx_segment_gre
'
,
'
fast_flows_retransmit
'
,
]),
'
rx
'
:
set
([
'
fast_flows_packet
'
,
'
fast_flows_packet_gre
'
,
'
fast_actx_rxq_probe
'
,
'
fast_actx_rxq_probe_all
'
,
'
fast_actx_rxq_probe_active
'
,
'
fast_actx_rxq_probe.isra.0
'
,
'
fast_flows_packet_fss
'
,
'
fast_flows_packet_fss_gre
'
,
'
poll_rx
'
,
'
fast_flows_packet_parse
'
,
'
fast_flows_packet_parse_gre
'
,
'
arx_cache_flush
'
,
'
fast_actx_rxq_alloc
'
,
'
rxq_cq_process_v
'
,
]),
'
common
'
:
set
([
'
dataplane_loop
'
,
'
bufcache_prealloc
'
,
'
qman_timestamp
'
,
'
spend_budget
'
,
'
rte_memcpy_generic
'
,
'
common_ring_mc_dequeue
'
,
'
common_ring_mp_enqueue
'
,
...
...
@@ -44,6 +63,10 @@ def classify_stcp(attrs):
'
driver
'
:
set
([
'
i40e_recv_pkts_vec
'
,
'
i40e_xmit_pkts
'
,
'
mlx5_tx_burst_sc_empw
'
,
'
mlx5_rx_burst_vec
'
,
'
mlx5_tx_handle_completion
'
,
'
mlx5_tx_handle_completion
'
,
]),
'
kernel
'
:
set
([
...
...
@@ -75,13 +98,17 @@ def classify_stcp_alt(attrs):
'
fast_actx_rxq_probe
'
,
'
fast_appctx_poll_pf
'
,
'
fast_appctx_poll_fetch
'
,
'
flow_tx_segment_gre
'
,
'
tas_qman_poll
'
,
'
fast_appctx_poll_bump
'
]),
'
rx
'
:
set
([
'
fast_flows_packet
'
,
'
fast_flows_packet_gre
'
,
'
i40e_recv_pkts_vec
'
,
'
fast_flows_packet_fss
'
,
'
poll_rx
'
,
'
fast_flows_packet_parse
'
,
'
fast_flows_packet_parse_gre
'
,
'
arx_cache_flush
'
,
'
fast_actx_rxq_alloc
'
]),
'
qman
'
:
set
([
...
...
@@ -117,16 +144,24 @@ def classify_stcp_alt(attrs):
def
classify_stcp_app
(
attrs
):
if
attrs
[
'
dso
'
].
startswith
(
'
libc
'
):
return
"
libc
"
sym
=
attrs
[
'
symbol
'
]
sockets_syms
=
set
([
'
lwip_epoll_wait
'
,
'
lwip_read
'
,
'
lwip_write
'
,
'
flextcp_epoll_set
'
,
'
ep_poll_tas.isra.0
'
,
'
flextcp_sockctx_poll
'
,
'
flextcp_fd_slookup
'
,
'
flextcp_sockctx_get
'
,
'
flextcp_fd_release
'
,
'
flextcp_fd_srelease
'
,
'
tas_write
'
,
'
tas_read
'
,
'
write
'
,
'
read
'
,
'
__tls_get_addr
'
,
...
...
@@ -134,7 +169,10 @@ def classify_stcp_app(attrs):
'
flextcp_sockctx_poll_n
'
,
'
epoll_wait
'
,
'
flextcp_fd_elookup
'
,
'
tas_sock_move
'
,
'
flextcp_sockctx_getfull
'
,
'
.plt
'
,
'
.plt.sec
'
,
])
stack_syms
=
set
([
'
flextcp_context_poll
'
,
...
...
@@ -174,12 +212,35 @@ def classify_ovs(attrs):
elif
attrs
[
'
dso
'
].
startswith
(
'
libpthread
'
):
return
'
libc
'
elif
attrs
[
'
dso
'
].
startswith
(
'
ovs-vswitchd
'
)
or
attrs
[
'
dso
'
].
startswith
(
'
pmd
'
):
return
classify_ovs_vswitchd
(
attrs
)
return
'
ovs-
'
+
classify_ovs_vswitchd
(
attrs
)
else
:
return
'
other
'
def
classify_ovs_vswitchd
(
attrs
):
return
"
ovs
"
sym
=
attrs
[
'
symbol
'
]
m
=
{
'
virtio
'
:
set
([
'
virtio_dev_rx_split
'
,
'
virtio_dev_tx_split_legacy
'
,
]),
'
driver
'
:
set
([
'
mlx5_rx_burst_vec
'
,
]),
'
vhost
'
:
set
([
'
rte_vhost_dequeue_burst
'
,
'
netdev_dpdk_vhost_rxq_recv
'
,
'
netdev_dpdk_vhost_send
'
,
'
rte_vhost_enqueue_burst
'
,
]),
}
for
c
in
m
.
keys
():
if
sym
in
m
[
c
]:
return
c
return
'
other
'
def
classify_linux
(
attrs
):
if
attrs
[
'
dso
'
]
==
'
vmlinux
'
:
...
...
@@ -236,6 +297,7 @@ def classify_linux_kernel(attrs):
'
tcp_delack_timer_handler
'
,
'
tcp_delack_timer
'
,
'
tcp_update_skb_after_send
'
,
'
__tcp_send_ack.part.0
'
,
'
tcp_sendmsg_locked
'
,
'
tcp_tso_segs
'
,
...
...
@@ -291,6 +353,9 @@ def classify_linux_kernel(attrs):
'
tcp_tx_timestamp
'
,
'
tcp_newly_delivered
'
,
'
tcp_rbtree_insert
'
,
'
tcp_recvmsg_locked
'
,
'
__nf_conntrack_find_get
'
,
'
nf_conntrack_tcp_packet
'
,
]),
'
ip
'
:
set
([
...
...
@@ -301,6 +366,7 @@ def classify_linux_kernel(attrs):
'
ip_queue_xmit
'
,
'
__inet_lookup_established
'
,
'
inet_ehashfn
'
,
'
__siphash_unaligned
'
,
'
inet_recvmsg
'
,
'
inet_sendmsg
'
,
'
__ip_local_out
'
,
...
...
@@ -314,6 +380,13 @@ def classify_linux_kernel(attrs):
'
ip_send_check
'
,
'
ip_copy_addrs
'
,
'
raw_local_deliver
'
,
'
nf_nat_ipv4_out
'
,
'
nf_nat_inet_fn
'
,
'
ipv4_confirm
'
,
'
apparmor_ipv4_postroute
'
,
'
nf_nat_ipv4_local_fn
'
,
'
ipv4_conntrack_defrag
'
,
'
ipv4_get_l4proto
'
,
#questionably IP
'
packet_rcv
'
,
...
...
@@ -330,6 +403,11 @@ def classify_linux_kernel(attrs):
'
do_csum
'
,
'
__ip_queue_xmit
'
,
'
validate_xmit_xfrm
'
,
'
nf_hook_slow
'
,
'
is_last_ethertype_ip.constprop.0
'
,
'
nf_conntrack_in
'
,
'
nf_ct_deliver_cached_events
'
,
'
nf_ct_seq_offset
'
,
]),
'
timers
'
:
set
([
...
...
@@ -351,15 +429,18 @@ def classify_linux_kernel(attrs):
'
pvclock_clocksource_read
'
,
'
enqueue_timer
'
,
'
kvm_clock_get_cycles
'
,
'
atomic_notifier_call_chain
'
,
]),
'
bufmgt
'
:
set
([
'
__slab_free
'
,
'
slab_free_freelist_hook.constprop.0
'
,
'
skb_release_data
'
,
'
__skb_clone
'
,
'
kmem_cache_alloc
'
,
'
kmem_cache_free
'
,
'
kmem_cache_free_bulk
'
,
'
__alloc_skb
'
,
'
skb_release_head_state
'
,
'
kmem_cache_alloc_node
'
,
...
...
@@ -378,6 +459,7 @@ def classify_linux_kernel(attrs):
'
skb_release_all
'
,
'
skb_clone
'
,
'
skb_copy_datagram_iter
'
,
'
__skb_datagram_iter
'
,
'
kfree
'
,
'
sk_stream_alloc_skb
'
,
'
__slab_alloc
'
,
...
...
@@ -429,6 +511,7 @@ def classify_linux_kernel(attrs):
'
_raw_spin_lock_irqsave
'
,
'
lock_sock_nested
'
,
'
release_sock
'
,
'
__release_sock
'
,
'
__local_bh_enable_ip
'
,
'
__wake_up_common
'
,
'
rcu_irq_exit
'
,
...
...
@@ -442,6 +525,7 @@ def classify_linux_kernel(attrs):
'
_cond_resched
'
,
'
__pv_queued_spin_lock_slowpath
'
,
'
__raw_callee_save___pv_queued_spin_unlock
'
,
'
sync_regs
'
,
]),
'
sockets
'
:
set
([
...
...
@@ -466,6 +550,7 @@ def classify_linux_kernel(attrs):
'
vfs_read
'
,
'
copy_from_iter
'
,
'
copy_to_iter
'
,
'
simple_copy_to_iter
'
,
'
sock_def_readable
'
,
'
sock_poll
'
,
'
sock_put
'
,
...
...
@@ -485,6 +570,7 @@ def classify_linux_kernel(attrs):
'
entry_SYSCALL_64
'
,
'
entry_SYSCALL_64_after_swapgs
'
,
'
entry_SYSCALL_64_fastpath
'
,
'
entry_SYSCALL_64_safe_stack
'
,
'
sock_sendmsg
'
,
'
__sock_sendmsg
'
,
'
SyS_read
'
,
...
...
@@ -493,6 +579,8 @@ def classify_linux_kernel(attrs):
'
__memmove
'
,
'
sock_recvmsg
'
,
'
__sys_sendto
'
,
'
skb_gro_receive
'
,
'
sk_wait_data
'
,
'
syscall_return_via_sysret
'
,
'
copy_user_enhanced_fast_string
'
,
...
...
@@ -523,6 +611,9 @@ def classify_linux_kernel(attrs):
'
__get_xps_queue_idx
'
,
'
__x64_sys_sendto
'
,
'
sockfd_lookup_light
'
,
'
syscall_exit_to_user_mode
'
,
'
__sock_wfree
'
,
'
__sys_recvfrom
'
,
]),
'
driver_tx
'
:
set
([
...
...
@@ -534,6 +625,8 @@ def classify_linux_kernel(attrs):
'
ixgbe_fdir_add_signature_filter_82599
'
,
'
validate_xmit_skb_list
'
,
'
validate_xmit_skb
'
,
'
native_write_msr
'
,
'
dma_map_page_attrs
'
,
'
dev_hard_start_xmit
'
,
'
__dev_queue_xmit
'
,
...
...
@@ -545,9 +638,16 @@ def classify_linux_kernel(attrs):
'
i40e_features_check
'
,
'
start_xmit
'
,
'
virtqueue_kick_prepare
'
,
'
virtqueue_add_outbuf
'
,
'
virtqueue_enable_cb_delayed
'
,
'
mlx5e_xmit
'
,
'
mlx5e_tx_mpwqe_session_start
'
,
'
mlx5e_poll_tx_cq
'
,
'
mlx5e_txqsq_wake
'
,
'
mlx5e_poll_xdpsq_cq
'
,
'
mlx5e_txwqe_build_dsegs
'
,
'
mlx5e_sq_xmit_prepare
'
,
'
mlx5e_select_queue
'
,
'
mlx5e_completion_event
'
,
]),
'
driver_rx
'
:
set
([
...
...
@@ -558,20 +658,48 @@ def classify_linux_kernel(attrs):
'
net_rx_action
'
,
'
ixgbe_update_itr.isra.66
'
,
'
irq_entries_start
'
,
'
__irqentry_text_start
'
,
'
__irqentry_text_end
'
,
'
do_IRQ
'
,
'
handle_irq_event_percpu
'
,
'
tasklet_action_common.constprop.0
'
,
'
handle_edge_irq
'
,
'
__do_softirq
'
,
'
__netif_receive_skb
'
,
'
apic_ack_irq
'
,
'
__softirqentry_text_start
'
,
'
i40e_clean_rx_irq
'
,
'
i40e_napi_poll
'
,
'
i40e_alloc_rx_buffers
'
,
'
i40e_msix_clean_rings
'
,
'
virtqueue_get_buf_ctx
'
,
'
detach_buf_split
'
,
'
mlx5_eq_comp_int
'
,
'
mlx5e_skb_from_cqe_mpwrq_linear
'
,
'
mlx5e_handle_rx_cqe_mpwrq
'
,
'
mlx5e_poll_rx_cq
'
,
'
mlx5e_handle_rx_dim
'
,
'
mlx5e_features_check
'
,
'
mlx5e_napi_poll
'
,
]),
'
kvm
'
:
set
([
'
kvm_irq_delivery_to_apic_fast
'
,
'
kvm_arch_vcpu_should_kick
'
,
'
kvm_apic_map_get_dest_lapic
'
,
'
kvm_set_msi_irq
'
,
'
kvm_arch_set_irq_inatomic
'
,
'
kvm_vcpu_kick
'
]),
'
virtio
'
:
set
([
'
virtqueue_kick_prepare
'
,
'
virtqueue_add_outbuf
'
,
'
virtqueue_enable_cb_delayed
'
,
'
virtqueue_get_buf_ctx
'
,
])
}
for
c
in
m
.
keys
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment