From: David Ahern Date: Mon, 30 May 2022 15:54:59 +0000 (-0600) Subject: Merge branch 'ss-threads' into next X-Git-Tag: v6.0.0~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d889b151f958a115b8b7e71e5f79aa4e1a2cbe13;p=thirdparty%2Fiproute2.git Merge branch 'ss-threads' into next Peilin Ye says: ==================== From: Peilin Ye 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. ==================== Signed-off-by: David Ahern --- d889b151f958a115b8b7e71e5f79aa4e1a2cbe13