mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Put all functions in kallsyms
@ 2003-03-31  8:14 Rusty Russell
  2003-03-31 22:51 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rusty Russell @ 2003-03-31  8:14 UTC (permalink / raw)
  To: akpm, Kai Germaschewski; +Cc: linux-kernel

Hi all,

	Simple, untested patch.  Any objections?

Cheers,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Include All Functions in kallsyms
Author: Rusty Russell
Status: Experimental

D: Do not discard functions outside _stext and _etext, but include all
D: 't' or 'T' functions.  This means __init functions are included (in my
D: config this means an increas from 5691 to 6442 functions.
D:
D: TODO: Allow multiple kallsym tables, discard init one after init.
D: TODO: Use huffman name compression and 16-bit offsets (see IDE
D: oopser patch)

--- working-2.5.66-uml/scripts/kallsyms.c.~1~	2003-02-07 19:22:29.000000000 +1100
+++ working-2.5.66-uml/scripts/kallsyms.c	2003-03-31 18:08:41.000000000 +1000
@@ -14,14 +14,12 @@
 
 struct sym_entry {
 	unsigned long long addr;
-	char type;
 	char *sym;
 };
 
 
 static struct sym_entry *table;
 static int size, cnt;
-static unsigned long long _stext, _etext;
 
 static void
 usage(void)
@@ -35,8 +33,9 @@
 {
 	char str[500];
 	int rc;
+	char type;
 
-	rc = fscanf(in, "%llx %c %499s\n", &s->addr, &s->type, str);
+	rc = fscanf(in, "%llx %c %499s\n", &s->addr, &type, str);
 	if (rc != 3) {
 		if (rc != EOF) {
 			/* skip line */
@@ -44,19 +43,18 @@
 		}
 		return -1;
 	}
+
+	/* Only interested in functions. */
+	if (type != 't' && type != 'T')
+		return -1;
+
 	s->sym = strdup(str);
 	return 0;
 }
 
-static int
+static inline int
 symbol_valid(struct sym_entry *s)
 {
-	if (s->addr < _stext)
-		return 0;
-
-	if (s->addr > _etext)
-		return 0;
-
 	if (strstr(s->sym, "_compiled."))
 		return 0;
 
@@ -80,12 +78,6 @@
 		if (read_symbol(in, &table[cnt]) == 0)
 			cnt++;
 	}
-	for (i = 0; i < cnt; i++) {
-		if (strcmp(table[i].sym, "_stext") == 0)
-			_stext = table[i].addr;
-		if (strcmp(table[i].sym, "_etext") == 0)
-			_etext = table[i].addr;
-	}
 }
 
 static void

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-04-02 12:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-31  8:14 [PATCH] Put all functions in kallsyms Rusty Russell
2003-03-31 22:51 ` Andrew Morton
2003-03-31 23:40 ` Kai Germaschewski
2003-04-01  5:40   ` Rusty Russell
2003-04-01  0:46 ` Keith Owens
2003-04-01  1:59   ` Rusty Russell
2003-04-02 12:11   ` Roman Zippel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®