]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.trace/lttng-instrumentation-ipv4.patch
Updated xen patches taken from suse.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.trace / lttng-instrumentation-ipv4.patch
1 From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
2 Subject: LTTng instrumentation - ipv4
3
4 Original patch header:
5 LTTng instrumentation - ipv4
6
7 Keep track of interface up/down for ipv4. Allows to keep track of interface
8 address changes in a trace.
9
10 Those tracepoints are used by LTTng.
11
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.
17
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>
22 CC:
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>
31
32 Acked-by: Jan Blunck <jblunck@suse.de>
33 ---
34 ---
35 include/trace/ipv4.h | 14 ++++++++++++++
36 net/ipv4/devinet.c | 3 +++
37 2 files changed, 17 insertions(+)
38
39 --- /dev/null
40 +++ b/include/trace/ipv4.h
41 @@ -0,0 +1,14 @@
42 +#ifndef _TRACE_IPV4_H
43 +#define _TRACE_IPV4_H
44 +
45 +#include <linux/inetdevice.h>
46 +#include <linux/tracepoint.h>
47 +
48 +DEFINE_TRACE(ipv4_addr_add,
49 + TPPROTO(struct in_ifaddr *ifa),
50 + TPARGS(ifa));
51 +DEFINE_TRACE(ipv4_addr_del,
52 + TPPROTO(struct in_ifaddr *ifa),
53 + TPARGS(ifa));
54 +
55 +#endif
56 --- a/net/ipv4/devinet.c
57 +++ b/net/ipv4/devinet.c
58 @@ -61,6 +61,7 @@
59 #include <net/ip_fib.h>
60 #include <net/rtnetlink.h>
61 #include <net/net_namespace.h>
62 +#include <trace/ipv4.h>
63
64 static struct ipv4_devconf ipv4_devconf = {
65 .data = {
66 @@ -257,6 +258,7 @@ static void __inet_del_ifa(struct in_dev
67 struct in_ifaddr **ifap1 = &ifa1->ifa_next;
68
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)
73 last_prim = ifa;
74 @@ -363,6 +365,7 @@ static int __inet_insert_ifa(struct in_i
75 }
76 ifa->ifa_flags |= IFA_F_SECONDARY;
77 }
78 + trace_ipv4_addr_add(ifa);
79 }
80
81 if (!(ifa->ifa_flags & IFA_F_SECONDARY)) {