| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2005, Google Inc. | 3 # Copyright (c) 2005, Google Inc. |
| 4 # All rights reserved. | 4 # All rights reserved. |
| 5 # | 5 # |
| 6 # Redistribution and use in source and binary forms, with or without | 6 # Redistribution and use in source and binary forms, with or without |
| 7 # modification, are permitted provided that the following conditions are | 7 # modification, are permitted provided that the following conditions are |
| 8 # met: | 8 # met: |
| 9 # | 9 # |
| 10 # * Redistributions of source code must retain the above copyright | 10 # * Redistributions of source code must retain the above copyright |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 "$PROFILER1" 50 1 "$TMPDIR/p12" || RegisterFailure | 234 "$PROFILER1" 50 1 "$TMPDIR/p12" || RegisterFailure |
| 235 "$PPROF" $PPROF_FLAGS "$PROFILER1_REALNAME" "$TMPDIR/p12" --raw \ | 235 "$PPROF" $PPROF_FLAGS "$PROFILER1_REALNAME" "$TMPDIR/p12" --raw \ |
| 236 >"$TMPDIR/p13" 2>/dev/null || RegisterFailure | 236 >"$TMPDIR/p13" 2>/dev/null || RegisterFailure |
| 237 VerifyIdentical p12 "$PROFILER1_REALNAME" p13 "" || RegisterFailure | 237 VerifyIdentical p12 "$PROFILER1_REALNAME" p13 "" || RegisterFailure |
| 238 | 238 |
| 239 "$PROFILER3" 5 2 "$TMPDIR/p14" || RegisterFailure | 239 "$PROFILER3" 5 2 "$TMPDIR/p14" || RegisterFailure |
| 240 "$PPROF" $PPROF_FLAGS "$PROFILER3_REALNAME" "$TMPDIR/p14" --raw \ | 240 "$PPROF" $PPROF_FLAGS "$PROFILER3_REALNAME" "$TMPDIR/p14" --raw \ |
| 241 >"$TMPDIR/p15" 2>/dev/null || RegisterFailure | 241 >"$TMPDIR/p15" 2>/dev/null || RegisterFailure |
| 242 VerifyIdentical p14 "$PROFILER3_REALNAME" p15 "" || RegisterFailure | 242 VerifyIdentical p14 "$PROFILER3_REALNAME" p15 "" || RegisterFailure |
| 243 | 243 |
| 244 # Test using ITIMER_REAL instead of ITIMER_PROF. |
| 245 env CPUPROFILE_REALTIME=1 "$PROFILER3" 5 2 "$TMPDIR/p16" || RegisterFailure |
| 246 env CPUPROFILE_REALTIME=1 "$PROFILER3" 10 2 "$TMPDIR/p17" || RegisterFailure |
| 247 VerifySimilar p16 "$PROFILER3_REALNAME" p17 "$PROFILER3_REALNAME" 2 |
| 248 |
| 249 |
| 244 # Make sure that when we have a process with a fork, the profiles don't | 250 # Make sure that when we have a process with a fork, the profiles don't |
| 245 # clobber each other | 251 # clobber each other |
| 246 CPUPROFILE="$TMPDIR/p6" "$PROFILER1" 1 -2 || RegisterFailure | 252 CPUPROFILE="$TMPDIR/pfork" "$PROFILER1" 1 -2 || RegisterFailure |
| 247 n=`ls $TMPDIR/p6* | wc -l` | 253 n=`ls $TMPDIR/pfork* | wc -l` |
| 248 if [ $n != 3 ]; then | 254 if [ $n != 3 ]; then |
| 249 echo "FORK test FAILED: expected 3 profiles (for main + 2 children), found $n" | 255 echo "FORK test FAILED: expected 3 profiles (for main + 2 children), found $n" |
| 250 num_failures=`expr $num_failures + 1` | 256 num_failures=`expr $num_failures + 1` |
| 251 fi | 257 fi |
| 252 | 258 |
| 253 rm -rf "$TMPDIR" # clean up | 259 rm -rf "$TMPDIR" # clean up |
| 254 | 260 |
| 255 echo "Tests finished with $num_failures failures" | 261 echo "Tests finished with $num_failures failures" |
| 256 exit $num_failures | 262 exit $num_failures |
| OLD | NEW |