System.map aughmentation: file names, email addresses

From: Denis Vlasenko (vda@port.imtp.ilyichevsk.odessa.ua)
Date: Tue Feb 12 2002 - 09:12:44 EST


Hi folks,

I was thinking about better handling of oops reports.
There are two things I'm trying to do:

1. Add .c file names to function names in call trace.
Yes it's easily greppable and most hardcore haskers
already remember where those functions are, but _oops reporters_
are not. They need a way to figure what subsystem is failing and
where to send oops in addition to lkml. Maintainer don't read each
and every message on lkml.

2. When (1) is done, add email addresses of maintainers to .c
file names based on regexp match. Oops reporter will get CC list
prepared from oops.

I'm not hacked in ksymoops (yet?) but I have a pair of scripts which
generate aughmented System.map. Here they are for anybody curious.

--
vda

email2pattern.map - list of victims to CC ================= Alexander Viro <viro@math.psu.edu>:^fs/[A-Za-z0-9]*.c$ Neil Brown <neilb@cse.unsw.edu.au>:fs/nfsd/.* Neil Brown <neilb@cse.unsw.edu.au>:drivers/md/(md)|(raid)|(linear).* Tester <tester@host.org>:.*/mm/.* Tester2 <tester2@host.org>:.*usb.* Tester3 <tester3@host.org>:^fs/.* Tester4 <tester4@host.org>:.*ext2.*

gen_func2file ============= #!/bin/sh

# Meant to be run in top lever kernel source dir # after kernel has been built # # Makes list of the form: # symbol1 object_file_pathname1 # symbol2 object_file_pathname2 # symbol3 object_file_pathname3

LIST=`find -name '*.c' | xargs` > func2file.map for a in $LIST; do #nm: get symbols from .o #grep: discard non-text symbols #awk: remove './', add .o pathname #cut: remove address and symbol type letter l=$((${#a}-2)) b=${a:0:$l} if test -e "$b.o"; then nm "$b.o" \ | grep '\( T \)\|\( t \)' \ | awk "BEGIN { N=\" ${a:2:9999}\" } { print \$0,N }" \ | cut -b12- \ >> func2file.map fi done

gen_System.map.annot - yes, my first Python... it probably sucks ==================== #!/usr/bin/python

import string import re

# # Build func->file dictionary # f=open('func2file.map', 'r') func2file={} l=f.readline() while l <> '': l=l[0:len(l)-1] t=string.split(l) func2file[t[0]]=t[1] l=f.readline()

# # Build email:pattern list # f=open('email2pattern.map', 'r') people=[] l=f.readline() while l <> '': l=l[0:len(l)-1] people.append(l) l=f.readline()

# # Read System.map, add file names and email addresses # f=open('System.map', 'r') l=f.readline() while l <> '': l=l[0:len(l)-1] t=string.split(l) if func2file.has_key(t[2]): file=func2file[t[2]] print l+'\t'+file, for p in people: t=string.split(p,':') email=t[0] pattern=t[1] expr=re.compile(pattern) if expr.match(file): print '\t'+email, print else: print l l=f.readline() - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:48 EST