Skip to contentSkip to conversation

trace event skb remove duplicate null-pointer check

PATCH In review Mathieu Desnoyers 3 participants 7 messages Jan 6, 2011 – Jan 9, 2011 Tracing

lore
Share & tools
lore

Mathieu Desnoyers

author reviewer
#0 lore raw

PATCH 1/1 trace event skb remove duplicate null-pointer check

The check for NULL skb in the kfree_skb trace event is a duplicate from the check already done in its only caller, kfree_skb(). Remove this duplicate check.

CC Steven Rostedt <[email protected]>
CC Frederic Weisbecker <[email protected]>
CC Ingo Molnar <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Zhaolei <[email protected]>
---
 include/trace/events/skb.h |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/trace/events/skb.h +1 -3
Index: 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 = ntohs(skb->protocol);
 		__entry->location = location;
 	),
 
Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
#2 lore raw
Quoted 10 lines · David Miller

From: Mathieu Desnoyers <[email protected]>
Date: Thu, 6 Jan 2011 12:53:19 -0500

Quoted 5 lines

The check for NULL skb in the kfree_skb trace event is a duplicate from the check already done in its only caller, kfree_skb(). Remove this duplicate check.

May be you want to take that on the net tree? Looks like more appropriate. Of course this can go through the tracing tree as well.

Thanks.

#3 lore raw

From: Frederic Weisbecker <[email protected]>
Date: Thu, 6 Jan 2011 19:17:29 +0100

Quoted 7 lines · David Miller
Quoted 6 lines

From: Mathieu Desnoyers <[email protected]>
Date: Thu, 6 Jan 2011 12:53:19 -0500

Quoted 3 lines

The check for NULL skb in the kfree_skb trace event is a duplicate from the check already done in its only caller, kfree_skb(). Remove this duplicate check.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

May be you want to take that on the net tree? Looks like more appropriate. Of course this can go through the tracing tree as well.

You guys can take it in the tracing tree, this actually makes things easier for me.

author reviewer
#4 lore raw
In reply to Frederic Weisbecker
Quoted 7 lines · * Frederic Weisbecker ([email protected]) wrote:
Quoted 6 lines · David Miller

From: Mathieu Desnoyers <[email protected]>
Date: Thu, 6 Jan 2011 12:53:19 -0500

Quoted 3 lines

The check for NULL skb in the kfree_skb trace event is a duplicate from the check already done in its only caller, kfree_skb(). Remove this duplicate check.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

May be you want to take that on the net tree? Looks like more appropriate. Of course this can go through the tracing tree as well.

It might be easier to manage the TRACE_EVENT() reshaping (removal of semicolumn, tp_assign, etc) I am preparing if, at this stage, we merge most of the include/trace/event patches through a single tree (the tracing tree). Otherwise we might end up with more commit cross-dependencies between the trees, and increase the risk of conflicts.

Thanks,

Mathieu

Quoted 2 lines

Thanks.

Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
#5 lore raw
Quoted 13 lines · Mathieu Desnoyers
Quoted 12 lines · * Frederic Weisbecker ([email protected]) wrote:
Quoted 10 lines · David Miller

From: Mathieu Desnoyers <[email protected]>
Date: Thu, 6 Jan 2011 12:53:19 -0500

Quoted 5 lines

The check for NULL skb in the kfree_skb trace event is a duplicate from the check already done in its only caller, kfree_skb(). Remove this duplicate check.

Quoted 8 lines
Quoted 2 lines

May be you want to take that on the net tree? Looks like more appropriate. Of course this can go through the tracing tree as well.

It might be easier to manage the TRACE_EVENT() reshaping (removal of semicolumn, tp_assign, etc) I am preparing if, at this stage, we merge most of the include/trace/event patches through a single tree (the tracing tree). Otherwise we might end up with more commit cross-dependencies between the trees, and increase the risk of conflicts.

Alright, let's take that on the tracing tree.

I'll apply them if Steve doesn't beat me at it.

Thanks.

#6 lore raw

[tip:perf/urgent] tracing: remove duplicate null-pointer check in skb tracepoint

In reply to Mathieu Desnoyers
Commit-ID:  881fe4bdcdc899674524e30a76c76d298b447008
Gitweb:     http://git.kernel.org/tip/881fe4bdcdc899674524e30a76c76d298b447008
Author:     Mathieu Desnoyers <[email protected]>
AuthorDate: Thu, 6 Jan 2011 12:53:19 -0500
Committer:  Steven Rostedt <[email protected]>
CommitDate: Fri, 7 Jan 2011 20:55:42 -0500

tracing: remove duplicate null-pointer check in skb tracepoint

The check for NULL skb in the kfree_skb trace event is a duplicate from the check already done in its only caller, kfree_skb(). Remove this duplicate check.

LKML-Reference: <20110106175319.GA30610@Krystal>

---
 include/trace/events/skb.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
include/trace/events/skb.h +1 -3
index 75ce9d5..f10293c 100644
@@ -25,9 +25,7 @@ TRACE_EVENT(kfree_skb,
 
 	TP_fast_assign(
 		__entry->skbaddr = skb;
-		if (skb) {
-			__entry->protocol = ntohs(skb->protocol);
-		}
+		__entry->protocol = ntohs(skb->protocol);
 		__entry->location = location;
 	),