]> git.ipfire.org Git - thirdparty/iproute2.git/commit
Merge branch 'ss-threads' into next
authorDavid Ahern <dsahern@kernel.org>
Mon, 30 May 2022 15:54:59 +0000 (09:54 -0600)
committerDavid Ahern <dsahern@kernel.org>
Mon, 30 May 2022 15:54:59 +0000 (09:54 -0600)
commitd889b151f958a115b8b7e71e5f79aa4e1a2cbe13
treecfd8857fbb2dc437e9ec779d07b4ea036236d072
parent21c07b45688fee4e3b690816ecc4d5206d15a135
parente2267e68b9b56d29e381be1bfff465340c67992c
Merge branch 'ss-threads' into next

Peilin Ye  says:

====================

From: Peilin Ye <peilin.ye@bytedance.com>

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 <dsahern@kernel.org>