Commit 9e39a9ff authored by ssanfilippo's avatar ssanfilippo Committed by Commit bot

Remove snapshot log parsing and option from tools.

LOG=N

Review URL: https://codereview.chromium.org/1796863002

Cr-Commit-Position: refs/heads/master@{#35268}
parent 34c4e27e
...@@ -509,9 +509,6 @@ action("run_mksnapshot") { ...@@ -509,9 +509,6 @@ action("run_mksnapshot") {
"./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)", "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)",
"root_out_dir") + "/mksnapshot", "root_out_dir") + "/mksnapshot",
root_build_dir), root_build_dir),
"--log-snapshot-positions",
"--logfile",
rebase_path("$target_gen_dir/snapshot.log", root_build_dir),
"--startup_src", "--startup_src",
rebase_path("$target_gen_dir/snapshot.cc", root_build_dir), rebase_path("$target_gen_dir/snapshot.cc", root_build_dir),
] ]
......
...@@ -1003,8 +1003,6 @@ DEFINE_BOOL(log_code, false, ...@@ -1003,8 +1003,6 @@ DEFINE_BOOL(log_code, false,
DEFINE_BOOL(log_gc, false, DEFINE_BOOL(log_gc, false,
"Log heap samples on garbage collection for the hp2ps tool.") "Log heap samples on garbage collection for the hp2ps tool.")
DEFINE_BOOL(log_handles, false, "Log global handle events.") DEFINE_BOOL(log_handles, false, "Log global handle events.")
DEFINE_BOOL(log_snapshot_positions, false,
"log positions of (de)serialized objects in the snapshot.")
DEFINE_BOOL(log_suspect, false, "Log suspect operations.") DEFINE_BOOL(log_suspect, false, "Log suspect operations.")
DEFINE_BOOL(prof, false, DEFINE_BOOL(prof, false,
"Log statistical profiling information (implies --log-code).") "Log statistical profiling information (implies --log-code).")
......
...@@ -326,14 +326,6 @@ class LowLevelLogger : public CodeEventLogger { ...@@ -326,14 +326,6 @@ class LowLevelLogger : public CodeEventLogger {
}; };
struct SnapshotPositionStruct {
static const char kTag = 'P';
Address address;
int32_t position;
};
static const char kCodeMovingGCTag = 'G'; static const char kCodeMovingGCTag = 'G';
...@@ -426,17 +418,6 @@ void LowLevelLogger::CodeMoveEvent(AbstractCode* from, Address to) { ...@@ -426,17 +418,6 @@ void LowLevelLogger::CodeMoveEvent(AbstractCode* from, Address to) {
LogWriteStruct(event); LogWriteStruct(event);
} }
void LowLevelLogger::SnapshotPositionEvent(HeapObject* obj, int pos) {
if (obj->IsAbstractCode()) {
SnapshotPositionStruct event;
event.address =
obj->address() +
(obj->IsCode() ? Code::kHeaderSize : BytecodeArray::kHeaderSize);
event.position = pos;
LogWriteStruct(event);
}
}
void LowLevelLogger::LogWriteBytes(const char* bytes, int size) { void LowLevelLogger::LogWriteBytes(const char* bytes, int size) {
size_t rv = fwrite(bytes, 1, size, ll_output_handle_); size_t rv = fwrite(bytes, 1, size, ll_output_handle_);
...@@ -1296,17 +1277,6 @@ void Logger::CodeNameEvent(Address addr, int pos, const char* code_name) { ...@@ -1296,17 +1277,6 @@ void Logger::CodeNameEvent(Address addr, int pos, const char* code_name) {
msg.WriteToLogFile(); msg.WriteToLogFile();
} }
void Logger::SnapshotPositionEvent(HeapObject* obj, int pos) {
if (!log_->IsEnabled()) return;
LL_LOG(SnapshotPositionEvent(obj, pos));
if (!FLAG_log_snapshot_positions) return;
Log::MessageBuilder msg(log_);
msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]);
msg.AppendAddress(obj->address());
msg.Append(",%d", pos);
msg.WriteToLogFile();
}
void Logger::SharedFunctionInfoMoveEvent(Address from, Address to) { void Logger::SharedFunctionInfoMoveEvent(Address from, Address to) {
if (!is_logging_code_events()) return; if (!is_logging_code_events()) return;
...@@ -1781,11 +1751,6 @@ bool Logger::SetUp(Isolate* isolate) { ...@@ -1781,11 +1751,6 @@ bool Logger::SetUp(Isolate* isolate) {
if (is_initialized_) return true; if (is_initialized_) return true;
is_initialized_ = true; is_initialized_ = true;
// --ll-prof implies --log-code and --log-snapshot-positions.
if (FLAG_ll_prof) {
FLAG_log_snapshot_positions = true;
}
std::ostringstream log_file_name; std::ostringstream log_file_name;
PrepareLogFileName(log_file_name, isolate, FLAG_logfile); PrepareLogFileName(log_file_name, isolate, FLAG_logfile);
log_->Initialize(log_file_name.str().c_str()); log_->Initialize(log_file_name.str().c_str());
......
...@@ -89,7 +89,6 @@ struct TickSample; ...@@ -89,7 +89,6 @@ struct TickSample;
V(CODE_DELETE_EVENT, "code-delete") \ V(CODE_DELETE_EVENT, "code-delete") \
V(CODE_MOVING_GC, "code-moving-gc") \ V(CODE_MOVING_GC, "code-moving-gc") \
V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \
V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \
V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \ V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \
V(TICK_EVENT, "tick") \ V(TICK_EVENT, "tick") \
V(REPEAT_META_EVENT, "repeat") \ V(REPEAT_META_EVENT, "repeat") \
...@@ -260,7 +259,6 @@ class Logger { ...@@ -260,7 +259,6 @@ class Logger {
void SharedFunctionInfoMoveEvent(Address from, Address to); void SharedFunctionInfoMoveEvent(Address from, Address to);
void CodeNameEvent(Address addr, int pos, const char* code_name); void CodeNameEvent(Address addr, int pos, const char* code_name);
void SnapshotPositionEvent(HeapObject* obj, int pos);
// ==== Events logged by --log-gc. ==== // ==== Events logged by --log-gc. ====
// Heap sampling events: start, end, and individual types. // Heap sampling events: start, end, and individual types.
......
...@@ -373,15 +373,11 @@ void Deserializer::ReadObject(int space_number, Object** write_back) { ...@@ -373,15 +373,11 @@ void Deserializer::ReadObject(int space_number, Object** write_back) {
isolate_->heap()->OnAllocationEvent(obj, size); isolate_->heap()->OnAllocationEvent(obj, size);
Object** current = reinterpret_cast<Object**>(address); Object** current = reinterpret_cast<Object**>(address);
Object** limit = current + (size >> kPointerSizeLog2); Object** limit = current + (size >> kPointerSizeLog2);
int position = source_.position();
if (ReadData(current, limit, space_number, address)) { if (ReadData(current, limit, space_number, address)) {
// Only post process if object content has not been deferred. // Only post process if object content has not been deferred.
obj = PostProcessNewObject(obj, space_number); obj = PostProcessNewObject(obj, space_number);
} }
if (FLAG_log_snapshot_positions) {
LOG(isolate_, SnapshotPositionEvent(obj, position));
}
Object* write_back_obj = obj; Object* write_back_obj = obj;
UnalignedCopy(write_back, &write_back_obj); UnalignedCopy(write_back, &write_back_obj);
......
...@@ -136,11 +136,9 @@ char* GetExtraCode(char* filename, const char* description) { ...@@ -136,11 +136,9 @@ char* GetExtraCode(char* filename, const char* description) {
int main(int argc, char** argv) { int main(int argc, char** argv) {
// By default, log code create information in the snapshot.
i::FLAG_log_code = true;
i::FLAG_logfile_per_isolate = false;
// Make mksnapshot runs predictable to create reproducible snapshots. // Make mksnapshot runs predictable to create reproducible snapshots.
i::FLAG_predictable = true; i::FLAG_predictable = true;
// Print the usage if an error occurs when parsing the command line // Print the usage if an error occurs when parsing the command line
// flags or if the help flag is set. // flags or if the help flag is set.
int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
......
...@@ -318,8 +318,6 @@ void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space, ...@@ -318,8 +318,6 @@ void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space,
serializer_->code_address_map_->Lookup(object_->address()); serializer_->code_address_map_->Lookup(object_->address());
LOG(serializer_->isolate_, LOG(serializer_->isolate_,
CodeNameEvent(object_->address(), sink_->Position(), code_name)); CodeNameEvent(object_->address(), sink_->Position(), code_name));
LOG(serializer_->isolate_,
SnapshotPositionEvent(object_, sink_->Position()));
} }
BackReference back_reference; BackReference back_reference;
......
...@@ -384,7 +384,6 @@ function driveTickProcessorTest( ...@@ -384,7 +384,6 @@ function driveTickProcessorTest(
TickProcessor.CALL_GRAPH_SIZE, TickProcessor.CALL_GRAPH_SIZE,
ignoreUnknown, ignoreUnknown,
stateFilter, stateFilter,
undefined,
"0", "0",
"auto,auto", "auto,auto",
false, false,
......
...@@ -211,10 +211,6 @@ ...@@ -211,10 +211,6 @@
'<(INTERMEDIATE_DIR)/snapshot.cc', '<(INTERMEDIATE_DIR)/snapshot.cc',
], ],
'variables': { 'variables': {
'mksnapshot_flags': [
'--log-snapshot-positions',
'--logfile', '<(INTERMEDIATE_DIR)/snapshot.log',
],
'conditions': [ 'conditions': [
['v8_random_seed!=0', { ['v8_random_seed!=0', {
'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'],
...@@ -311,8 +307,6 @@ ...@@ -311,8 +307,6 @@
# variable. # variable.
'mksnapshot_flags_ignition': [ 'mksnapshot_flags_ignition': [
'--ignition', '--ignition',
'--log-snapshot-positions',
'--logfile', '<(INTERMEDIATE_DIR)/snapshot_ignition.log',
], ],
'conditions': [ 'conditions': [
['v8_random_seed!=0', { ['v8_random_seed!=0', {
...@@ -376,10 +370,6 @@ ...@@ -376,10 +370,6 @@
'action_name': 'run_mksnapshot (external)', 'action_name': 'run_mksnapshot (external)',
'inputs': ['<(mksnapshot_exec)'], 'inputs': ['<(mksnapshot_exec)'],
'variables': { 'variables': {
'mksnapshot_flags': [
'--log-snapshot-positions',
'--logfile', '<(INTERMEDIATE_DIR)/snapshot.log',
],
'conditions': [ 'conditions': [
['v8_random_seed!=0', { ['v8_random_seed!=0', {
'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'], 'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'],
......
...@@ -66,20 +66,20 @@ We have a convenience script that handles all of the above for you: ...@@ -66,20 +66,20 @@ We have a convenience script that handles all of the above for you:
Examples: Examples:
# Print flat profile with annotated disassembly for the 10 top # Print flat profile with annotated disassembly for the 10 top
# symbols. Use default log names and include the snapshot log. # symbols. Use default log names.
$ %prog --snapshot --disasm-top=10 $ %prog --disasm-top=10
# Print flat profile with annotated disassembly for all used symbols. # Print flat profile with annotated disassembly for all used symbols.
# Use default log names and include kernel symbols into analysis. # Use default log names and include kernel symbols into analysis.
$ %prog --disasm-all --kernel $ %prog --disasm-all --kernel
# Print flat profile. Use custom log names. # 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_ORIGIN = "js"
JS_SNAPSHOT_ORIGIN = "js-snapshot"
class Code(object): class Code(object):
"""Code object.""" """Code object."""
...@@ -199,12 +199,8 @@ class Code(object): ...@@ -199,12 +199,8 @@ class Code(object):
self.origin) self.origin)
def _GetDisasmLines(self, arch, options): def _GetDisasmLines(self, arch, options):
if self.origin == JS_ORIGIN or self.origin == JS_SNAPSHOT_ORIGIN: inplace = True
inplace = False filename = self.origin
filename = options.log + ".ll"
else:
inplace = True
filename = self.origin
return disasm.GetDisasmLines(filename, return disasm.GetDisasmLines(filename,
self.origin_offset, self.origin_offset,
self.end_address - self.start_address, self.end_address - self.start_address,
...@@ -328,30 +324,6 @@ class CodeInfo(object): ...@@ -328,30 +324,6 @@ class CodeInfo(object):
self.header_size = header_size 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): class LogReader(object):
"""V8 low-level (binary) log reader.""" """V8 low-level (binary) log reader."""
...@@ -365,16 +337,13 @@ class LogReader(object): ...@@ -365,16 +337,13 @@ class LogReader(object):
_CODE_CREATE_TAG = "C" _CODE_CREATE_TAG = "C"
_CODE_MOVE_TAG = "M" _CODE_MOVE_TAG = "M"
_SNAPSHOT_POSITION_TAG = "P"
_CODE_MOVING_GC_TAG = "G" _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_file = open(log_name, "r")
self.log = mmap.mmap(self.log_file.fileno(), 0, mmap.MAP_PRIVATE) self.log = mmap.mmap(self.log_file.fileno(), 0, mmap.MAP_PRIVATE)
self.log_pos = 0 self.log_pos = 0
self.code_map = code_map 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.arch = self.log[:self.log.find("\0")]
self.log_pos += len(self.arch) + 1 self.log_pos += len(self.arch) + 1
...@@ -394,17 +363,12 @@ class LogReader(object): ...@@ -394,17 +363,12 @@ class LogReader(object):
self.code_delete_struct = LogReader._DefineStruct([ self.code_delete_struct = LogReader._DefineStruct([
("address", pointer_type)]) ("address", pointer_type)])
self.snapshot_position_struct = LogReader._DefineStruct([
("address", pointer_type),
("position", ctypes.c_int32)])
def ReadUpToGC(self): def ReadUpToGC(self):
while self.log_pos < self.log.size(): while self.log_pos < self.log.size():
tag = self.log[self.log_pos] tag = self.log[self.log_pos]
self.log_pos += 1 self.log_pos += 1
if tag == LogReader._CODE_MOVING_GC_TAG: if tag == LogReader._CODE_MOVING_GC_TAG:
self.address_to_snapshot_name.clear()
return return
if tag == LogReader._CODE_CREATE_TAG: if tag == LogReader._CODE_CREATE_TAG:
...@@ -412,12 +376,8 @@ class LogReader(object): ...@@ -412,12 +376,8 @@ class LogReader(object):
self.log_pos += ctypes.sizeof(event) self.log_pos += ctypes.sizeof(event)
start_address = event.code_address start_address = event.code_address
end_address = start_address + event.code_size end_address = start_address + event.code_size
if start_address in self.address_to_snapshot_name: name = self.log[self.log_pos:self.log_pos + event.name_size]
name = self.address_to_snapshot_name[start_address] origin = JS_ORIGIN
origin = JS_SNAPSHOT_ORIGIN
else:
name = self.log[self.log_pos:self.log_pos + event.name_size]
origin = JS_ORIGIN
self.log_pos += event.name_size self.log_pos += event.name_size
origin_offset = self.log_pos origin_offset = self.log_pos
self.log_pos += event.code_size self.log_pos += event.code_size
...@@ -458,17 +418,6 @@ class LogReader(object): ...@@ -458,17 +418,6 @@ class LogReader(object):
self.code_map.Add(code) self.code_map.Add(code)
continue continue
if tag == LogReader._SNAPSHOT_POSITION_TAG:
event = self.snapshot_position_struct.from_buffer(self.log,
self.log_pos)
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 assert False, "Unknown tag %s" % tag
def Dispose(self): def Dispose(self):
...@@ -884,16 +833,9 @@ def PrintDot(code_map, options): ...@@ -884,16 +833,9 @@ def PrintDot(code_map, options):
if __name__ == "__main__": if __name__ == "__main__":
parser = optparse.OptionParser(USAGE) 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", parser.add_option("--log",
default="v8.log", default="v8.log",
help="V8 log file name [default: %default]") 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", parser.add_option("--trace",
default="perf.data", default="perf.data",
help="perf trace file name [default: %default]") help="perf trace file name [default: %default]")
...@@ -931,12 +873,7 @@ if __name__ == "__main__": ...@@ -931,12 +873,7 @@ if __name__ == "__main__":
options, args = parser.parse_args() options, args = parser.parse_args()
if not options.quiet: if not options.quiet:
if options.snapshot: print "V8 log: %s, %s.ll" % (options.log, options.log)
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 "Perf trace file: %s" % options.trace print "Perf trace file: %s" % options.trace
V8_GC_FAKE_MMAP = options.gc_fake_mmap V8_GC_FAKE_MMAP = options.gc_fake_mmap
...@@ -958,17 +895,10 @@ if __name__ == "__main__": ...@@ -958,17 +895,10 @@ if __name__ == "__main__":
mmap_time = 0 mmap_time = 0
sample_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. # Initialize the log reader.
code_map = CodeMap() code_map = CodeMap()
log_reader = LogReader(log_name=options.log + ".ll", log_reader = LogReader(log_name=options.log + ".ll",
code_map=code_map, code_map=code_map)
snapshot_pos_to_name=snapshot_name_map)
if not options.quiet: if not options.quiet:
print "Generated code architecture: %s" % log_reader.arch print "Generated code architecture: %s" % log_reader.arch
print print
......
...@@ -106,7 +106,6 @@ function run(args) { ...@@ -106,7 +106,6 @@ function run(args) {
var callGraphSize = 5; var callGraphSize = 5;
var ignoreUnknown = true; var ignoreUnknown = true;
var stateFilter = null; var stateFilter = null;
var snapshotLogProcessor = null;
var range = range_start_override + "," + range_end_override; var range = range_start_override + "," + range_end_override;
var tickProcessor = new TickProcessor(entriesProvider, var tickProcessor = new TickProcessor(entriesProvider,
...@@ -114,7 +113,6 @@ function run(args) { ...@@ -114,7 +113,6 @@ function run(args) {
callGraphSize, callGraphSize,
ignoreUnknown, ignoreUnknown,
stateFilter, stateFilter,
snapshotLogProcessor,
distortion, distortion,
range); range);
for (var i = 0; i < content_lines.length; i++) { for (var i = 0; i < content_lines.length; i++) {
......
...@@ -82,7 +82,6 @@ function print(arg) { ...@@ -82,7 +82,6 @@ function print(arg) {
function start_process() { function start_process() {
ArgumentsProcessor.DEFAULTS = { ArgumentsProcessor.DEFAULTS = {
logFileName: 'v8.log', logFileName: 'v8.log',
snapshotLogFileName: null,
platform: 'unix', platform: 'unix',
stateFilter: null, stateFilter: null,
callGraphSize: 5, callGraphSize: 5,
...@@ -98,8 +97,6 @@ function start_process() { ...@@ -98,8 +97,6 @@ function start_process() {
'mac': MacCppEntriesProvider 'mac': MacCppEntriesProvider
}; };
var snapshotLogProcessor; // not used
var tickProcessor = new TickProcessor( var tickProcessor = new TickProcessor(
new (entriesProviders[ArgumentsProcessor.DEFAULTS.platform])( new (entriesProviders[ArgumentsProcessor.DEFAULTS.platform])(
ArgumentsProcessor.DEFAULTS.nm, ArgumentsProcessor.DEFAULTS.nm,
...@@ -107,8 +104,7 @@ function start_process() { ...@@ -107,8 +104,7 @@ function start_process() {
ArgumentsProcessor.DEFAULTS.separateIc, ArgumentsProcessor.DEFAULTS.separateIc,
ArgumentsProcessor.DEFAULTS.callGraphSize, ArgumentsProcessor.DEFAULTS.callGraphSize,
ArgumentsProcessor.DEFAULTS.ignoreUnknown, ArgumentsProcessor.DEFAULTS.ignoreUnknown,
ArgumentsProcessor.DEFAULTS.stateFilter, ArgumentsProcessor.DEFAULTS.stateFilter);
snapshotLogProcessor);
tickProcessor.processLogChunk(v8log_content); tickProcessor.processLogChunk(v8log_content);
tickProcessor.printStatistics(); tickProcessor.printStatistics();
......
...@@ -61,18 +61,12 @@ if (params.sourceMap) { ...@@ -61,18 +61,12 @@ if (params.sourceMap) {
initSourceMapSupport(); initSourceMapSupport();
sourceMap = SourceMap.load(params.sourceMap); sourceMap = SourceMap.load(params.sourceMap);
} }
var snapshotLogProcessor;
if (params.snapshotLogFileName) {
snapshotLogProcessor = new SnapshotLogProcessor();
snapshotLogProcessor.processLogFile(params.snapshotLogFileName);
}
var tickProcessor = new TickProcessor( var tickProcessor = new TickProcessor(
new (entriesProviders[params.platform])(params.nm, params.targetRootFS), new (entriesProviders[params.platform])(params.nm, params.targetRootFS),
params.separateIc, params.separateIc,
params.callGraphSize, params.callGraphSize,
params.ignoreUnknown, params.ignoreUnknown,
params.stateFilter, params.stateFilter,
snapshotLogProcessor,
params.distortion, params.distortion,
params.range, params.range,
sourceMap, sourceMap,
......
...@@ -70,88 +70,12 @@ function parseState(s) { ...@@ -70,88 +70,12 @@ function parseState(s) {
} }
function SnapshotLogProcessor() {
LogReader.call(this, {
'code-creation': {
parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'],
processor: this.processCodeCreation },
'code-move': { parsers: [parseInt, parseInt],
processor: this.processCodeMove },
'code-delete': { parsers: [parseInt],
processor: this.processCodeDelete },
'function-creation': null,
'function-move': null,
'function-delete': null,
'sfi-move': null,
'snapshot-pos': { parsers: [parseInt, parseInt],
processor: this.processSnapshotPosition }});
V8Profile.prototype.handleUnknownCode = function(operation, addr) {
var op = Profile.Operation;
switch (operation) {
case op.MOVE:
print('Snapshot: Code move event for unknown code: 0x' +
addr.toString(16));
break;
case op.DELETE:
print('Snapshot: Code delete event for unknown code: 0x' +
addr.toString(16));
break;
}
};
this.profile_ = new V8Profile();
this.serializedEntries_ = [];
}
inherits(SnapshotLogProcessor, LogReader);
SnapshotLogProcessor.prototype.processCodeCreation = function(
type, kind, start, size, name, maybe_func) {
if (maybe_func.length) {
var funcAddr = parseInt(maybe_func[0]);
var state = parseState(maybe_func[1]);
this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
} else {
this.profile_.addCode(type, name, start, size);
}
};
SnapshotLogProcessor.prototype.processCodeMove = function(from, to) {
this.profile_.moveCode(from, to);
};
SnapshotLogProcessor.prototype.processCodeDelete = function(start) {
this.profile_.deleteCode(start);
};
SnapshotLogProcessor.prototype.processSnapshotPosition = function(addr, pos) {
this.serializedEntries_[pos] = this.profile_.findEntry(addr);
};
SnapshotLogProcessor.prototype.processLogFile = function(fileName) {
var contents = readFile(fileName);
this.processLogChunk(contents);
};
SnapshotLogProcessor.prototype.getSerializedEntryName = function(pos) {
var entry = this.serializedEntries_[pos];
return entry ? entry.getRawName() : null;
};
function TickProcessor( function TickProcessor(
cppEntriesProvider, cppEntriesProvider,
separateIc, separateIc,
callGraphSize, callGraphSize,
ignoreUnknown, ignoreUnknown,
stateFilter, stateFilter,
snapshotLogProcessor,
distortion, distortion,
range, range,
sourceMap, sourceMap,
...@@ -170,8 +94,6 @@ function TickProcessor( ...@@ -170,8 +94,6 @@ function TickProcessor(
processor: this.processCodeDelete }, processor: this.processCodeDelete },
'sfi-move': { parsers: [parseInt, parseInt], 'sfi-move': { parsers: [parseInt, parseInt],
processor: this.processFunctionMove }, processor: this.processFunctionMove },
'snapshot-pos': { parsers: [parseInt, parseInt],
processor: this.processSnapshotPosition },
'tick': { 'tick': {
parsers: [parseInt, parseInt, parseInt, parsers: [parseInt, parseInt, parseInt,
parseInt, parseInt, 'var-args'], parseInt, parseInt, 'var-args'],
...@@ -202,7 +124,6 @@ function TickProcessor( ...@@ -202,7 +124,6 @@ function TickProcessor(
this.callGraphSize_ = callGraphSize; this.callGraphSize_ = callGraphSize;
this.ignoreUnknown_ = ignoreUnknown; this.ignoreUnknown_ = ignoreUnknown;
this.stateFilter_ = stateFilter; this.stateFilter_ = stateFilter;
this.snapshotLogProcessor_ = snapshotLogProcessor;
this.sourceMap = sourceMap; this.sourceMap = sourceMap;
this.deserializedEntriesNames_ = []; this.deserializedEntriesNames_ = [];
var ticks = this.ticks_ = var ticks = this.ticks_ =
...@@ -362,14 +283,6 @@ TickProcessor.prototype.processFunctionMove = function(from, to) { ...@@ -362,14 +283,6 @@ TickProcessor.prototype.processFunctionMove = function(from, to) {
}; };
TickProcessor.prototype.processSnapshotPosition = function(addr, pos) {
if (this.snapshotLogProcessor_) {
this.deserializedEntriesNames_[addr] =
this.snapshotLogProcessor_.getSerializedEntryName(pos);
}
};
TickProcessor.prototype.includeTick = function(vmState) { TickProcessor.prototype.includeTick = function(vmState) {
return this.stateFilter_ == null || this.stateFilter_ == vmState; return this.stateFilter_ == null || this.stateFilter_ == vmState;
}; };
...@@ -880,8 +793,6 @@ function ArgumentsProcessor(args) { ...@@ -880,8 +793,6 @@ function ArgumentsProcessor(args) {
'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)'], 'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)'],
'--target': ['targetRootFS', '', '--target': ['targetRootFS', '',
'Specify the target root directory for cross environment'], 'Specify the target root directory for cross environment'],
'--snapshot-log': ['snapshotLogFileName', 'snapshot.log',
'Specify snapshot log file to use (e.g. --snapshot-log=snapshot.log)'],
'--range': ['range', 'auto,auto', '--range': ['range', 'auto,auto',
'Specify the range limit as [start],[end]'], 'Specify the range limit as [start],[end]'],
'--distortion': ['distortion', 0, '--distortion': ['distortion', 0,
...@@ -906,7 +817,6 @@ function ArgumentsProcessor(args) { ...@@ -906,7 +817,6 @@ function ArgumentsProcessor(args) {
ArgumentsProcessor.DEFAULTS = { ArgumentsProcessor.DEFAULTS = {
logFileName: 'v8.log', logFileName: 'v8.log',
snapshotLogFileName: null,
platform: 'unix', platform: 'unix',
stateFilter: null, stateFilter: null,
callGraphSize: 5, callGraphSize: 5,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment