From d627e7aee04b0f1a62621f8e4777f03124584d00 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Wed, 1 Nov 2017 17:33:03 -0700 Subject: simpleperf: don't add source code and disassembly for unknown functions. Unknown functions are for samples without symbol info (Either because the shared library can't be found, or the symbol table is missing). So it doesn't make sence to add source code or disassembly for unknown functions. Bug: http://b/66914187 Test: run report_html.py manually. Test: run test.py. Change-Id: Ic1573792b6a522db61969a66dcb68c737d38749d --- simpleperf/scripts/report_html.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simpleperf/scripts/report_html.py b/simpleperf/scripts/report_html.py index 28302e53..e30d07a7 100644 --- a/simpleperf/scripts/report_html.py +++ b/simpleperf/scripts/report_html.py @@ -627,6 +627,8 @@ class RecordData(object): addr2line = Addr2Nearestline(self.ndk_path, self.binary_cache_path) # Request line range for each function. for function in self.functions.id_to_func.values(): + if function.func_name == 'unknown': + continue lib_name = self.libs.get_lib_name(function.lib_id) addr2line.add_addr(lib_name, function.start_addr, function.start_addr) addr2line.add_addr(lib_name, function.start_addr, @@ -646,6 +648,8 @@ class RecordData(object): # Set line range for each function. for function in self.functions.id_to_func.values(): + if function.func_name == 'unknown': + continue dso = addr2line.get_dso(self.libs.get_lib_name(function.lib_id)) start_source = addr2line.get_addr_source(dso, function.start_addr) end_source = addr2line.get_addr_source(dso, @@ -689,6 +693,8 @@ class RecordData(object): """ objdump = Objdump(self.ndk_path, self.binary_cache_path) for function in self.functions.id_to_func.values(): + if function.func_name == 'unknown': + continue lib_name = self.libs.get_lib_name(function.lib_id) code = objdump.disassemble_code(lib_name, function.start_addr, function.addr_len) function.disassembly = code -- cgit v1.2.3