Message ID | cover.1653446538.git.peilin.ye@bytedance.com (mailing list archive) |
---|---|
Headers | show |
Series | ss: Introduce -T, --threads option | expand |
Hello: This series was applied to iproute2/iproute2-next.git (main) by David Ahern <dsahern@kernel.org>: On Tue, 24 May 2022 19:51:15 -0700 you wrote: > From: Peilin Ye <peilin.ye@bytedance.com> > > Hi all, > > This patchset adds a new ss option, -T (--threads), to show thread > information. It extends the -p (--processes) option, and should be useful > for debugging, monitoring multi-threaded applications. Example output: > > [...] Here is the summary with links: - [iproute2-next,1/7] ss: Use assignment-suppression character in sscanf() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=2d866c6d93db - [iproute2-next,2/7] ss: Remove unnecessary stack variable 'p' in user_ent_hash_build() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=b38831bc23c4 - [iproute2-next,3/7] ss: Do not call user_ent_hash_build() more than once https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=cd845a85681b - [iproute2-next,4/7] ss: Delete unnecessary call to snprintf() in user_ent_hash_build() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=ea3b57ec3991 - [iproute2-next,5/7] ss: Fix coding style issues in user_ent_hash_build() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=210018bfe99b - [iproute2-next,6/7] ss: Factor out fd iterating logic from user_ent_hash_build() https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=12d491e58ff5 - [iproute2-next,7/7] ss: Introduce -T, --threads option https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=e2267e68b9b5 You are awesome, thank you!
From: Peilin Ye <peilin.ye@bytedance.com> Hi all, This patchset adds a new ss option, -T (--threads), to show thread information. It extends the -p (--processes) option, and should be useful for debugging, monitoring multi-threaded applications. Example output: $ ss -ltT "sport = 1234" State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 100 0.0.0.0:1234 0.0.0.0:* users:(("test",pid=2932547,tid=2932548,fd=3),("test",pid=2932547,tid=2932547,fd=3)) It implies -p i.e. it outputs all threads in the thread group, including the thread group leader. When -T is used, -Z and -z also show SELinux contexts for threads. [1-5/7] are small clean-ups for the user_ent_hash_build() function. [6/7] factors out logic iterating $PROC_ROOT/$PID/fd/ from user_ent_hash_build() to make [7/7] easier. [7/7] actually implements the feature. Thanks, Peilin Ye (7): ss: Use assignment-suppression character in sscanf() ss: Remove unnecessary stack variable 'p' in user_ent_hash_build() ss: Do not call user_ent_hash_build() more than once ss: Delete unnecessary call to snprintf() in user_ent_hash_build() ss: Fix coding style issues in user_ent_hash_build() ss: Factor out fd iterating logic from user_ent_hash_build() ss: Introduce -T, --threads option man/man8/ss.8 | 8 +- misc/ss.c | 230 +++++++++++++++++++++++++++++--------------------- 2 files changed, 142 insertions(+), 96 deletions(-)