All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/2] net: snmp: tracepoint support for snmp
@ 2021-11-18 12:48 menglong8.dong
  2021-11-18 12:48 ` [PATCH v2 net-next 1/2] net: snmp: add " menglong8.dong
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: menglong8.dong @ 2021-11-18 12:48 UTC (permalink / raw)
  To: kuba, rostedt
  Cc: davem, mingo, yoshfuji, dsahern, imagedong, ycheng, kuniyu,
	linux-kernel, netdev

From: Menglong Dong <imagedong@tencent.com>

snmp is the network package statistics module in kernel, and it is
useful in network issue diagnosis, such as packet drop.

However, it is hard to get the detail information about the packet.
For example, we can know that there is something wrong with the
checksum of udp packet though 'InCsumErrors' of UDP protocol in
/proc/net/snmp, but we can't figure out the ip and port of the packet
that this error is happening on.

Add tracepoint for snmp. Therefor, users can use some tools (such as
eBPF) to get the information of the exceptional packet.

In the first patch, the frame of snmp-tracepoint is created. And in
the second patch, tracepoint for udp-snmp is introduced.

Changes since v1:
- use a single trace event for all statistics type, and special
  statistics can be filter by type (procotol) and field.

Now, it will looks like this for udp statistics:
$ cat trace
$ tracer: nop
$
$ entries-in-buffer/entries-written: 4/4   #P:1
$
$                                _-----=> irqs-off
$                               / _----=> need-resched
$                              | / _---=> hardirq/softirq
$                              || / _--=> preempt-depth
$                              ||| / _-=> migrate-disable
$                              |||| /     delay
$           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
$              | |         |   |||||     |         |
              nc-171     [000] ..s1.    35.952997: snmp: skbaddr=(____ptrval____), type=9, field=2, val=1
              nc-171     [000] .N...    35.957006: snmp: skbaddr=(____ptrval____), type=9, field=4, val=1
              nc-171     [000] ..s1.    35.957822: snmp: skbaddr=(____ptrval____), type=9, field=2, val=1
              nc-171     [000] .....    35.957893: snmp: skbaddr=(____ptrval____), type=9, field=4, val=1

'type=9' means that the event is triggered by udp statistics and 'field=2'
means that this is triggered by 'NoPorts'. 'val=1' means that increases
of statistics (decrease can happen on tcp).


Menglong Dong (2):
  net: snmp: add tracepoint support for snmp
  net: snmp: add snmp tracepoint support for udp

 include/net/udp.h           | 25 ++++++++++++++++-----
 include/trace/events/snmp.h | 44 +++++++++++++++++++++++++++++++++++++
 include/uapi/linux/snmp.h   | 21 ++++++++++++++++++
 net/core/net-traces.c       |  3 +++
 net/ipv4/udp.c              | 28 +++++++++++++----------
 5 files changed, 104 insertions(+), 17 deletions(-)
 create mode 100644 include/trace/events/snmp.h

-- 
2.27.0


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

end of thread, other threads:[~2021-11-24  2:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 12:48 [PATCH v2 net-next 0/2] net: snmp: tracepoint support for snmp menglong8.dong
2021-11-18 12:48 ` [PATCH v2 net-next 1/2] net: snmp: add " menglong8.dong
2021-11-18 15:57   ` Steven Rostedt
2021-11-18 12:48 ` [PATCH v2 net-next 2/2] net: snmp: add snmp tracepoint support for udp menglong8.dong
2021-11-18 14:46 ` [PATCH v2 net-next 0/2] net: snmp: tracepoint support for snmp Steven Rostedt
2021-11-18 15:36 ` David Ahern
2021-11-19  3:45   ` Menglong Dong
2021-11-19  3:54     ` David Ahern
2021-11-21 10:47       ` Menglong Dong
2021-11-21 14:02         ` Steven Rostedt
2021-11-22 16:42         ` David Ahern
2021-11-24  2:56           ` Menglong Dong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.