lkml.org 
[lkml]   [2005]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][TRIVIAL] Allocate kprobe_table at runtime
Allocates kprobe_table at runtime.

Signed-off-by: Josef "Jeff" Sipek <jeffpc@optonline.net>


diff --git a/kernel/kprobes.c b/kernel/kprobes.c
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -40,7 +40,7 @@
#define KPROBE_HASH_BITS 6
#define KPROBE_TABLE_SIZE (1 << KPROBE_HASH_BITS)

-static struct hlist_head kprobe_table[KPROBE_TABLE_SIZE];
+static struct hlist_head *kprobe_table;

unsigned int kprobe_cpu = NR_CPUS;
static DEFINE_SPINLOCK(kprobe_lock);
@@ -261,7 +261,10 @@ static int __init init_kprobes(void)
{
int i, err = 0;

- /* FIXME allocate the probe table, currently defined statically */
+ kprobe_table = kmalloc(sizeof(struct hlist_head)*KPROBE_TABLE_SIZE, GFP_ATOMIC);
+ if (!kprobe_table)
+ return -ENOMEM;
+
/* initialize all list heads */
for (i = 0; i < KPROBE_TABLE_SIZE; i++)
INIT_HLIST_HEAD(&kprobe_table[i]);[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-06-26 20:34    [W:0.048 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site