Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
suv_vr's avatar
suv_vr
Honored Guest
3 years ago

SimplePerf Usage

I'm trying to run Simpleperf to get a CPU trace of a Unity Project. The instructions seem to be missing steps.
I cannot successfully run either the `binary_cache_builder` (missing `perf.data`) or `app_profiler.py` to generate a `perf.data` file.
 
 
1. Running `binary_cache_builder` requires a "perf.data" file that is missing.
```
Android\Sdk\ndk\21.4.7075529\simpleperf> python binary_cache_builder.py -lib "C:\Users\suv\Desktop\test-0.1-v1.symbols"
Traceback (most recent call last):
  File "binary_cache_builder.py", line 237, in <module>
    main()
  File "binary_cache_builder.py", line 228, in main
    args = parser.parse_args()
  File "C:\Python27\lib\argparse.py", line 1656, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "C:\Python27\lib\argparse.py", line 1678, in parse_known_args
    default = self._get_value(action, default)
  File "C:\Python27\lib\argparse.py", line 2203, in _get_value
    raise ArgumentError(action, msg)
argparse.ArgumentError: argument -i/--perf_data_path: C:\Users\suv\AppData\Local\Android\Sdk\ndk\21.4.7075529\simpleperf\perf.data is not a file.
``` 
 
Running `app_profiler.py` fails to generate "perf.data" file
``` Android\Sdk\ndk\21.4.7075529\simpleperf>python app_profiler.py --disable_adb_root --ndk_path ```
```
"C:\Users\suv\AppData\Local\Android\Sdk\ndk" --app com.facebook.together.together.stable -r "-g --duration 50 -e cpu-cycles,cache-misses"
INFO:root:prepare profiling
INFO:root:start profiling
INFO:root:run adb cmd: ['\\Users\\suv\\AppData\\Local\\Android\\sdk\\ndk-bundle\\..\\platform-tools\\adb', 'shell', '/data/local/tmp/simpleperf', 'record', '-o', '/data/local/tmp/perf.data', '-g --duration 50 -e cpu-cycles,cache-misses', '--log', 'info', '--app', 'com.facebook.together.together.stable']
Failed to record profiling data.
```

1 Reply

Replies have been turned off for this discussion
  • Autarkis's avatar
    Autarkis
    Honored Guest

    Resurrecting this - Has anyone been able to successfully use the simpleperf CLI with the steps outlined in the link above?