From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762487AbYGOWdX (ORCPT ); Tue, 15 Jul 2008 18:33:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759075AbYGOW3X (ORCPT ); Tue, 15 Jul 2008 18:29:23 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:47347 "EHLO smtp.polymtl.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757267AbYGOW3W (ORCPT ); Tue, 15 Jul 2008 18:29:22 -0400 Message-Id: <20080715222749.309982460@polymtl.ca> References: <20080715222604.331269462@polymtl.ca> User-Agent: quilt/0.46-1 Date: Tue, 15 Jul 2008 18:26:19 -0400 From: Mathieu Desnoyers To: akpm@linux-foundation.org, Ingo Molnar , linux-kernel@vger.kernel.org, Peter Zijlstra , Masami Hiramatsu Cc: Mathieu Desnoyers , netdev@vger.kernel.org, "David S. Miller" , Alexey Kuznetsov , "Frank Ch. Eigler" , Hideo AOKI , Takashi Nishiie , Steven Rostedt , Eduard - Gabriel Munteanu Subject: [patch 15/17] LTTng instrumentation - ipv4 Content-Disposition: inline; filename=lttng-instrumentation-ipv4.patch X-Poly-FromMTA: (test.casi.polymtl.ca [132.207.72.60]) at Tue, 15 Jul 2008 22:27:52 +0000 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Keep track of interface up/down for ipv4. Allows to keep track of interface address changes in a trace. Those tracepoints are used by LTTng. About the performance impact of tracepoints (which is comparable to markers), even without immediate values optimizations, tests done by Hideo Aoki on ia64 show no regression. His test case was using hackbench on a kernel where scheduler instrumentation (about 5 events in code scheduler code) was added. See the "Tracepoints" patch header for performance result detail. Signed-off-by: Mathieu Desnoyers CC: netdev@vger.kernel.org CC: David S. Miller CC: Alexey Kuznetsov CC: CC: Masami Hiramatsu CC: 'Peter Zijlstra' CC: "Frank Ch. Eigler" CC: 'Ingo Molnar' CC: 'Hideo AOKI' CC: Takashi Nishiie CC: 'Steven Rostedt' CC: Eduard - Gabriel Munteanu --- include/trace/ipv4.h | 14 ++++++++++++++ net/ipv4/devinet.c | 3 +++ 2 files changed, 17 insertions(+) Index: linux-2.6-lttng/net/ipv4/devinet.c =================================================================== --- linux-2.6-lttng.orig/net/ipv4/devinet.c 2008-07-15 14:51:51.000000000 -0400 +++ linux-2.6-lttng/net/ipv4/devinet.c 2008-07-15 15:16:11.000000000 -0400 @@ -61,6 +61,7 @@ #include #include #include +#include static struct ipv4_devconf ipv4_devconf = { .data = { @@ -257,6 +258,7 @@ static void __inet_del_ifa(struct in_dev struct in_ifaddr **ifap1 = &ifa1->ifa_next; while ((ifa = *ifap1) != NULL) { + trace_ipv4_addr_del(ifa); if (!(ifa->ifa_flags & IFA_F_SECONDARY) && ifa1->ifa_scope <= ifa->ifa_scope) last_prim = ifa; @@ -363,6 +365,7 @@ static int __inet_insert_ifa(struct in_i } ifa->ifa_flags |= IFA_F_SECONDARY; } + trace_ipv4_addr_add(ifa); } if (!(ifa->ifa_flags & IFA_F_SECONDARY)) { Index: linux-2.6-lttng/include/trace/ipv4.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-lttng/include/trace/ipv4.h 2008-07-15 15:16:11.000000000 -0400 @@ -0,0 +1,14 @@ +#ifndef _TRACE_IPV4_H +#define _TRACE_IPV4_H + +#include +#include + +DEFINE_TRACE(ipv4_addr_add, + TPPROTO(struct in_ifaddr *ifa), + TPARGS(ifa)); +DEFINE_TRACE(ipv4_addr_del, + TPPROTO(struct in_ifaddr *ifa), + TPARGS(ifa)); + +#endif -- Mathieu Desnoyers Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68