Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcp #110

Open
heidsoft opened this issue Feb 15, 2023 · 0 comments
Open

tcp #110

heidsoft opened this issue Feb 15, 2023 · 0 comments

Comments

@heidsoft
Copy link
Owner

heidsoft commented Feb 15, 2023

perf stat -ae 'tcp:,sock:'

perf record -ae 'sock:inet_sock_set_state' --call-graph dwarf

perf report

Samples: 20  of event 'sock:inet_sock_set_state', Event count (approx.): 20
  Children      Self  Command  Shared Object      Symbol
+  100.00%     0.00%  python   python2.7          [.] _start
+  100.00%     0.00%  python   libc-2.31.so       [.] __libc_start_main (inlined)
+  100.00%     0.00%  python   python2.7          [.] Py_Main
+  100.00%     0.00%  python   python2.7          [.] PyRun_SimpleFileExFlags
+  100.00%     0.00%  python   python2.7          [.] PyRun_FileExFlags
+  100.00%     0.00%  python   python2.7          [.] PyEval_EvalCode
+  100.00%     0.00%  python   python2.7          [.] PyEval_EvalCodeEx
+  100.00%     0.00%  python   python2.7          [.] PyEval_EvalFrameEx
+  100.00%     0.00%  python   [kernel.kallsyms]  [k] entry_SYSCALL_64_after_hwframe
+  100.00%     0.00%  python   [kernel.kallsyms]  [k] do_syscall_64
+   90.00%    90.00%  python   [kernel.kallsyms]  [k] inet_sk_state_store
+   90.00%     0.00%  python   [kernel.kallsyms]  [k] tcp_set_state
+   70.00%     0.00%  python   [kernel.kallsyms]  [k] tcp_v4_do_rcv
+   60.00%     0.00%  python   python2.7          [.] PyObject_SetAttr
+   60.00%     0.00%  python   python2.7          [.] PyObject_GenericSetAttr
+   60.00%     0.00%  python   python2.7          [.] PyMember_SetOne
+   60.00%     0.00%  python   libc-2.31.so       [.] __GI___close (inlined)
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] syscall_exit_to_user_mode
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] exit_to_user_mode_prepare
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] task_work_run
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] ____fput
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] __fput
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] sock_close
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] __sock_release
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] inet_release
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] tcp_close
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] __tcp_close
+   60.00%     0.00%  python   [kernel.kallsyms]  [k] tcp_rcv_state_process
+   50.00%     0.00%  python   [kernel.kallsyms]  [k] __tcp_transmit_skb
+   50.00%     0.00%  python   [kernel.kallsyms]  [k] ip_queue_xmit
+   50.00%     0.00%  python   [kernel.kallsyms]  [k] __ip_queue_xmit
+   50.00%     0.00%  python   [kernel.kallsyms]  [k] ip_local_out

perf tcp

root@heidsoft-dev:~# perf script
python 12589 [000]  3120.823728: sock:inet_sock_set_state: family=AF_INET protocol=IPPROTO_TCP sport=0 dport=10000 sadd>
        ffffffff84db9a82 inet_sk_state_store+0x52 ([kernel.kallsyms])
        ffffffff84db9a82 inet_sk_state_store+0x52 ([kernel.kallsyms])
        ffffffff84d7718f tcp_set_state+0x8f ([kernel.kallsyms])
        ffffffff84d9673d tcp_v4_connect+0x26d ([kernel.kallsyms])
        ffffffff84db7150 __inet_stream_connect+0xd0 ([kernel.kallsyms])
        ffffffff84db744b inet_stream_connect+0x3b ([kernel.kallsyms])
        ffffffff84c91973 __sys_connect_file+0x63 ([kernel.kallsyms])
        ffffffff84c91a24 __sys_connect+0xa4 ([kernel.kallsyms])
        ffffffff84c91a7a __x64_sys_connect+0x1a ([kernel.kallsyms])
        ffffffff84f6156c do_syscall_64+0x5c ([kernel.kallsyms])
        ffffffff85000099 entry_SYSCALL_64_after_hwframe+0x61 ([kernel.kallsyms])
            7f03512db1d7 __libc_connect+0x147 (inlined)
            55697aac3777 [unknown] (/usr/bin/python2.7)
            55697aac48ca [unknown] (/usr/bin/python2.7)
            55697aa008bd PyEval_EvalFrameEx+0x2e0d (/usr/bin/python2.7)
            55697aa171c5 [unknown] (/usr/bin/python2.7)
            55697a9df106 PyObject_Call+0x46 (/usr/bin/python2.7)
            55697aa7469f [unknown] (/usr/bin/python2.7)
            55697a9df106 PyObject_Call+0x46 (/usr/bin/python2.7)
            55697aa03afc PyEval_EvalFrameEx+0x604c (/usr/bin/python2.7)
            55697a9fbd2d PyEval_EvalCodeEx+0x52d (/usr/bin/python2.7)
            55697a9fb7f9 PyEval_EvalCode+0x19 (/usr/bin/python2.7)
            55697aa2f2a3 [unknown] (/usr/bin/python2.7)
            55697aa2a0da PyRun_FileExFlags+0x8a (/usr/bin/python2.7)
            55697aa29158 PyRun_SimpleFileExFlags+0x168 (/usr/bin/python2.7)
            55697a9c6c7c Py_Main+0x58c (/usr/bin/python2.7)
            7f03511df0b2 __libc_start_main+0xf2 (inlined)

SYN Synchronization Used to create a TCP connection
ACK Acknowledgment Used to acknowledge the reception of data or synchronization packets
PSH Push Instruct the network stacks to bypass buffering
URG Urgent Indicates out-of-band data that must be processed by the network stacks before normal data
FIN Finish Gracefully terminate the TCP connection
RST Reset Immediately terminate the connection and drop any in-transit data

https://www.site24x7.com/learn/linux/tcp-flags.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant