iproute2/misc
Peilin Ye e2267e68b9 ss: Introduce -T, --threads option
The -p, -Z and -z options only show process (thread group leader)
information.  For example, if the thread group leader has exited, but
another thread in the group is still using a socket, ss -[pZz] does not
show it.

Add a new option, -T (--threads), to show thread information.  It implies
the -p option.  For example, imagine process A and thread B (in the same
group) using the same socket.  ss -p only shows A:

  $ ss -ltp "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,fd=3))

ss -T shows A and B:

  $ 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))

If -T is used, -Z and -z also show SELinux contexts for threads.

Rename some variables (from "process" to "task", for example) since we
use them for both processes and threads.

Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-05-30 09:54:28 -06:00
..
.gitignore make yacc usage POSIX compatible 2020-01-20 09:43:22 -08:00
arpd.c libnetlink: Add filter function to rtnl_neighdump_req 2019-01-04 12:17:11 -08:00
ifstat.c libnetlink: Add filtering to rtnl_statsdump_req_filter() 2022-04-27 20:12:42 -06:00
lnstat_util.c lnstat_util: Make sure buffer is NUL-terminated 2017-09-01 12:10:54 -07:00
lnstat.c lnstat: fix strdup leak in -w argument parsing 2022-02-16 12:14:35 -08:00
lnstat.h lnstat: use same version as iproute2 2020-08-03 10:02:47 -07:00
Makefile ss: add checks for bc filter support 2020-05-13 14:28:38 +00:00
nstat.c cmd: use spaces instead of tabs for usage indentation 2021-10-06 10:00:49 -07:00
rtacct.c replace SNAPSHOT with auto-generated version string 2020-08-03 10:02:47 -07:00
ss_util.h ss: add checks for bc filter support 2020-05-13 14:28:38 +00:00
ss.c ss: Introduce -T, --threads option 2022-05-30 09:54:28 -06:00
ssfilter_check.c ss: add checks for bc filter support 2020-05-13 14:28:38 +00:00
ssfilter.h ss: add checks for bc filter support 2020-05-13 14:28:38 +00:00
ssfilter.y ss: add checks for bc filter support 2020-05-13 14:28:38 +00:00