0

I am using a Galaxy S2 i9100 with working LineageOS, Android 7.1.2 build from Jun 23 09:39:38 CEST 2018. In some rare cases, the phone hangs and apps crash. I would like to see this effect in a systrace. The phone is sucessfully rooted (Kernel Adiutor is working fine and in the developers option root is enabled for ADB and apps) and adb is working fine, I can get traces, use shell etc. But if I try to get a systrace, it says:

python systrace.py 
These categories are unavailable: sched freq disk binder_driver
Traceback (most recent call last):
  File "systrace.py", line 49, in <module>
    sys.exit(run_systrace.main())
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 196, in main
    main_impl(sys.argv)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 176, in main_impl
    controller.StartTracing()
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/systrace_runner.py", line 45, in StartTracing
    self._tracing_controller.StartTracing()
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/tracing_controller.py", line 155, in StartTracing
    timeout=self._controller_config.timeout):
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/common/py_utils/py_utils/__init__.py", line 85, in RunWithTimeout
    return timeout_retry.Run(func, timeout, 0, args=args)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/timeout_retry.py", line 159, in Run
    error_log_func=error_log_func)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 186, in JoinAll
    self._JoinAll(watcher, timeout)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 158, in _JoinAll
    thread.ReraiseIfException()
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 81, in run
    self._ret = self._func(*self._args, **self._kwargs)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/timeout_retry.py", line 152, in <lambda>
    child_thread = reraiser_thread.ReraiserThread(lambda: func(*args, **kwargs),
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 185, in StartAgentTracing
    self._tracer_args + ['--async_start'], check_return=True)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 51, in timeout_retry_wrapper
    return impl()
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 47, in impl
    return f(*args, **kwargs)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 974, in RunShellCommand
    output = handle_large_output(cmd, large_output)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 950, in handle_large_output
    return handle_large_output(cmd, True)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 939, in handle_large_output
    handle_large_command(cmd)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 925, in handle_large_command
    return handle_check_return(cmd)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 916, in handle_check_return
    return run(cmd)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 912, in run
    return self.adb.Shell(cmd)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/sdk/adb_wrapper.py", line 501, in Shell
    command, output, status=None, device_serial=self._device_serial)
devil.android.device_errors.AdbShellCommandFailedError: (device: 0019c6b3522dbe) shell command run via adb failed on the device:
  command: ( atrace -z gfx view dalvik webview input am wm rs --async_start )>/data/local/tmp/temp_file-348da586a99d7
  exit status: None
  output:
  - error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2)
  - error opening /sys/kernel/debug/tracing/buffer_size_kb: No such file or directory (2)
  - error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2)
  - error opening /sys/kernel/debug/tracing/trace_clock: No such file or directory (2)
  - %0
  - error opening /sys/kernel/debug/tracing/tracing_on: No such file or directory (2)
  - unable to start tracing

root is activated for ADB and works fine else.

If I run adb root and adb remount like suggested in https://stackoverflow.com/questions/17207841/running-android-systrace-on-device, it still says:

python systrace.py 
These categories are unavailable: sched freq disk binder_driver
Starting tracing (stop with enter)
Tracing completed. Collecting output...
/system/bin/sh: <stdin>[2]: can't create /sys/kernel/debug/tracing/trace_marker: No such file or directory
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 193, in _collect_and_preprocess
    trace_data = self._collect_trace_data()
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 258, in _collect_trace_data
    raise IOError('Unable to get atrace data. Did you forget adb root?')
IOError: Unable to get atrace data. Did you forget adb root?

Outputting Systrace results...
Tracing complete, writing results
Traceback (most recent call last):
  File "systrace.py", line 49, in <module>
    sys.exit(run_systrace.main())
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 196, in main
    main_impl(sys.argv)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 193, in main_impl
    controller.OutputSystraceResults(write_json=options.write_json)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/systrace_runner.py", line 68, in OutputSystraceResults
    self._out_filename)
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 98, in GenerateHTMLOutput
    html_file.write(_ConvertToHtmlString(result.raw_data))
  File "/home/reichelt/Programme/Android-Studio/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 120, in _ConvertToHtmlString
    raise ValueError('Invalid trace result format for HTML output')
ValueError: Invalid trace result format for HTML output

Is there somthing I need to do in order to get systrace working?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.