linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] ss: add option to print socket information on one line
       [not found] <1556674718-5081-1-git-send-email-johunt@akamai.com>
@ 2019-05-30  9:11 ` Markus Elfring
  2019-06-01  8:36 ` ss: Checking efficient analysis for network connections Markus Elfring
  1 sibling, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2019-05-30  9:11 UTC (permalink / raw)
  To: Josh Hunt, David Ahern, netdev; +Cc: Stephen Hemminger, LKML

This software update caught also my development attention a moment ago.


> +++ b/misc/ss.c
> @@ -3973,7 +3975,10 @@ static int packet_show_sock(struct nlmsghdr *nlh, void *arg)
>
>  	if (show_details) {
>  		if (pinfo) {
> -			out("\n\tver:%d", pinfo->pdi_version);
> +			if (oneline)
> +				out(" ver:%d", pinfo->pdi_version);
> +			else
> +				out("\n\tver:%d", pinfo->pdi_version);
>  			out(" cpy_thresh:%d", pinfo->pdi_copy_thresh);
>  			out(" flags( ");
>  			if (pinfo->pdi_flags & PDI_RUNNING)

I would find it nicer to use the ternary operator here.

+			out(oneline ? " ver:%d" : "\n\tver:%d",
+			    pinfo->pdi_version);


How do you think about to use more succinct statement variants?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ss: Checking efficient analysis for network connections
       [not found] <1556674718-5081-1-git-send-email-johunt@akamai.com>
  2019-05-30  9:11 ` [PATCH v2] ss: add option to print socket information on one line Markus Elfring
@ 2019-06-01  8:36 ` Markus Elfring
  2019-06-01 23:48   ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Markus Elfring @ 2019-06-01  8:36 UTC (permalink / raw)
  To: Josh Hunt, David Ahern, Stephen Hemminger, netdev; +Cc: LKML

> Multi-line output in ss makes it difficult to search for things with grep.

I became more concerned about efficient data processing for the
provided information. There are further software development possibilities
to consider, aren't there?

The chosen data formats influence the software situation considerably.

* Information is exported together with extra space characters.
  Other field delimiters can occasionally be nicer.

* Regular expressions are useful to extract data from text lines.
  But other programming interfaces are safer to work with data structures.
  The mentioned program can be used to filter the provided input.
  But if you would like to work with information from the filtered records,
  you would need to repeat some data processing by the calling process
  so that items will be converted into structured elements.
  Would you like to avoid duplicate work?


I imagine then that it would be also nicer to perform filtering based on
configurable constraints at the data source directly.
How much can Linux help more in this software area?
How do you think about such ideas?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ss: Checking efficient analysis for network connections
  2019-06-01  8:36 ` ss: Checking efficient analysis for network connections Markus Elfring
@ 2019-06-01 23:48   ` David Miller
  2019-06-02  5:40     ` Markus Elfring
                       ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: David Miller @ 2019-06-01 23:48 UTC (permalink / raw)
  To: Markus.Elfring; +Cc: johunt, dsahern, stephen, netdev, linux-kernel

From: Markus Elfring <Markus.Elfring@web.de>
Date: Sat, 1 Jun 2019 10:36:40 +0200

> I imagine then that it would be also nicer to perform filtering based on
> configurable constraints at the data source directly.
> How much can Linux help more in this software area?
> How do you think about such ideas?

If you use netlink operations directly, you can have the kernel filter
on various criteria and only get the socket entries you are interested
in.

This whole discussion has zero to do with what text format 'ss' outputs.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ss: Checking efficient analysis for network connections
  2019-06-01 23:48   ` David Miller
@ 2019-06-02  5:40     ` Markus Elfring
  2019-06-13 14:40     ` Markus Elfring
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2019-06-02  5:40 UTC (permalink / raw)
  To: David Miller, David Ahern, Stephen Hemminger
  Cc: Josh Hunt, netdev, linux-kernel

> If you use netlink operations directly,

Thanks for such feedback.

Should this programming interface become better known?


> you can have the kernel filter on various criteria
> and only get the socket entries you are interested in.

This is good to know.


> This whole discussion has zero to do with what text format 'ss' outputs.

Some software components are affected here.

The socket statistic tool is using data from the directory “/proc/net”.

* Provided text files refer to known Linux data formats.
  Can it happen to work with other data formats there?

* The analysis program can also be extended for the support
  of additional data formats, can't it?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ss: Checking efficient analysis for network connections
  2019-06-01 23:48   ` David Miller
  2019-06-02  5:40     ` Markus Elfring
@ 2019-06-13 14:40     ` Markus Elfring
  2019-07-23  8:25     ` Markus Elfring
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2019-06-13 14:40 UTC (permalink / raw)
  To: David Miller, David Ahern, Stephen Hemminger
  Cc: Josh Hunt, netdev, linux-kernel

> This whole discussion has zero to do with what text format 'ss' outputs.

Would you like to support the clarification of additional data formats
for the usage of specific information by tools for socket statistics
(from the directory “/proc/net” and related ones)?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ss: Checking efficient analysis for network connections
  2019-06-01 23:48   ` David Miller
  2019-06-02  5:40     ` Markus Elfring
  2019-06-13 14:40     ` Markus Elfring
@ 2019-07-23  8:25     ` Markus Elfring
  2019-09-16 10:32     ` ss: Checking selected network ports Markus Elfring
  2019-10-22  6:00     ` [RFC] " Markus Elfring
  4 siblings, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2019-07-23  8:25 UTC (permalink / raw)
  To: David Miller, David Ahern, Stephen Hemminger, netdev
  Cc: Josh Hunt, linux-kernel

> This whole discussion has zero to do with what text format 'ss' outputs.

Do any more software developers care for the clarification of
additional data formats for the usage of specific information by tools
around socket statistics (from the directory “/proc/net” and related ones)?

Would you like to achieve any improvements in this area?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ss: Checking selected network ports
  2019-06-01 23:48   ` David Miller
                       ` (2 preceding siblings ...)
  2019-07-23  8:25     ` Markus Elfring
@ 2019-09-16 10:32     ` Markus Elfring
  2019-10-22  6:00     ` [RFC] " Markus Elfring
  4 siblings, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2019-09-16 10:32 UTC (permalink / raw)
  To: David Miller, David Ahern, Stephen Hemminger, netdev
  Cc: Josh Hunt, linux-kernel, kernel-janitors

> If you use netlink operations directly, you can have the kernel filter
> on various criteria and only get the socket entries you are interested in.

I suggest to take another look at software design options.


> This whole discussion has zero to do with what text format 'ss' outputs.

Is there a need to improve the software documentation any further?

Which programming interface should be used to check the receive queue
for a single port (without retrieving more network data before)?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] ss: Checking selected network ports
  2019-06-01 23:48   ` David Miller
                       ` (3 preceding siblings ...)
  2019-09-16 10:32     ` ss: Checking selected network ports Markus Elfring
@ 2019-10-22  6:00     ` Markus Elfring
  4 siblings, 0 replies; 8+ messages in thread
From: Markus Elfring @ 2019-10-22  6:00 UTC (permalink / raw)
  To: netdev, kernel-janitors, linux-doc
  Cc: linux-kernel, David Ahern, David Miller, Josh Hunt, Stephen Hemminger

> If you use netlink operations directly, you can have the kernel filter
> on various criteria and only get the socket entries you are interested in.

Do any developers care to take another look at current software design options?


> This whole discussion has zero to do with what text format 'ss' outputs.

Is there a need to improve the software documentation any further?

Which programming interface should be used to check the receive queue
for a single port (without retrieving more network data before)?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-10-22  6:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1556674718-5081-1-git-send-email-johunt@akamai.com>
2019-05-30  9:11 ` [PATCH v2] ss: add option to print socket information on one line Markus Elfring
2019-06-01  8:36 ` ss: Checking efficient analysis for network connections Markus Elfring
2019-06-01 23:48   ` David Miller
2019-06-02  5:40     ` Markus Elfring
2019-06-13 14:40     ` Markus Elfring
2019-07-23  8:25     ` Markus Elfring
2019-09-16 10:32     ` ss: Checking selected network ports Markus Elfring
2019-10-22  6:00     ` [RFC] " Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).