| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license | 5 # Use of this source code is governed by a BSD-style license |
| 6 # that can be found in the LICENSE file in the root of the source | 6 # that can be found in the LICENSE file in the root of the source |
| 7 # tree. An additional intellectual property rights grant can be found | 7 # tree. An additional intellectual property rights grant can be found |
| 8 # in the file PATENTS. All contributing project authors may | 8 # in the file PATENTS. All contributing project authors may |
| 9 # be found in the AUTHORS file in the root of the source tree. | 9 # be found in the AUTHORS file in the root of the source tree. |
| 10 # | 10 # |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 } | 202 } |
| 203 | 203 |
| 204 # ----------------------------------------------------------------------------- | 204 # ----------------------------------------------------------------------------- |
| 205 # Main methods to be used after sourcing the main script. | 205 # Main methods to be used after sourcing the main script. |
| 206 # ----------------------------------------------------------------------------- | 206 # ----------------------------------------------------------------------------- |
| 207 | 207 |
| 208 # Call this method after the application as been rebuilt and installed on the | 208 # Call this method after the application as been rebuilt and installed on the |
| 209 # device to ensure that symbols are up-to-date. | 209 # device to ensure that symbols are up-to-date. |
| 210 function perf_update() { | 210 function perf_update() { |
| 211 copy_native_shared_library_to_symbol_cache | 211 copy_native_shared_library_to_symbol_cache |
| 212 copy_kernal_symbols_from_device_to_symbol_cache | 212 copy_kernel_symbols_from_device_to_symbol_cache |
| 213 } | 213 } |
| 214 | 214 |
| 215 # Record stack frame based call graphs while using the application. | 215 # Record stack frame based call graphs while using the application. |
| 216 # We use default events (cpu-cycles), and write records to 'perf.data' in the | 216 # We use default events (cpu-cycles), and write records to 'perf.data' in the |
| 217 # tmp folder on the device. Default duration is 60 seconds but it can be changed | 217 # tmp folder on the device. Default duration is 60 seconds but it can be changed |
| 218 # by adding one parameter. As soon as the recording is done, 'perf.data' is | 218 # by adding one parameter. As soon as the recording is done, 'perf.data' is |
| 219 # copied to the directory from which this method is called and a summary of | 219 # copied to the directory from which this method is called and a summary of |
| 220 # the load distribution per thread is printed. | 220 # the load distribution per thread is printed. |
| 221 function perf_record() { | 221 function perf_record() { |
| 222 if app_is_running "${APP_NAME}"; then | 222 if app_is_running "${APP_NAME}"; then |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 461 |
| 462 cleanup | 462 cleanup |
| 463 | 463 |
| 464 return 0 | 464 return 0 |
| 465 } | 465 } |
| 466 | 466 |
| 467 # Only call main() if proper input parameter has been provided. | 467 # Only call main() if proper input parameter has been provided. |
| 468 if is_set $BUILD_DIR; then | 468 if is_set $BUILD_DIR; then |
| 469 main "$@" | 469 main "$@" |
| 470 fi | 470 fi |
| OLD | NEW |