summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2017-05-12 20:25:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-05-12 20:25:18 +0000
commitde5a219880000e76af49137e5fb3ab44d6da7d5e (patch)
treee7fff48c2ad899a92b5bb5b83a14a3f05e2e70eb
parentadbce4d3b7eb6f4c7c78084feefc208fc8a768fe (diff)
parent9c5dc5b040c049021fd7d0ac7bab7317cdcf0a2f (diff)
downloadextras-de5a219880000e76af49137e5fb3ab44d6da7d5e.tar.gz
Merge "simpleperf: make pprof_proto_generator.py work without binary_cache_dir."
-rw-r--r--simpleperf/scripts/pprof_proto_generator.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/simpleperf/scripts/pprof_proto_generator.py b/simpleperf/scripts/pprof_proto_generator.py
index c09469ad..fa2fdb11 100644
--- a/simpleperf/scripts/pprof_proto_generator.py
+++ b/simpleperf/scripts/pprof_proto_generator.py
@@ -256,7 +256,10 @@ class PprofProfileGenerator(object):
self.lib = ReportLib()
if config.get('binary_cache_dir'):
- self.lib.SetSymfs(config['binary_cache_dir'])
+ if not os.path.isdir(config.get('binary_cache_dir')):
+ config['binary_cache_dir'] = ''
+ else:
+ self.lib.SetSymfs(config['binary_cache_dir'])
if config.get('record_file'):
self.lib.SetRecordFile(config['record_file'])
if config.get('kallsyms'):
@@ -315,7 +318,8 @@ class PprofProfileGenerator(object):
self.add_sample(sample)
# 2. Generate line info for locations and functions.
- self.gen_source_lines()
+ if self.config.get('binary_cache_dir'):
+ self.gen_source_lines()
# 3. Produce samples/locations/functions in profile
for sample in self.sample_list:
@@ -510,8 +514,12 @@ class PprofProfileGenerator(object):
profile_mapping.build_id = mapping.build_id_id
profile_mapping.has_filenames = True
profile_mapping.has_functions = True
- profile_mapping.has_line_numbers = True
- profile_mapping.has_inline_frames = True
+ if self.config.get('binary_cache_dir'):
+ profile_mapping.has_line_numbers = True
+ profile_mapping.has_inline_frames = True
+ else:
+ profile_mapping.has_line_numbers = False
+ profile_mapping.has_inline_frames = False
def gen_profile_location(self, location):
profile_location = self.profile.location.add()