From: Rusty Russell <rusty@rustcorp.com.au>
To: akpm@zip.com.au, Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Put all functions in kallsyms
Date: Mon, 31 Mar 2003 18:14:03 +1000 [thread overview]
Message-ID: <20030331224033.489DD2C04B@lists.samba.org> (raw)
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
next reply other threads:[~2003-03-31 22:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-31 8:14 Rusty Russell [this message]
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
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=20030331224033.489DD2C04B@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=akpm@zip.com.au \
--cc=kai@tp1.ruhr-uni-bochum.de \
--cc=linux-kernel@vger.kernel.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 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®