From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533Ab1ADXy2 (ORCPT ); Tue, 4 Jan 2011 18:54:28 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:46392 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337Ab1ADXy1 (ORCPT ); Tue, 4 Jan 2011 18:54:27 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=R0GAU4Kbn7bX2TRaJMGY3m4IXeluCs+8kiGwXQUG2/1Nrx1gONOlpGa2te0rLHtgL6 tXxS8kuSDm6FEAmOEkCsb/MNjGL3cZ0qYMRtc5h1SJo4nkfY19uNhRH/nyU+s9hfbv09 O2EdhfOSto/TjgEm+0s3FuSXr5dcUwKfWspA0= Date: Wed, 5 Jan 2011 00:54:21 +0100 From: Frederic Weisbecker To: "nhorman@tuxdriver.com" , Mathieu Desnoyers Cc: LKML , Steven Rostedt , Ingo Molnar , Thomas Gleixner Subject: Re: [RFC patch 2/5] trace event skb fix unassigned field Message-ID: <20110104235418.GD2911@nowhere> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 04, 2011 at 06:46:06PM -0500, nhorman@tuxdriver.com wrote: > Acked- by: Neil Horman > > > Sent from my Verizon Wireless Phone > > ----- Reply message ----- > From: "Mathieu Desnoyers" > Date: Tue, Jan 4, 2011 6:16 pm > Subject: [RFC patch 2/5] trace event skb fix unassigned field > To: "LKML" > Cc: "Mathieu Desnoyers" , "Steven Rostedt" , "Frederic Weisbecker" , "Ingo Molnar" , "Neil Horman" , "Thomas Gleixner" > > > The field "protocol" in event kfree_skb is left unassigned if skb is NULL, > leaving its trace output as garbage. Assign the value to 0 when skb is NULL > instead. Hm, if the skb is already null, we probably shouldn't send any trace. What about using TP_CONDITION() ? > > Signed-off-by: Mathieu Desnoyers > CC: Steven Rostedt > CC: Frederic Weisbecker > CC: Ingo Molnar > CC: Neil Horman > CC: Thomas Gleixner > --- > include/trace/events/skb.h | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > Index: linux-2.6-lttng/include/trace/events/skb.h > =================================================================== > --- linux-2.6-lttng.orig/include/trace/events/skb.h > +++ linux-2.6-lttng/include/trace/events/skb.h > @@ -25,9 +25,7 @@ TRACE_EVENT(kfree_skb, > > TP_fast_assign( > __entry->skbaddr = skb; > - if (skb) { > - __entry->protocol = ntohs(skb->protocol); > - } > + __entry->protocol = skb ? ntohs(skb->protocol) : 0; > __entry->location = location; > ), > > >