lkml.org 
[lkml]   [2002]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Improved ksymoops output
Hello,

I like the idea very much. As I have to maintain a kernel tree for
various customers too, I think this could be a nice addition for the bug
reports (seldom luckily) I sometimes get.

> gen_func2file.map
> =================

[snipped rest of the bash script]

This can be improved a little bit:

----------------------------------------------------------------
#!/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
> func2file.map

find -name '*.c' | while read a; do
#nm: get symbols from .o
#grep: discard non-text symbols
#awk: remove './', add .o pathname
#cut: remove address and symbol type letter
b=${a%.*}
test -e "${b}.o" && {
nm "${b}.o" \
| grep '\( T \)\|\( t \)' \
| awk "BEGIN { N=\" ${a:2}\" } { print \$0,N }" \
| cut -b12- \
>> func2file.map
}
done
----------------------------------------------------------------
This script compared to yours does (it's nitpicking):
o run faster (5%) ;)
o should never have problems when one day there will be a lot of *.c
files. In your approach LIST could someday not hold all entries
anymore.
o simplifies the bash 'regexp' to snip away the '.c' and print the rest

I'm propably going to rewrite the python script in bash too, since I
don't run python on my distro (and I do not intend to use 2.5.x anytime
soon).

Best regards,
Roberto Nibali, ratz

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:24    [from the cache]
©2003-2011 Jasper Spaans