Systrace does not work with "Permission Denied"

When I try to start Systrace I get this stack:

python systrace.py --app=com.mydebug.app view gfx sched dalvik wm

Starting tracing (stop with enter)
Tracing completed. Collecting output...
CRITICAL:root:(TimeoutThread-1-for-Thread-1) Exception on ReadFile(1829d365, /sys/kernel/debug/tracing/tracing_on, retries=3, timeout=30), attempt 1 of 4: AdbCommandFailedError("(device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmpyO_hQZ/tmp_ReadFileWithPull: failed with exit status 1 and output:\n- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmpyO_hQZ/tmp_ReadFileWithPull': remote Permission denied\n",)
CRITICAL:root:(TimeoutThread-2-for-Thread-1) Exception on ReadFile(1829d365, /sys/kernel/debug/tracing/tracing_on, retries=3, timeout=30), attempt 2 of 4: AdbCommandFailedError("(device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmpVakBVH/tmp_ReadFileWithPull: failed with exit status 1 and output:\n- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmpVakBVH/tmp_ReadFileWithPull': remote Permission denied\n",)
CRITICAL:root:(TimeoutThread-3-for-Thread-1) Exception on ReadFile(1829d365, /sys/kernel/debug/tracing/tracing_on, retries=3, timeout=30), attempt 3 of 4: AdbCommandFailedError("(device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmp_IoryO/tmp_ReadFileWithPull: failed with exit status 1 and output:\n- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmp_IoryO/tmp_ReadFileWithPull': remote Permission denied\n",)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 194, in _collect_and_preprocess
    trace_data = self._collect_trace_data()
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 261, in _collect_trace_data
    self._stop_trace()
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 244, in _stop_trace
    if int(self._device_utils.ReadFile(is_trace_enabled_file)):
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 57, in timeout_retry_wrapper
    retry_if_func=retry_if_func)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/timeout_retry.py", line 159, in Run
    error_log_func=error_log_func)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 186, in JoinAll
    self._JoinAll(watcher, timeout)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/utils/reraiser_thread.py", line 158, in _JoinAll
    thread.ReraiseIfException()
  File "/Users/vinay.nagaraj/Library/Android/sdk/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 "/Users/vinay.nagaraj/Library/Android/sdk/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 "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 47, in impl
    return f(*args, **kwargs)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 1658, in ReadFile
    return self._ReadFileWithPull(device_path)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/device_utils.py", line 1610, in _ReadFileWithPull
    self.adb.Pull(device_path, host_temp_path)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/sdk/adb_wrapper.py", line 454, in Pull
    self._RunDeviceAdbCmd(cmd, timeout, retries)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/sdk/adb_wrapper.py", line 282, in _RunDeviceAdbCmd
    check_error=check_error)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 51, in timeout_retry_wrapper
    return impl()
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/decorators.py", line 47, in impl
    return f(*args, **kwargs)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/../../devil/devil/android/sdk/adb_wrapper.py", line 258, in _RunAdbCmd
    args, output, status, device_serial)
AdbCommandFailedError: (device: 1829d365) adb pull /sys/kernel/debug/tracing/tracing_on /tmp/tmpw7qK2c/tmp_ReadFileWithPull: failed with exit status 1 and output:
- adb: error: failed to copy '/sys/kernel/debug/tracing/tracing_on' to '/tmp/tmpw7qK2c/tmp_ReadFileWithPull': remote Permission denied


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 "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 194, in main
    main_impl(sys.argv)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 191, in main_impl
    controller.OutputSystraceResults(write_json=options.write_json)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/systrace_runner.py", line 67, in OutputSystraceResults
    self._out_filename)
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 70, in GenerateHTMLOutput
    html_file.write(_ConvertToHtmlString(result.raw_data))
  File "/Users/vinay.nagaraj/Library/Android/sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 92, in _ConvertToHtmlString
    raise ValueError('Invalid trace result format for HTML output')
ValueError: Invalid trace result format for HTML output

      

I can adb pull

files from my SD card. I tried to run systrace

from my android-sdk platform tools and I tried to run systrace cloned from catapult git report but I get the same error. Unable to run systrace on production devices?

Which feature is that I can successfully run systrace using Android Device Monitor, but I don't like how it makes me insert the time, unlike the command line tool. Also, regardless of the buffer time and size I choose when I run systrace through Device Monitor, it always only logs for 5 seconds.

+3


source to share


1 answer


This shows that you have no rights to this directory. Here is the answer for your reference. https://community.nxp.com/thread/380812

===================== PS EDIT 1 ========================== ====



enter codeCorrect answer:

Those are the tweaks you have to perform in the IMX6-L500-100-ANDROID-SOURCE-BSP in order to have Systrace support:

On lp5.1, sabersd-6dl, to enable systrace, do below step:

1. In kernel config (/kernel_imx/arch/arm/configs/imx_v7_android_defconfig), add below items

CONFIG_TRACING=y
CONFIG_FTRACE=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_FUNCTION_TRACER=y
CONFIG_IRQSOFF_TRACER=y
CONFIG_SCHED_TRACER=y
CONFIG_STACK_TRACER=y
CONFIG_EVENT_TRACING=y
CONFIG_FTRACE_SYSCALLS=y

      

  1. In the /fsl/sabresd_6dq/init.rc device: change "mount debugfs none / sys / kernel / debug /" to "mount debugfs none / sys / kernel / debug / mode = 755"

  2. make an image and then burn on the board

  3. After booting run "chmod -R 777 / sys / kernel / debug / tracing"

0


source







All Articles