public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail•com>
To: Stephen Hemminger <stephen@networkplumber•org>, netdev@vger•kernel.org
Cc: Stephen Hemminger <sthemmin@microsoft•com>
Subject: Re: [PATCH net-next] net: add network device notifier trace points
Date: Tue, 18 Dec 2018 20:38:48 -0700	[thread overview]
Message-ID: <3bb9fe50-87f9-a8b5-f886-9727d4e059e9@gmail.com> (raw)
In-Reply-To: <20181219022706.10611-1-sthemmin@microsoft.com>

On 12/18/18 7:27 PM, Stephen Hemminger wrote:
> There already are network trace points for transmit and receive but
> nothing for state changes.  Add network tracepoints for before and
> after netlink callback is done. This is simple (without extack or
> other info) but that could be added if useful. Network namespace id
> would also be helpful but hard to get a string for it.

That has been a sore spot for a long time. One option is to allocate a
namespace id relative to init_net as every namespace is created and then
use the nsid in tracepoints.

> 
> This is the result of a conversation about monitoring of link
> state changes with BPF. Parsing netlink is hard and unnecessary
> because the data exists (unserialized) already in the
> callbacks.
> 
>   #  cd /sys/kernel/debug/tracing
>   #  echo 1 > events/net/net_dev_notifier_entry/enable
>   #  echo 1 > events/net/net_dev_notifier/enable
>   #  ip li set dev eno1 down
>   #  ip li set dev eno1 up
>   #  cat trace
> 	# tracer: nop
> 	#
> 	#                              _-----=> irqs-off
> 	#                             / _----=> need-resched
> 	#                            | / _---=> hardirq/softirq
> 	#                            || / _--=> preempt-depth
> 	#                            ||| /     delay
> 	#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
> 	#              | |       |   ||||       |         |
> 		      ip-3194  [011] ....    74.926831: net_dev_notifier_entry: dev=eno1 event=GOING_DOWN
> 		      ip-3194  [011] ....    74.926838: net_dev_notifier: dev=eno1 event=GOING_DOWN ret=1

naming the second one 'net_dev_notifier__exit' would align the columns,
make this a lot easier to read and better discriminate the entry/exit
difference.

  reply	other threads:[~2018-12-19  3:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19  2:27 [PATCH net-next] net: add network device notifier trace points Stephen Hemminger
2018-12-19  3:38 ` David Ahern [this message]
2018-12-19  7:36 ` Jesper Dangaard Brouer
2018-12-19 15:43   ` Stephen Hemminger
2018-12-19 15:46   ` Daniel Borkmann
2018-12-19 16:40     ` Jesper Dangaard Brouer
2018-12-19 16:55       ` Steven Rostedt
2018-12-19 17:07       ` Daniel Borkmann
2018-12-19 15:51   ` Steven Rostedt
2018-12-19 16:48   ` David Ahern

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=3bb9fe50-87f9-a8b5-f886-9727d4e059e9@gmail.com \
    --to=dsahern@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=sthemmin@microsoft$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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