Skip to contentSkip to conversation

rcu: Make struct rcu_head searchable

PATCH In review Steven Rostedt 3 participants 5 messages Nov 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: Make struct rcu_head searchable

After wasting too much time trying to see where struct rcu_head was declared, I finally found it in include/linux/types.h as a define for callback_head!

To prevent other developers from wasting their precious time in searching for this structure, add a comment to help them find it!

include/linux/types.h +3 -0
index 4d118ba..073e9a8 100644
@@ -210,6 +210,9 @@ struct callback_head {
 	struct callback_head *next;
 	void (*func)(struct callback_head *head);
 };
+/*
+ * Make "struct rcu_head {" seachable with this comment.
+ */
 #define rcu_head callback_head
 
 #endif /*  __ASSEMBLY__ */
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Steven Rostedt

After wasting too much time trying to see where struct rcu_head was declared, I finally found it in include/linux/types.h as a define for callback_head!

To prevent other developers from wasting their precious time in searching for this structure, add a comment to help them find it!

The cscope tool is your friend in this case, but nevertheless:

Quoted 15 lines
include/linux/types.h +3 -0
index 4d118ba..073e9a8 100644
@@ -210,6 +210,9 @@ struct callback_head {
 	struct callback_head *next;
 	void (*func)(struct callback_head *head);
 };
+/*
+ * Make "struct rcu_head {" seachable with this comment.
+ */
 #define rcu_head callback_head
 
 #endif /*  __ASSEMBLY__ */
#2 lore raw
Quoted 5 lines · On Wed, 13 Nov 2013 09:12:05 -0800 "Paul E. McKenney"…
Quoted 4 lines · Steven Rostedt

After wasting too much time trying to see where struct rcu_head was declared, I finally found it in include/linux/types.h as a define for callback_head!

Quoted 8 lines
Quoted 6 lines

To prevent other developers from wasting their precious time in searching for this structure, add a comment to help them find it!

The cscope tool is your friend in this case, but nevertheless:

I use emacs, and the latest version of etags (or emacs) brings you to each use case before it gets you to the define (which is really annoying). Back in 2006 it use to work properly. I need to figure out what changed :-/

Quoted 13 lines

include/linux/types.h struct callback_head { · line 214

Quoted 10 lines
include/linux/types.h +2 -0
index 4d118ba..073e9a8 100644
@@ -210,6 +210,9 @@ struct callback_head {
 	struct callback_head *next;
 	void (*func)(struct callback_head *head);
 };
+/*
+ * Make "struct rcu_head {" seachable with this comment.

I've been told s/seachable/searchable/

Frustration fails me ;-)

-- Steve

Quoted 5 lines
Quoted 5 lines
include/linux/types.h +1 -0
+ */
 #define rcu_head callback_head
 
 #endif /*  __ASSEMBLY__ */
#3 lore raw
Quoted 15 lines · On Wed, 13 Nov 2013 13:10:44 -0500 Steven Rostedt <[email protected]> wrote:
Quoted 12 lines · On Wed, 13 Nov 2013 09:12:05 -0800 "Paul E. McKenney"…
Quoted 10 lines · Steven Rostedt

After wasting too much time trying to see where struct rcu_head was declared, I finally found it in include/linux/types.h as a define for callback_head!

To prevent other developers from wasting their precious time in searching for this structure, add a comment to help them find it!

Quoted 6 lines
Quoted 1 line

The cscope tool is your friend in this case, but nevertheless:

I use emacs, and the latest version of etags (or emacs) brings you to each use case before it gets you to the define (which is really annoying). Back in 2006 it use to work properly. I need to figure out what changed :-/

That irritates me too. Fortunately I just invented

(grep "#define" tags && grep -v "#define" tags) > tags.new

#4 lore raw
Quoted 3 lines · On Wed, 13 Nov 2013 10:57:05 -0800 Andrew Morton <[email protected]>…

That irritates me too. Fortunately I just invented

(grep "#define" tags && grep -v "#define" tags) > tags.new

Unfortunately, TAGS doesn't work that way. Hmm, I could whip up a perl script to do it for me though.

-- Steve