You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`
def record_trace(config, profile_target):
"""Runs Perfetto with the provided configuration to record a trace.
Args:
config: The Perfetto config to be used for tracing/profiling.
profile_target: The directory where the recorded trace is output.
"""
NULL = open(os.devnull)
NO_OUT = {
'stdout': NULL,
'stderr': NULL,
}
if not release_or_newer('T'):
sys.exit("This tool requires Android T+ to run.")
`
def record_trace(config, profile_target):
"""Runs Perfetto with the provided configuration to record a trace.
Args:
config: The Perfetto config to be used for tracing/profiling.
profile_target: The directory where the recorded trace is output.
"""
NULL = open(os.devnull)
NO_OUT = {
'stdout': NULL,
'stderr': NULL,
}
if not release_or_newer('T'):
sys.exit("This tool requires Android T+ to run.")
on Window 10, can't push file before close it. it will cause adb push failure
https://raw.githubusercontent.com/google/perfetto/main/tools/cpu_profile
`
def record_trace(config, profile_target):
"""Runs Perfetto with the provided configuration to record a trace.
Args:
config: The Perfetto config to be used for tracing/profiling.
profile_target: The directory where the recorded trace is output.
"""
NULL = open(os.devnull)
NO_OUT = {
'stdout': NULL,
'stderr': NULL,
}
if not release_or_newer('T'):
sys.exit("This tool requires Android T+ to run.")
#Push configuration to the device.
tf = tempfile.NamedTemporaryFile()
tf.file.write(config.encode('utf-8'))
tf.file.flush()
profile_config_path = '/data/misc/perfetto-configs/config-' + UUID
adb_check_output(['adb', 'push', tf.name, profile_config_path])
tf.close()
`
should change to
`
def record_trace(config, profile_target):
"""Runs Perfetto with the provided configuration to record a trace.
Args:
config: The Perfetto config to be used for tracing/profiling.
profile_target: The directory where the recorded trace is output.
"""
NULL = open(os.devnull)
NO_OUT = {
'stdout': NULL,
'stderr': NULL,
}
if not release_or_newer('T'):
sys.exit("This tool requires Android T+ to run.")
#Push configuration to the device.
tf = tempfile.NamedTemporaryFile(delete=False)
tf.file.write(config.encode('utf-8'))
tf.file.flush()
tf.close()
profile_config_path = '/data/misc/perfetto-configs/config-' + UUID
adb_check_output(['adb', 'push', tf.name, profile_config_path])
os.remove(tf.name)
`
The text was updated successfully, but these errors were encountered: