1 From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
2 Subject: LTTng instrumentation - ipv4
5 LTTng instrumentation - ipv4
7 Keep track of interface up/down for ipv4. Allows to keep track of interface
8 address changes in a trace.
10 Those tracepoints are used by LTTng.
12 About the performance impact of tracepoints (which is comparable to markers),
13 even without immediate values optimizations, tests done by Hideo Aoki on ia64
14 show no regression. His test case was using hackbench on a kernel where
15 scheduler instrumentation (about 5 events in code scheduler code) was added.
16 See the "Tracepoints" patch header for performance result detail.
18 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
19 CC: netdev@vger.kernel.org
20 CC: David S. Miller <davem@davemloft.net>
21 CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
23 CC: Masami Hiramatsu <mhiramat@redhat.com>
24 CC: 'Peter Zijlstra' <peterz@infradead.org>
25 CC: "Frank Ch. Eigler" <fche@redhat.com>
26 CC: 'Ingo Molnar' <mingo@elte.hu>
27 CC: 'Hideo AOKI' <haoki@redhat.com>
28 CC: Takashi Nishiie <t-nishiie@np.css.fujitsu.com>
29 CC: 'Steven Rostedt' <rostedt@goodmis.org>
30 CC: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
32 Acked-by: Jan Blunck <jblunck@suse.de>
35 include/trace/ipv4.h | 14 ++++++++++++++
36 net/ipv4/devinet.c | 3 +++
37 2 files changed, 17 insertions(+)
40 +++ b/include/trace/ipv4.h
42 +#ifndef _TRACE_IPV4_H
43 +#define _TRACE_IPV4_H
45 +#include <linux/inetdevice.h>
46 +#include <linux/tracepoint.h>
48 +DEFINE_TRACE(ipv4_addr_add,
49 + TPPROTO(struct in_ifaddr *ifa),
51 +DEFINE_TRACE(ipv4_addr_del,
52 + TPPROTO(struct in_ifaddr *ifa),
56 --- a/net/ipv4/devinet.c
57 +++ b/net/ipv4/devinet.c
59 #include <net/ip_fib.h>
60 #include <net/rtnetlink.h>
61 #include <net/net_namespace.h>
62 +#include <trace/ipv4.h>
64 static struct ipv4_devconf ipv4_devconf = {
66 @@ -257,6 +258,7 @@ static void __inet_del_ifa(struct in_dev
67 struct in_ifaddr **ifap1 = &ifa1->ifa_next;
69 while ((ifa = *ifap1) != NULL) {
70 + trace_ipv4_addr_del(ifa);
71 if (!(ifa->ifa_flags & IFA_F_SECONDARY) &&
72 ifa1->ifa_scope <= ifa->ifa_scope)
74 @@ -363,6 +365,7 @@ static int __inet_insert_ifa(struct in_i
76 ifa->ifa_flags |= IFA_F_SECONDARY;
78 + trace_ipv4_addr_add(ifa);
81 if (!(ifa->ifa_flags & IFA_F_SECONDARY)) {