public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Sipek <jeffpc@optonline.net>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: trivial@rustcorp.com.au
Subject: [PATCH][TRIVIAL] Allocate kprobe_table at runtime
Date: Sun, 26 Jun 2005 14:30:49 -0400	[thread overview]
Message-ID: <20050626183049.GA22898@optonline.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

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]);

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2005-06-26 18:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26 18:30 Jeff Sipek [this message]
2005-06-27  5:51 ` [PATCH][TRIVIAL] Allocate kprobe_table at runtime Prasanna S Panchamukhi
     [not found] <20050626183049.GA22898@optonline.net.suse.lists.linux.kernel>
     [not found] ` <20050627055150.GA10659@in.ibm.com.suse.lists.linux.kernel>
2005-06-27  6:14   ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050626183049.GA22898@optonline.net \
    --to=jeffpc@optonline.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox