Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: tools/ll_prof.py

Issue 1796863002: Remove snapshot log parsing and option from tools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gyp/v8.gyp ('k') | tools/tick-processor.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ll_prof.py
diff --git a/tools/ll_prof.py b/tools/ll_prof.py
index 5fd90cb5c2aa044139dd09e88d3fe30e757b0e54..0ae5f6881ef3965afbc1b7e892c878f4436b673c 100755
--- a/tools/ll_prof.py
+++ b/tools/ll_prof.py
@@ -66,20 +66,20 @@ We have a convenience script that handles all of the above for you:
Examples:
# Print flat profile with annotated disassembly for the 10 top
- # symbols. Use default log names and include the snapshot log.
- $ %prog --snapshot --disasm-top=10
+ # symbols. Use default log names.
+ $ %prog --disasm-top=10
# Print flat profile with annotated disassembly for all used symbols.
# Use default log names and include kernel symbols into analysis.
$ %prog --disasm-all --kernel
# Print flat profile. Use custom log names.
- $ %prog --log=foo.log --snapshot-log=snap-foo.log --trace=foo.data --snapshot
+ $ %prog --log=foo.log --trace=foo.data
"""
JS_ORIGIN = "js"
-JS_SNAPSHOT_ORIGIN = "js-snapshot"
+
class Code(object):
"""Code object."""
@@ -199,12 +199,8 @@ class Code(object):
self.origin)
def _GetDisasmLines(self, arch, options):
- if self.origin == JS_ORIGIN or self.origin == JS_SNAPSHOT_ORIGIN:
- inplace = False
- filename = options.log + ".ll"
- else:
- inplace = True
- filename = self.origin
+ inplace = True
+ filename = self.origin
return disasm.GetDisasmLines(filename,
self.origin_offset,
self.end_address - self.start_address,
@@ -328,30 +324,6 @@ class CodeInfo(object):
self.header_size = header_size
-class SnapshotLogReader(object):
- """V8 snapshot log reader."""
-
- _SNAPSHOT_CODE_NAME_RE = re.compile(
- r"snapshot-code-name,(\d+),\"(.*)\"")
-
- def __init__(self, log_name):
- self.log_name = log_name
-
- def ReadNameMap(self):
- log = open(self.log_name, "r")
- try:
- snapshot_pos_to_name = {}
- for line in log:
- match = SnapshotLogReader._SNAPSHOT_CODE_NAME_RE.match(line)
- if match:
- pos = int(match.group(1))
- name = match.group(2)
- snapshot_pos_to_name[pos] = name
- finally:
- log.close()
- return snapshot_pos_to_name
-
-
class LogReader(object):
"""V8 low-level (binary) log reader."""
@@ -368,13 +340,11 @@ class LogReader(object):
_SNAPSHOT_POSITION_TAG = "P"
Yang 2016/03/15 10:13:19 This is no longer necessary?
Stefano Sanfilippo 2016/04/04 16:22:30 Removed, together with all the related code.
_CODE_MOVING_GC_TAG = "G"
- def __init__(self, log_name, code_map, snapshot_pos_to_name):
+ def __init__(self, log_name, code_map):
self.log_file = open(log_name, "r")
self.log = mmap.mmap(self.log_file.fileno(), 0, mmap.MAP_PRIVATE)
self.log_pos = 0
self.code_map = code_map
- self.snapshot_pos_to_name = snapshot_pos_to_name
- self.address_to_snapshot_name = {}
self.arch = self.log[:self.log.find("\0")]
self.log_pos += len(self.arch) + 1
@@ -404,7 +374,6 @@ class LogReader(object):
self.log_pos += 1
if tag == LogReader._CODE_MOVING_GC_TAG:
- self.address_to_snapshot_name.clear()
return
if tag == LogReader._CODE_CREATE_TAG:
@@ -412,12 +381,8 @@ class LogReader(object):
self.log_pos += ctypes.sizeof(event)
start_address = event.code_address
end_address = start_address + event.code_size
- if start_address in self.address_to_snapshot_name:
- name = self.address_to_snapshot_name[start_address]
- origin = JS_SNAPSHOT_ORIGIN
- else:
- name = self.log[self.log_pos:self.log_pos + event.name_size]
- origin = JS_ORIGIN
+ name = self.log[self.log_pos:self.log_pos + event.name_size]
+ origin = JS_ORIGIN
self.log_pos += event.name_size
origin_offset = self.log_pos
self.log_pos += event.code_size
@@ -464,9 +429,6 @@ class LogReader(object):
self.log_pos += ctypes.sizeof(event)
start_address = event.address
snapshot_pos = event.position
- if snapshot_pos in self.snapshot_pos_to_name:
- self.address_to_snapshot_name[start_address] = \
- self.snapshot_pos_to_name[snapshot_pos]
continue
assert False, "Unknown tag %s" % tag
@@ -884,16 +846,9 @@ def PrintDot(code_map, options):
if __name__ == "__main__":
parser = optparse.OptionParser(USAGE)
- parser.add_option("--snapshot-log",
- default="obj/release/snapshot.log",
- help="V8 snapshot log file name [default: %default]")
parser.add_option("--log",
default="v8.log",
help="V8 log file name [default: %default]")
- parser.add_option("--snapshot",
- default=False,
- action="store_true",
- help="process V8 snapshot log [default: %default]")
parser.add_option("--trace",
default="perf.data",
help="perf trace file name [default: %default]")
@@ -931,12 +886,7 @@ if __name__ == "__main__":
options, args = parser.parse_args()
if not options.quiet:
- if options.snapshot:
- print "V8 logs: %s, %s, %s.ll" % (options.snapshot_log,
- options.log,
- options.log)
- else:
- print "V8 log: %s, %s.ll (no snapshot)" % (options.log, options.log)
+ print "V8 log: %s, %s.ll" % (options.log, options.log)
print "Perf trace file: %s" % options.trace
V8_GC_FAKE_MMAP = options.gc_fake_mmap
@@ -958,17 +908,10 @@ if __name__ == "__main__":
mmap_time = 0
sample_time = 0
- # Process the snapshot log to fill the snapshot name map.
- snapshot_name_map = {}
- if options.snapshot:
- snapshot_log_reader = SnapshotLogReader(log_name=options.snapshot_log)
- snapshot_name_map = snapshot_log_reader.ReadNameMap()
-
# Initialize the log reader.
code_map = CodeMap()
log_reader = LogReader(log_name=options.log + ".ll",
- code_map=code_map,
- snapshot_pos_to_name=snapshot_name_map)
+ code_map=code_map)
if not options.quiet:
print "Generated code architecture: %s" % log_reader.arch
print
« no previous file with comments | « tools/gyp/v8.gyp ('k') | tools/tick-processor.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698