From: John L. <mov...@us...> - 2001-09-23 02:36:07
|
Update of /cvsroot/oprofile/oprofile/dae In directory usw-pr-cvs1:/tmp/cvs-serv7804/dae Modified Files: op_dump op_start Log Message: fork/exec for children in the GUI Index: op_dump =================================================================== RCS file: /cvsroot/oprofile/oprofile/dae/op_dump,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- op_dump 2001/09/02 01:08:45 1.2 +++ op_dump 2001/09/23 02:36:03 1.3 @@ -3,12 +3,12 @@ # useful for dumping ... if [ ! -d /proc/sys/dev/oprofile ]; then - echo "You must have the oprofile module loaded to dump data." + echo "You must have the oprofile module loaded to dump data." >&2 exit 1 fi if [ ! -w /proc/sys/dev/oprofile/dump ]; then - echo "Must be root." + echo "Must be root." >&2 exit 1 fi Index: op_start =================================================================== RCS file: /cvsroot/oprofile/oprofile/dae/op_start,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- op_start 2001/09/13 17:14:43 1.45 +++ op_start 2001/09/23 02:36:03 1.46 @@ -27,7 +27,7 @@ do_sysctl() { if [ x$1 != x"-w" ]; then - echo "$0 unknown option" + echo "$0 unknown option" >&2 exit 1 fi @@ -51,7 +51,7 @@ local val=`echo $1 | sed 's,--ctr\([0-9]*\)[-A-Za-z]*,\1,'` if (($val >= $OP_MAX_COUNTERS || $val < 0)); then - echo "invalid argument $1: bad counter number" + echo "invalid argument $1: bad counter number" >&2 exit 1 fi echo $val @@ -94,7 +94,7 @@ General options --list-events list event types and unit masks - --help this message" + --help this message" >&2 } # initialise parameters @@ -125,7 +125,7 @@ MAX_COUNTER=3 ;; *) - echo "Unknown cpu type \"$CPUTYPE\"" + echo "Unknown cpu type \"$CPUTYPE\"" >&2 exit 1 ;; esac @@ -221,7 +221,7 @@ exec op_help ;; *) - echo "Unknown option \"$arg\". See op_start --help" + echo "Unknown option \"$arg\". See op_start --help" >&2 exit 1 ;; esac @@ -234,17 +234,17 @@ if [[ ${#CTR_EVENT[$f]} != 0 ]]; then CTR_EVENT_VAL[$f]=`op_help ${CTR_EVENT[$f]}` if [ -z "${CTR_EVENT_VAL[$f]}" -a ! -z "${CTR_EVENT[$f]}" ]; then - echo "Unknown event \"${CTR_EVENT[$f]}\"" + echo "Unknown event \"${CTR_EVENT[$f]}\"" >&2 exit 1 fi if [ -z "${CTR_COUNT[$f]}" ]; then - echo "Event but no count specified for counter $f" + echo "Event but no count specified for counter $f" >&2 exit 1 fi one_enabled=1 else if [ ! -z "${CTR_COUNT[$f]}" ]; then - echo "Count but no event specified for counter $f" + echo "Count but no event specified for counter $f" >&2 exit 1 fi fi @@ -252,9 +252,9 @@ done if [ "$one_enabled" == "0" ]; then - echo "You haven't specified what events you would like to count, e.g." - echo "op_start ... --ctr0-event=CPU_CLK_UNHALTED --ctr0-count=600000" - echo "Enter op_start --help for full options" + echo "You haven't specified what events you would like to count, e.g." >&2 + echo "op_start ... --ctr0-event=CPU_CLK_UNHALTED --ctr0-count=600000" >&2 + echo "Enter op_start --help for full options" >&2 exit 1 fi @@ -293,26 +293,26 @@ 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." - echo "op_start --map-file=/path/to/System.map --vmlinux=/path/to/vmlinux" - echo "Enter op_start --help for full options" + 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." - echo "op_start --map-file=/path/to/System.map --vmlinux=/path/to/vmlinux" - echo "Enter op_start --help for full options" + 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." + 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." + echo "The specified vmlinux file \"$VMLINUX\" doesn't exist." >&2 exit 1 fi } @@ -328,12 +328,12 @@ if [ "$?" -ne 0 ]; then modprobe oprofile expected_cpu_type=$CPUTYPE if [ "$?" != "0" ]; then - echo "Couldn't load oprofile.o module" + echo "Couldn't load oprofile.o module" >&2 exit 1 fi grep oprofile /proc/modules >/dev/null if [ "$?" != "0" ]; then - echo "Couldn't load oprofile.o module" + echo "Couldn't load oprofile.o module" >&2 exit 1 fi fi @@ -341,7 +341,7 @@ if [ ! -d "$DIR" ]; then mkdir -p "$DIR" if [ "$?" != "0" ]; then - echo "Couldn't mkdir -p $DIR" + echo "Couldn't mkdir -p $DIR" >&2 exit 1 fi chmod 755 "$DIR" @@ -362,7 +362,7 @@ if [ ! -d "$SAMPLES_DIR" ]; then mkdir -p "$SAMPLES_DIR" if [ "$?" != "0" ]; then - echo "Couldn't mkdir -p $SAMPLES_DIR" + echo "Couldn't mkdir -p $SAMPLES_DIR" >&2 exit 1 fi chmod 755 "$SAMPLES_DIR" @@ -373,7 +373,7 @@ vecho "Doing mknod $DEVICE_FILE" mknod "$DEVICE_FILE" c $MAJOR_NR 0 if [ "$?" != "0" ]; then - echo "Couldn't mknod $DEVICE_FILE" + echo "Couldn't mknod $DEVICE_FILE" >&2 exit 1 fi chmod 700 "$DEVICE_FILE" @@ -381,7 +381,7 @@ vecho "Doing mknod $HASH_MAP_DEVICE_FILE" mknod "$HASH_MAP_DEVICE_FILE" c $MAJOR_NR 1 if [ "$?" != "0" ]; then - echo "Couldn't mknod $HASH_MAP_DEVICE_FILE" + echo "Couldn't mknod $HASH_MAP_DEVICE_FILE" >&2 exit 1 fi chmod 700 "$HASH_MAP_DEVICE_FILE" @@ -439,8 +439,8 @@ sleep 4 PID=`ps x | grep oprofiled | grep -v grep | awk '{print $1}'` if [ "$PID" = "" ]; then - echo "Couldn't start oprofiled." - echo "Check the log file \"$LOG_FILE\" and /var/log/messages" + echo "Couldn't start oprofiled." >&2 + echo "Check the log file \"$LOG_FILE\" and /var/log/messages" >&2 exit 1 fi @@ -451,7 +451,7 @@ # main if [ "$UID" != "0" ]; then - echo "Must be root to start oprofile." + echo "Must be root to start oprofile." >&2 exit 1 fi |