[PATCH] Tracepoints use TABLE_SIZE macro
From: Mathieu Desnoyers
Date: Thu Jul 24 2008 - 16:42:38 EST
Steven Rostedt <rostedt@xxxxxxxxxxx> :
Wouldn't it look nicer to have: (TRACEPOINT_TABLE_SIZE - 1) ?
me :
Sure,
It applies on top of the "Tracepoints" patch, currently in the ftrace
tree.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx>
CC: Steven Rostedt <rostedt@xxxxxxxxxxx>
CC: akpm@xxxxxxxxxxxxxxxxxxxx
CC: Ingo Molnar <mingo@xxxxxxx>
CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CC: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
CC: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
CC: Hideo AOKI <haoki@xxxxxxxxxx>
CC: Takashi Nishiie <t-nishiie@xxxxxxxxxxxxxxxxxx>
CC: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
CC: Eduard - Gabriel Munteanu <eduard.munteanu@xxxxxxxxxxx>
---
kernel/tracepoint.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: linux-2.6-lttng/kernel/tracepoint.c
===================================================================
--- linux-2.6-lttng.orig/kernel/tracepoint.c 2008-07-24 16:33:52.000000000 -0400
+++ linux-2.6-lttng/kernel/tracepoint.c 2008-07-24 16:34:57.000000000 -0400
@@ -177,7 +177,7 @@ static struct tracepoint_entry *get_trac
struct tracepoint_entry *e;
u32 hash = jhash(name, strlen(name), 0);
- head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
+ head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(name, e->name))
return e;
@@ -197,7 +197,7 @@ static struct tracepoint_entry *add_trac
size_t name_len = strlen(name) + 1;
u32 hash = jhash(name, name_len-1, 0);
- head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
+ head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(name, e->name)) {
printk(KERN_NOTICE
@@ -233,7 +233,7 @@ static int remove_tracepoint(const char
size_t len = strlen(name) + 1;
u32 hash = jhash(name, len-1, 0);
- head = &tracepoint_table[hash & ((1 << TRACEPOINT_HASH_BITS)-1)];
+ head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(name, e->name)) {
found = 1;
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/