From: Stephen Hemminger <stephen@networkplumber.org>
To: Harshith Hari <harshithhari000111@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 v2] ss: add -P/--process-age option to display process runtime
Date: Thu, 17 Sep 2026 12:46:46 -0700 [thread overview]
Message-ID: <20260917124646.4c39c0c5@phoenix.local> (raw)
In-Reply-To: <20260916213402.8481-1-harshithhari000111@gmail.com>
On Thu, 17 Sep 2026 03:04:02 +0530
Harshith Hari <harshithhari000111@gmail.com> wrote:
> Add a new option (-P/--process-age) to display process uptime/age
> alongside process info inside socket user context output.
>
> Signed-off-by: Harshith Hari <harshithhari000111@gmail.com>
> ---
> v2:
> - Fixed patch whitespace and tab formatting.
> Signed-off-by: Harshith Hari <harshithhari000111@gmail.com>
> ---
> man/man8/ss.8 | 3 +
> misc/ss.c | 662 +++++++++++++++++++++++++++++---------------------
> 2 files changed, 385 insertions(+), 280 deletions(-)
>
> diff --git a/man/man8/ss.8 b/man/man8/ss.8
> index b0629b82..5f345c21 100644
> --- a/man/man8/ss.8
> +++ b/man/man8/ss.8
> @@ -163,6 +163,9 @@ the number of packets dropped before they are de-multiplexed into the socket
> .TP
> \.B \-P, \-\-process\-age
> Show process age/runtime alongside process socket information.
> +.TP
> +\.B \-P, \-\-process\-age
> +Show process age/runtime alongside process socket information.
> Show processes using sockets.
> .TP
> .B \-T, \-\-threads
> diff --git a/misc/ss.c b/misc/ss.c
> index 6c32455d..6058ca29 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -56,58 +56,58 @@ static int show_process_age;
>
> static void print_process_age(pid_t pid)
> {
> -char path[64];
> -FILE *f;
> -unsigned long long starttime;
> -double uptime = 0.0;
> -long clock_ticks = sysconf(_SC_CLK_TCK);
> -
> -f = fopen("/proc/uptime", "r");
> -if (!f)
> -return;
> -
> -if (fscanf(f, "%lf", &uptime) != 1) {
> -fclose(f);
> -return;
> -}
> -fclose(f);
> + char path[64];
> + FILE *f;
> + unsigned long long starttime;
> + double uptime = 0.0;
> + long clock_ticks = sysconf(_SC_CLK_TCK);
> +
> + f = fopen("/proc/uptime", "r");
> + if (!f)
> +
I don't think you understand how to submit patches.
This is repeated version where the diff is against your misformatted previous version.
And you did not listen to my feedback that the ss tool is about sockets
not processes. If you wanted to this kind of thing better off doing
some local tool that either scripts ss and ps output, or uses kernel API's
Don't need more growth in tools for this.
next prev parent reply other threads:[~2026-09-17 19:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 21:34 [PATCH iproute2 v2] ss: add -P/--process-age option to display process runtime Harshith Hari
2026-09-17 19:46 ` Stephen Hemminger [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-09-15 21:31 Harshith Hari
2026-09-16 4:23 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260917124646.4c39c0c5@phoenix.local \
--to=stephen@networkplumber.org \
--cc=harshithhari000111@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox