From: John L. <mov...@us...> - 2002-06-18 03:24:50
|
Update of /cvsroot/oprofile/oprofile/utils In directory usw-pr-cvs1:/tmp/cvs-serv32116/utils Modified Files: op_start Log Message: Drop our requirement for System.map : use vmlinux instead. Index: op_start =================================================================== RCS file: /cvsroot/oprofile/oprofile/utils/op_start,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- op_start 17 May 2002 02:40:15 -0000 1.3 +++ op_start 18 Jun 2002 03:24:46 -0000 1.4 @@ -95,7 +95,6 @@ Daemon options --separate-samples separate samples for each distinct application - --map-file=file System.map for running kernel file --vmlinux=file vmlinux kernel image --verbose be verbose in the daemon log @@ -129,7 +128,6 @@ NOTE_SIZE=0 KERNEL_ONLY=0 IGNORE_MYSELF=0 - MAP_FILE= VMLINUX= PID_FILTER=0 PGRP_FILTER=0 @@ -178,6 +176,19 @@ } +# get start and end points of the kernel +get_kernel_range() { + tmp1=`nm $VMLINUX | grep ' A _text'` + tmp2=`nm $VMLINUX | grep ' A _end'` + if test -z "$tmp1" -o -z "$tmp2"; then + echo "Couldn't determine kernel start/end" >&2 + echo "Perhaps $VMLINUX is not a proper vmlinux file ?" >&2 + echo "found start as \"$tmp1\", end as \"$tmp2\"" >&2 + exit 1 + fi + KERNEL_RANGE="`echo $tmp1 | cut -d" " -f 1`,`echo $tmp2 | cut -d" " -f 1`" +} + # get and check specified options do_options() { while [ "$#" -ne 0 ] @@ -229,9 +240,6 @@ --separate-samples) SEPARATE_SAMPLES=1 ;; - --map-file) - MAP_FILE=$val - ;; --note-table-size) NOTE_SIZE=$val ;; @@ -300,7 +308,20 @@ fi fi + if [ -z "$VMLINUX" ]; then + echo "No vmlinux file specified. You must specify the correct vmlinux file, e.g." >&2 + echo "op_start --vmlinux=/path/to/vmlinux" >&2 + echo "Enter op_start --help for full options" >&2 + exit 1 + fi + if [ ! -f "$VMLINUX" ]; then + echo "The specified vmlinux file \"$VMLINUX\" doesn't exist." >&2 + exit 1 + fi + + get_kernel_range + vecho "Parameters used:" vecho "CPUTYPE $CPUTYPE" if [ $HASH_SIZE != 0 ]; then @@ -331,34 +352,11 @@ else vecho "RTC_VALUE $RTC_VALUE" fi + vecho "IGNORE_MYSELF $IGNORE_MYSELF" vecho "SEPARATE_SAMPLES $SEPARATE_SAMPLES" - vecho "MAP_FILE $MAP_FILE" vecho "VMLINUX $VMLINUX" - - if [ -z "$MAP_FILE" ]; then - echo "No map file specified. You must specify the correct System.map and vmlinux files, e.g." >&2 - echo "op_start --map-file=/path/to/System.map --vmlinux=/path/to/vmlinux" >&2 - echo "Enter op_start --help for full options" >&2 - exit 1 - fi - - if [ -z "$VMLINUX" ]; then - echo "No vmlinux file specified. You must specify the correct System.map and vmlinux files, e.g." >&2 - echo "op_start --map-file=/path/to/System.map --vmlinux=/path/to/vmlinux" >&2 - echo "Enter op_start --help for full options" >&2 - exit 1 - fi - - if [ ! -f "$MAP_FILE" ]; then - echo "The specified map file \"$MAP_FILE\" doesn't exist." >&2 - exit 1 - fi - - if [ ! -f "$VMLINUX" ]; then - echo "The specified vmlinux file \"$VMLINUX\" doesn't exist." >&2 - exit 1 - fi + vecho "KERNEL_RANGE $KERNEL_RANGE" } # stop any existing daemon @@ -482,7 +480,7 @@ fi fi - OPD_ARGS="--vmlinux=$VMLINUX --map-file=$MAP_FILE \ + OPD_ARGS="--vmlinux=$VMLINUX --kernel-range=$KERNEL_RANGE \ --separate-samples=$SEPARATE_SAMPLES \ --pid-filter=$PID_FILTER --pgrp-filter=$PGRP_FILTER" |