All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: linux-kernel@vger.kernel.org
Cc: sam@ravnborg.org
Subject: [patch 3/3] kallsyms: gate page is part of the kernel, honour CONFIG_KALLSYMS_ALL
Date: Sun, 28 Nov 2004 14:55:39 +1100	[thread overview]
Message-ID: <19476.1101614139@ocs3.ocs.com.au> (raw)
In-Reply-To: Your message of "Sun, 28 Nov 2004 14:38:47 +1100." <28912.1101613127@ocs3.ocs.com.au>

* Treat the gate page as part of the kernel, to improve kernel backtraces.

* Honour CONFIG_KALLSYMS_ALL, all symbols are valid, not just text.

Signed-off-by: Keith Owens <kaos@ocs.com.au>

Index: 2.6.10-rc2-bk11/kernel/kallsyms.c
===================================================================
--- 2.6.10-rc2-bk11.orig/kernel/kallsyms.c	2004-11-15 14:26:49.080865854 +1100
+++ 2.6.10-rc2-bk11/kernel/kallsyms.c	2004-11-28 14:42:23.755352067 +1100
@@ -18,6 +18,13 @@
 #include <linux/fs.h>
 #include <linux/err.h>
 #include <linux/proc_fs.h>
+#include <linux/mm.h>
+
+#ifdef CONFIG_KALLSYMS_ALL
+#define all_var 1
+#else
+#define all_var 0
+#endif
 
 /* These will be re-linked against their real values during the second link stage */
 extern unsigned long kallsyms_addresses[] __attribute__((weak));
@@ -30,7 +37,7 @@ extern u16 kallsyms_token_index[] __attr
 extern unsigned long kallsyms_markers[] __attribute__((weak));
 
 /* Defined by the linker script. */
-extern char _stext[], _etext[], _sinittext[], _einittext[];
+extern char _stext[], _etext[], _sinittext[], _einittext[], _end[];
 
 static inline int is_kernel_inittext(unsigned long addr)
 {
@@ -44,7 +51,7 @@ static inline int is_kernel_text(unsigne
 {
 	if (addr >= (unsigned long)_stext && addr <= (unsigned long)_etext)
 		return 1;
-	return 0;
+	return in_gate_area_no_task(addr);
 }
 
 /* expand a compressed symbol data into the resulting uncompressed string,
@@ -147,7 +154,7 @@ const char *kallsyms_lookup(unsigned lon
 	namebuf[KSYM_NAME_LEN] = 0;
 	namebuf[0] = 0;
 
-	if (is_kernel_text(addr) || is_kernel_inittext(addr)) {
+	if (all_var || is_kernel_text(addr) || is_kernel_inittext(addr)) {
 		unsigned long symbol_end=0;
 
 		/* do a binary search on the sorted kallsyms_addresses array */
@@ -181,7 +188,7 @@ const char *kallsyms_lookup(unsigned lon
 			if (is_kernel_inittext(addr))
 				symbol_end = (unsigned long)_einittext;
 			else
-				symbol_end = (unsigned long)_etext;
+				symbol_end = all_var ? (unsigned long)_end : (unsigned long)_etext;
 		}
 
 		*symbolsize = symbol_end - kallsyms_addresses[low];


  parent reply	other threads:[~2004-11-28  3:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-28  3:38 [patch 0/3] kallsyms: Add gate page and all symbols support Keith Owens
2004-11-28  3:54 ` [patch 1/3] kallsyms: Clean up x86-64 special casing of in_gate_area() Keith Owens
2004-11-28  3:55 ` [patch 2/3] kallsyms: Add in_gate_area_no_task() Keith Owens
2004-11-28  3:55 ` Keith Owens [this message]
2004-12-28 21:17 ` [patch 0/3] kallsyms: Add gate page and all symbols support Sam Ravnborg
2005-01-18  7:52   ` Benjamin Herrenschmidt
2005-01-18 13:07     ` Keith Owens
2005-01-18 22:03       ` Benjamin Herrenschmidt

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=19476.1101614139@ocs3.ocs.com.au \
    --to=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.