• Home
  • Raw
  • Download

Lines Matching +full:profile +full:- +full:traces

8 #      http://www.apache.org/licenses/LICENSE-2.0
40 UUID = str(uuid.uuid4())[-6:]
94 "https://perfetto.dev/docs/data-sources/native-heap-profiler#troubleshooting.",
99 return ('https://perfetto.dev/docs/data-sources/native-heap-profiler'
100 '#known-issues-android{}'.format(number))
114 'ro.build.version.release_or_codename']).decode('utf-8').strip()
127 'ro.system.build.version.sdk']).decode('utf-8').strip())
132 'ro.build.version.codename']).decode('utf-8').strip()
136 ORDER = ['-n', '-p', '-i', '-o']
144 return result, action.option_strings[0].strip('-')
161 "-i",
162 "--interval",
168 "-d",
169 "--duration",
170 help="Duration of profile (ms). 0 to run until interrupted. "
174 # This flag is a no-op now. We never start heapprofd explicitly using system
177 "--no-start", help="Do not start heapprofd.", action='store_true')
179 "-p",
180 "--pid",
181 help="Comma-separated list of PIDs to "
182 "profile.",
185 "-n",
186 "--name",
187 help="Comma-separated list of process "
188 "names to profile.",
191 "-c",
192 "--continuous-dump",
197 "--heaps",
198 help="Comma-separated list of heaps to collect, e.g: malloc,art. "
202 "--all-heaps",
206 "--no-android-tree-symbolization",
211 "--disable-selinux",
214 "profile.")
216 "--no-versions",
220 "--no-running",
224 "--no-startup",
227 "the profile. Requires Android 11.")
229 "--shmem-size",
236 "--block-client",
243 "--block-client-timeout",
244 help="If --block-client is given, do not block any allocation for "
248 "--no-block-client",
250 "profile early.",
253 "--idle-allocations",
259 "--dump-at-max",
264 "--disable-fork-teardown",
269 "--simpleperf",
271 help="Get simpleperf profile of heapprofd. This is "
274 "--traceconv-binary", help="Path to local trace to text. For debugging.")
276 "--no-annotations",
281 "--print-config",
285 "-o",
286 "--output",
291 "--print-options", action="store_true", help=argparse.SUPPRESS)
300 "FATAL: Both block-client and no-block-client given.", file=sys.stderr)
312 print("FATAL: shmem-size is not a multiple of 4096.", file=sys.stderr)
315 print("FATAL: shmem-size is less than 8192.", file=sys.stderr)
317 if args.shmem_size & (args.shmem_size - 1):
318 print("FATAL: shmem-size is not a power of two.", file=sys.stderr)
383 # TODO(fmayer): Maybe feature detect whether we can remove traces instead of
387 profile_device_path = '/data/misc/perfetto-traces/profile-' + UUID
390 'whoami']).decode('utf-8').strip()
391 profile_device_path = '/data/misc/perfetto-traces/profile-' + user
394 'perfetto --txt -c - -o ' + profile_device_path + ' -d')
398 'getenforce']).decode('utf-8').strip()
406 'adb', 'shell', 'mkdir -p /data/local/tmp/heapprofd_profile && '
408 '(nohup simpleperf record -g -p $(pidof heapprofd) 2>&1 &) '
429 ['adb', 'exec-out', perfetto_cmd.format(cfg=cfg)]).strip()
444 ['adb', 'shell', '[ -d /proc/{} ]'.format(perfetto_pid)], **NOOUT) == 0
451 subprocess.call(['adb', 'shell', 'kill', '-INT', str(perfetto_pid)])
453 subprocess.check_call(['adb', 'shell', 'killall', '-INT', 'simpleperf'])
456 ['adb', 'shell', '[ -f /proc/$(pidof simpleperf)/exe ]'], **NOOUT) == 0:
460 print("Pulled simpleperf profile to " + profile_target +
466 ['adb', 'shell', '[ -d /proc/{} ]'.format(perfetto_pid)]) == 0
469 profile_host_path = os.path.join(profile_target, 'raw-trace')
477 print('Wrote profile to {}'.format(profile_host_path))
496 trace_file = os.path.join(profile_target, 'raw-trace')
503 os.path.join(profile_target, 'raw-trace')
515 with open(os.path.join(profile_target, 'deobfuscation-packets'), 'w') as fd:
518 os.path.join(profile_target, 'raw-trace')
524 concat_files.append(os.path.join(profile_target, 'deobfuscation-packets'))
531 with open(os.path.join(profile_target, 'symbolized-trace'), 'wb') as out:
539 trace_file = os.path.join(profile_target, 'symbolized-trace')
541 conversion_args = [traceconv_binary, 'profile'] + (
542 ['--no-annotations'] if args.no_annotations else []) + [trace_file]
545 for word in traceconv_output.decode('utf-8').split():
546 if 'heap_profile-' in word:
566 os.path.dirname(profile_target), "heap_profile-latest")
577 print("The raw-trace file can be viewed using https://ui.perfetto.dev.")
580 print("The two above are equivalent. The raw-trace contains the union of " +