Lines Matching +full:profile +full:- +full:traces
8 # http://www.apache.org/licenses/LICENSE-2.0
15 """Runs tracing with CPU profiling enabled, and symbolizes traces if requested.
18 https://perfetto.dev/docs/quickstart/callstack-sampling
38 UUID = str(uuid.uuid4())[-6:]
57 "https://perfetto.dev/docs/contributing/getting-started#bugs.".format(
64 return subprocess.check_output(command).decode('utf-8')
77 """Parses, validates, and returns command-line arguments for this script."""
79 traces if requested.
82 https://perfetto.dev/docs/quickstart/callstack-sampling
86 "-f",
87 "--frequency",
94 "-d",
95 "--duration",
96 help="Duration of profile (ms). 0 to run until interrupted. "
103 "-e",
104 "--event",
115 "-k",
116 "--kernel-frames",
121 "-n",
122 "--name",
123 help="Comma-separated list of names of processes to be profiled.",
127 "-p",
128 "--partial-matching",
129 help="If set, enables \"partial matching\" on the strings in --names/-n."
131 "names include any of the values in --names/-n as substrings will be "
135 "-c",
136 "--config",
138 "If provided, --frequency/-f, --duration/-d, and --name/-n are not used.",
142 "--no-annotations",
147 "--print-config",
151 "-o",
152 "--output",
160 sys.exit("--name/-n should not be specified with --config/-c.")
162 sys.exit("-e/--event should not be specified with --config/-c.")
164 sys.exit("One of --names/-n or --config/-c is required.")
170 """Returns a list of currently-running processes whose names match
174 args: The command-line arguments provided to this script.
184 for line in adb_check_output(['adb', 'shell', 'ps', '-A']).splitlines():
202 args: The command-line arguments provided to this script.
307 """Returns the target where the trace/profile will be output. Creates a
311 args: The command-line arguments provided to this script.
343 tf.file.write(config.encode('utf-8'))
345 profile_config_path = '/data/misc/perfetto-configs/config-' + UUID
350 profile_device_path = '/data/misc/perfetto-traces/profile-' + UUID
351 perfetto_command = ('perfetto --txt -c {} -o {} -d')
355 'adb', 'exec-out',
368 ['adb', 'shell', '[ -d /proc/{} ]'.format(perfetto_pid)], **NO_OUT) == 0
374 adb_check_output(['adb', 'shell', 'kill', '-INT', str(perfetto_pid)])
381 ['adb', 'shell', '[ -d /proc/{} ]'.format(perfetto_pid)]) == 0
384 profile_host_path = os.path.join(profile_target, 'raw-trace')
417 """Attempts symbolization of the recorded trace/profile, if symbols are
429 trace_file = os.path.join(profile_target, 'raw-trace')
448 trace_file = os.path.join(profile_target, 'symbolized-trace')
452 sys.exit("Unable to write symbolized profile to disk: {}".format(error))
468 conversion_args = [traceconv, 'profile', '--perf'] + (
469 ['--no-annotations'] if args.no_annotations else []) + [trace_file]
476 for word in traceconv_output.decode('utf-8').split():
477 if 'perf_profile-' in word: