4 #define MAX_MAPSIZE 10000
13 static void load_map(void)
20 f = fopen("/boot/System.map", "r");
21 while (!feof(f) && mapsize < MAX_MAPSIZE) {
22 if (fscanf(f,"%x %s %s", &addr, dum, fn) == 3) {
23 sysmap[mapsize].addr = addr;
24 sysmap[mapsize].name = strdup(fn);
31 static char *find_map(unsigned addr)
40 if (addr >= sysmap[i].addr) {
43 if (addr < sysmap[i].addr) {
46 if (addr >= sysmap[i+1].addr) {
49 if (addr < sysmap[i+1].addr) {
54 return sysmap[i].name;
57 static void disp_one(char *line)
64 sscanf(line,"%s %u %u %x %x %x %x %x %x",
66 &addr[0], &addr[1], &addr[2],
67 &addr[3], &addr[4], &addr[5]);
69 printf("%s %u %u:", fname, count, t);
71 printf(" %s", find_map(addr[i]));
84 printf("loaded map\n");
86 f = fopen("/proc/cpuinfo", "r");
88 while (fgets(line, sizeof(line)-1, f)) {
92 if (strncmp(line,"kgprof", 6) == 0) enabled = 1;