diff options
Diffstat (limited to 'deps/v8/tools')
-rw-r--r-- | deps/v8/tools/gen-postmortem-metadata.py | 14 | ||||
-rwxr-xr-x | deps/v8/tools/grokdump.py | 151 | ||||
-rw-r--r-- | deps/v8/tools/gyp/v8.gyp | 10 | ||||
-rwxr-xr-x | deps/v8/tools/ll_prof.py | 63 | ||||
-rwxr-xr-x | deps/v8/tools/plot-timer-events | 71 | ||||
-rw-r--r-- | deps/v8/tools/plot-timer-events.js | 576 | ||||
-rwxr-xr-x | deps/v8/tools/run-llprof.sh | 69 | ||||
-rwxr-xr-x | deps/v8/tools/run-tests.py | 13 | ||||
-rw-r--r-- | deps/v8/tools/tick-processor.html | 168 | ||||
-rw-r--r-- | deps/v8/tools/tickprocessor.js | 16 |
10 files changed, 100 insertions, 1051 deletions
diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 0acb658c53..f59cfd3033 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -61,7 +61,7 @@ consts_misc = [ { 'name': 'StringEncodingMask', 'value': 'kStringEncodingMask' }, { 'name': 'TwoByteStringTag', 'value': 'kTwoByteStringTag' }, - { 'name': 'AsciiStringTag', 'value': 'kOneByteStringTag' }, + { 'name': 'AsciiStringTag', 'value': 'kAsciiStringTag' }, { 'name': 'StringRepresentationMask', 'value': 'kStringRepresentationMask' }, @@ -76,15 +76,16 @@ consts_misc = [ { 'name': 'SmiTag', 'value': 'kSmiTag' }, { 'name': 'SmiTagMask', 'value': 'kSmiTagMask' }, { 'name': 'SmiValueShift', 'value': 'kSmiTagSize' }, - { 'name': 'SmiShiftSize', 'value': 'kSmiShiftSize' }, { 'name': 'PointerSizeLog2', 'value': 'kPointerSizeLog2' }, + { 'name': 'prop_idx_transitions', + 'value': 'DescriptorArray::kTransitionsIndex' }, { 'name': 'prop_idx_first', 'value': 'DescriptorArray::kFirstIndex' }, { 'name': 'prop_type_field', 'value': 'FIELD' }, { 'name': 'prop_type_first_phantom', - 'value': 'TRANSITION' }, + 'value': 'MAP_TRANSITION' }, { 'name': 'prop_type_mask', 'value': 'PropertyDetails::TypeField::kMask' }, @@ -106,13 +107,14 @@ extras_accessors = [ 'JSObject, elements, Object, kElementsOffset', 'FixedArray, data, uintptr_t, kHeaderSize', 'Map, instance_attributes, int, kInstanceAttributesOffset', + 'Map, instance_descriptors, int, kInstanceDescriptorsOrBitField3Offset', 'Map, inobject_properties, int, kInObjectPropertiesOffset', 'Map, instance_size, int, kInstanceSizeOffset', 'HeapNumber, value, double, kValueOffset', 'ConsString, first, String, kFirstOffset', 'ConsString, second, String, kSecondOffset', 'ExternalString, resource, Object, kResourceOffset', - 'SeqOneByteString, chars, char, kHeaderSize', + 'SeqAsciiString, chars, char, kHeaderSize', 'SharedFunctionInfo, code, Code, kCodeOffset', 'Code, instruction_start, uintptr_t, kHeaderSize', 'Code, instruction_size, int, kInstructionSizeOffset', @@ -126,7 +128,7 @@ extras_accessors = [ expected_classes = [ 'ConsString', 'FixedArray', 'HeapNumber', 'JSArray', 'JSFunction', 'JSObject', 'JSRegExp', 'JSValue', 'Map', 'Oddball', 'Script', - 'SeqOneByteString', 'SharedFunctionInfo' + 'SeqAsciiString', 'SharedFunctionInfo' ]; @@ -291,7 +293,7 @@ def load_objects(): cctype.find('Sliced') == -1): if (cctype.find('Ascii') != -1): cctype = re.sub('AsciiString$', - 'SeqOneByteString', cctype); + 'SeqAsciiString', cctype); else: cctype = re.sub('String$', 'SeqString', cctype); diff --git a/deps/v8/tools/grokdump.py b/deps/v8/tools/grokdump.py index b51e4e0e7f..46ead5e465 100755 --- a/deps/v8/tools/grokdump.py +++ b/deps/v8/tools/grokdump.py @@ -863,83 +863,80 @@ INSTANCE_TYPES = { # } # printf("}\n"); KNOWN_MAPS = { - 0x08081: (128, "MetaMap"), - 0x080a5: (163, "FixedArrayMap"), - 0x080c9: (130, "OddballMap"), - 0x080ed: (163, "FixedCOWArrayMap"), - 0x08111: (163, "ScopeInfoMap"), - 0x08135: (132, "HeapNumberMap"), - 0x08159: (133, "ForeignMap"), - 0x0817d: (64, "SymbolMap"), - 0x081a1: (68, "AsciiSymbolMap"), - 0x081c5: (65, "ConsSymbolMap"), - 0x081e9: (69, "ConsAsciiSymbolMap"), - 0x0820d: (66, "ExternalSymbolMap"), - 0x08231: (74, "ExternalSymbolWithAsciiDataMap"), - 0x08255: (70, "ExternalAsciiSymbolMap"), - 0x08279: (82, "ShortExternalSymbolMap"), - 0x0829d: (90, "ShortExternalSymbolWithAsciiDataMap"), - 0x082c1: (86, "ShortExternalAsciiSymbolMap"), - 0x082e5: (0, "StringMap"), - 0x08309: (4, "AsciiStringMap"), - 0x0832d: (1, "ConsStringMap"), - 0x08351: (5, "ConsAsciiStringMap"), - 0x08375: (3, "SlicedStringMap"), - 0x08399: (7, "SlicedAsciiStringMap"), - 0x083bd: (2, "ExternalStringMap"), - 0x083e1: (10, "ExternalStringWithAsciiDataMap"), - 0x08405: (6, "ExternalAsciiStringMap"), - 0x08429: (18, "ShortExternalStringMap"), - 0x0844d: (26, "ShortExternalStringWithAsciiDataMap"), - 0x08471: (22, "ShortExternalAsciiStringMap"), - 0x08495: (0, "UndetectableStringMap"), - 0x084b9: (4, "UndetectableAsciiStringMap"), - 0x084dd: (145, "FixedDoubleArrayMap"), - 0x08501: (134, "ByteArrayMap"), - 0x08525: (135, "FreeSpaceMap"), - 0x08549: (144, "ExternalPixelArrayMap"), - 0x0856d: (136, "ExternalByteArrayMap"), - 0x08591: (137, "ExternalUnsignedByteArrayMap"), - 0x085b5: (138, "ExternalShortArrayMap"), - 0x085d9: (139, "ExternalUnsignedShortArrayMap"), - 0x085fd: (140, "ExternalIntArrayMap"), - 0x08621: (141, "ExternalUnsignedIntArrayMap"), - 0x08645: (142, "ExternalFloatArrayMap"), - 0x08669: (163, "NonStrictArgumentsElementsMap"), - 0x0868d: (143, "ExternalDoubleArrayMap"), - 0x086b1: (129, "CodeMap"), - 0x086d5: (131, "GlobalPropertyCellMap"), - 0x086f9: (146, "OnePointerFillerMap"), - 0x0871d: (146, "TwoPointerFillerMap"), - 0x08741: (147, "AccessorInfoMap"), - 0x08765: (148, "AccessorPairMap"), - 0x08789: (149, "AccessCheckInfoMap"), - 0x087ad: (150, "InterceptorInfoMap"), - 0x087d1: (151, "CallHandlerInfoMap"), - 0x087f5: (152, "FunctionTemplateInfoMap"), - 0x08819: (153, "ObjectTemplateInfoMap"), - 0x0883d: (154, "SignatureInfoMap"), - 0x08861: (155, "TypeSwitchInfoMap"), - 0x08885: (156, "ScriptMap"), - 0x088a9: (157, "CodeCacheMap"), - 0x088cd: (158, "PolymorphicCodeCacheMap"), - 0x088f1: (159, "TypeFeedbackInfoMap"), - 0x08915: (160, "AliasedArgumentsEntryMap"), - 0x08939: (161, "DebugInfoMap"), - 0x0895d: (162, "BreakPointInfoMap"), - 0x08981: (163, "HashTableMap"), - 0x089a5: (163, "FunctionContextMap"), - 0x089c9: (163, "CatchContextMap"), - 0x089ed: (163, "WithContextMap"), - 0x08a11: (163, "BlockContextMap"), - 0x08a35: (163, "ModuleContextMap"), - 0x08a59: (163, "GlobalContextMap"), - 0x08a7d: (163, "NativeContextMap"), - 0x08aa1: (164, "SharedFunctionInfoMap"), - 0x08ac5: (165, "JSMessageObjectMap"), - 0x08ae9: (170, "ExternalMap"), - 0x08b0d: (170, "NeanderMap"), - 0x08b31: (170, ""), + 0x08081: (134, "ByteArrayMap"), + 0x080a1: (128, "MetaMap"), + 0x080c1: (130, "OddballMap"), + 0x080e1: (163, "FixedArrayMap"), + 0x08101: (68, "AsciiSymbolMap"), + 0x08121: (132, "HeapNumberMap"), + 0x08141: (135, "FreeSpaceMap"), + 0x08161: (146, "OnePointerFillerMap"), + 0x08181: (146, "TwoPointerFillerMap"), + 0x081a1: (131, "GlobalPropertyCellMap"), + 0x081c1: (164, "SharedFunctionInfoMap"), + 0x081e1: (4, "AsciiStringMap"), + 0x08201: (163, "GlobalContextMap"), + 0x08221: (129, "CodeMap"), + 0x08241: (163, "ScopeInfoMap"), + 0x08261: (163, "FixedCOWArrayMap"), + 0x08281: (145, "FixedDoubleArrayMap"), + 0x082a1: (163, "HashTableMap"), + 0x082c1: (0, "StringMap"), + 0x082e1: (64, "SymbolMap"), + 0x08301: (1, "ConsStringMap"), + 0x08321: (5, "ConsAsciiStringMap"), + 0x08341: (3, "SlicedStringMap"), + 0x08361: (7, "SlicedAsciiStringMap"), + 0x08381: (65, "ConsSymbolMap"), + 0x083a1: (69, "ConsAsciiSymbolMap"), + 0x083c1: (66, "ExternalSymbolMap"), + 0x083e1: (74, "ExternalSymbolWithAsciiDataMap"), + 0x08401: (70, "ExternalAsciiSymbolMap"), + 0x08421: (2, "ExternalStringMap"), + 0x08441: (10, "ExternalStringWithAsciiDataMap"), + 0x08461: (6, "ExternalAsciiStringMap"), + 0x08481: (82, "ShortExternalSymbolMap"), + 0x084a1: (90, "ShortExternalSymbolWithAsciiDataMap"), + 0x084c1: (86, "ShortExternalAsciiSymbolMap"), + 0x084e1: (18, "ShortExternalStringMap"), + 0x08501: (26, "ShortExternalStringWithAsciiDataMap"), + 0x08521: (22, "ShortExternalAsciiStringMap"), + 0x08541: (0, "UndetectableStringMap"), + 0x08561: (4, "UndetectableAsciiStringMap"), + 0x08581: (144, "ExternalPixelArrayMap"), + 0x085a1: (136, "ExternalByteArrayMap"), + 0x085c1: (137, "ExternalUnsignedByteArrayMap"), + 0x085e1: (138, "ExternalShortArrayMap"), + 0x08601: (139, "ExternalUnsignedShortArrayMap"), + 0x08621: (140, "ExternalIntArrayMap"), + 0x08641: (141, "ExternalUnsignedIntArrayMap"), + 0x08661: (142, "ExternalFloatArrayMap"), + 0x08681: (143, "ExternalDoubleArrayMap"), + 0x086a1: (163, "NonStrictArgumentsElementsMap"), + 0x086c1: (163, "FunctionContextMap"), + 0x086e1: (163, "CatchContextMap"), + 0x08701: (163, "WithContextMap"), + 0x08721: (163, "BlockContextMap"), + 0x08741: (163, "ModuleContextMap"), + 0x08761: (165, "JSMessageObjectMap"), + 0x08781: (133, "ForeignMap"), + 0x087a1: (170, "NeanderMap"), + 0x087c1: (158, "PolymorphicCodeCacheMap"), + 0x087e1: (156, "ScriptMap"), + 0x08801: (147, "AccessorInfoMap"), + 0x08821: (148, "AccessorPairMap"), + 0x08841: (149, "AccessCheckInfoMap"), + 0x08861: (150, "InterceptorInfoMap"), + 0x08881: (151, "CallHandlerInfoMap"), + 0x088a1: (152, "FunctionTemplateInfoMap"), + 0x088c1: (153, "ObjectTemplateInfoMap"), + 0x088e1: (154, "SignatureInfoMap"), + 0x08901: (155, "TypeSwitchInfoMap"), + 0x08921: (157, "CodeCacheMap"), + 0x08941: (159, "TypeFeedbackInfoMap"), + 0x08961: (160, "AliasedArgumentsEntryMap"), + 0x08981: (161, "DebugInfoMap"), + 0x089a1: (162, "BreakPointInfoMap"), } diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp index aad07c7094..7a54ef4fce 100644 --- a/deps/v8/tools/gyp/v8.gyp +++ b/deps/v8/tools/gyp/v8.gyp @@ -69,14 +69,6 @@ ], }, 'conditions': [ - ['OS=="android"', { - 'libraries': [ - '-llog', - ], - 'include_dirs': [ - 'src/common/android/include', - ], - }], ['OS=="mac"', { 'xcode_settings': { 'OTHER_LDFLAGS': ['-dynamiclib', '-all_load'] @@ -361,7 +353,6 @@ '../../src/isolate.cc', '../../src/isolate.h', '../../src/json-parser.h', - '../../src/json-stringifier.h', '../../src/jsregexp.cc', '../../src/jsregexp.h', '../../src/lazy-instance.h', @@ -788,7 +779,6 @@ '../../src/macros.py', '../../src/proxy.js', '../../src/collection.js', - '../../src/object-observe.js' ], }, 'actions': [ diff --git a/deps/v8/tools/ll_prof.py b/deps/v8/tools/ll_prof.py index 216929d1e2..3afe179d2f 100755 --- a/deps/v8/tools/ll_prof.py +++ b/deps/v8/tools/ll_prof.py @@ -45,7 +45,7 @@ USAGE="""usage: %prog [OPTION]... Analyses V8 and perf logs to produce profiles. Perf logs can be collected using a command like: - $ perf record -R -e cycles -c 10000 -f -i ./d8 bench.js --ll-prof + $ perf record -R -e cycles -c 10000 -f -i ./shell bench.js --ll-prof # -R: collect all data # -e cycles: use cpu-cycles event (run "perf list" for details) # -c 10000: write a sample after each 10000 events @@ -54,16 +54,6 @@ Perf logs can be collected using a command like: # --ll-prof shell flag enables the right V8 logs This will produce a binary trace file (perf.data) that %prog can analyse. -IMPORTANT: - The kernel has an internal maximum for events per second, it is 100K by - default. That's not enough for "-c 10000". Set it to some higher value: - $ echo 10000000 | sudo tee /proc/sys/kernel/perf_event_max_sample_rate - You can also make the warning about kernel address maps go away: - $ echo 0 | sudo tee /proc/sys/kernel/kptr_restrict - -We have a convenience script that handles all of the above for you: - $ tools/run-llprof.sh ./d8 bench.js - Examples: # Print flat profile with annotated disassembly for the 10 top # symbols. Use default log names and include the snapshot log. @@ -85,10 +75,6 @@ class Code(object): """Code object.""" _id = 0 - UNKNOWN = 0 - V8INTERNAL = 1 - FULL_CODEGEN = 2 - OPTIMIZED = 3 def __init__(self, name, start_address, end_address, origin, origin_offset): self.id = Code._id @@ -102,14 +88,6 @@ class Code(object): self.self_ticks = 0 self.self_ticks_map = None self.callee_ticks = None - if name.startswith("LazyCompile:*"): - self.codetype = Code.OPTIMIZED - elif name.startswith("LazyCompile:"): - self.codetype = Code.FULL_CODEGEN - elif name.startswith("v8::internal::"): - self.codetype = Code.V8INTERNAL - else: - self.codetype = Code.UNKNOWN def AddName(self, name): assert self.name != name @@ -207,7 +185,7 @@ class Code(object): class CodePage(object): """Group of adjacent code objects.""" - SHIFT = 20 # 1M pages + SHIFT = 12 # 4K pages SIZE = (1 << SHIFT) MASK = ~(SIZE - 1) @@ -529,7 +507,6 @@ class Descriptor(object): # for the gory details. -# Reference: struct perf_file_header in kernel/tools/perf/util/header.h TRACE_HEADER_DESC = Descriptor([ ("magic", "u64"), ("size", "u64"), @@ -543,7 +520,6 @@ TRACE_HEADER_DESC = Descriptor([ ]) -# Reference: /usr/include/linux/perf_event.h PERF_EVENT_ATTR_DESC = Descriptor([ ("type", "u32"), ("size", "u32"), @@ -553,13 +529,12 @@ PERF_EVENT_ATTR_DESC = Descriptor([ ("read_format", "u64"), ("flags", "u64"), ("wakeup_events_or_watermark", "u32"), - ("bp_type", "u32"), + ("bt_type", "u32"), ("bp_addr", "u64"), - ("bp_len", "u64") + ("bp_len", "u64"), ]) -# Reference: /usr/include/linux/perf_event.h PERF_EVENT_HEADER_DESC = Descriptor([ ("type", "u32"), ("misc", "u16"), @@ -567,7 +542,6 @@ PERF_EVENT_HEADER_DESC = Descriptor([ ]) -# Reference: kernel/events/core.c PERF_MMAP_EVENT_BODY_DESC = Descriptor([ ("pid", "u32"), ("tid", "u32"), @@ -592,7 +566,6 @@ PERF_SAMPLE_STREAM_ID = 1 << 9 PERF_SAMPLE_RAW = 1 << 10 -# Reference: /usr/include/perf_event.h, the comment for PERF_RECORD_SAMPLE. PERF_SAMPLE_EVENT_BODY_FIELDS = [ ("ip", "u64", PERF_SAMPLE_IP), ("pid", "u32", PERF_SAMPLE_TID), @@ -729,12 +702,8 @@ class LibraryRepo(object): # Unfortunately, section headers span two lines, so we have to # keep the just seen section name (from the first line in each # section header) in the after_section variable. - if mmap_info.filename.endswith(".ko"): - dynamic_symbols = "" - else: - dynamic_symbols = "-T" process = subprocess.Popen( - "%s -h -t %s -C %s" % (OBJDUMP_BIN, dynamic_symbols, mmap_info.filename), + "%s -h -t -T -C %s" % (OBJDUMP_BIN, mmap_info.filename), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) pipe = process.stdout after_section = None @@ -826,7 +795,7 @@ def PrintReport(code_map, library_repo, arch, ticks, options): code.PrintAnnotated(arch, options) print print "Ticks per library:" - mmap_infos = [m for m in library_repo.infos if m.ticks > 0] + mmap_infos = [m for m in library_repo.infos] mmap_infos.sort(key=lambda m: m.ticks, reverse=True) for mmap_info in mmap_infos: mmap_ticks = mmap_info.ticks @@ -916,9 +885,6 @@ if __name__ == "__main__": ticks = 0 missed_ticks = 0 really_missed_ticks = 0 - optimized_ticks = 0 - generated_ticks = 0 - v8_internal_ticks = 0 mmap_time = 0 sample_time = 0 @@ -962,12 +928,6 @@ if __name__ == "__main__": code = code_map.Find(sample.ip) if code: code.Tick(sample.ip) - if code.codetype == Code.OPTIMIZED: - optimized_ticks += 1 - elif code.codetype == Code.FULL_CODEGEN: - generated_ticks += 1 - elif code.codetype == Code.V8INTERNAL: - v8_internal_ticks += 1 else: missed_ticks += 1 if not library_repo.Tick(sample.ip) and not code: @@ -987,21 +947,12 @@ if __name__ == "__main__": PrintReport(code_map, library_repo, log_reader.arch, ticks, options) if not options.quiet: - def PrintTicks(number, total, description): - print("%10d %5.1f%% ticks in %s" % - (number, 100.0*number/total, description)) print print "Stats:" print "%10d total trace events" % events print "%10d total ticks" % ticks print "%10d ticks not in symbols" % missed_ticks - unaccounted = "unaccounted ticks" - if really_missed_ticks > 0: - unaccounted += " (probably in the kernel, try --kernel)" - PrintTicks(really_missed_ticks, ticks, unaccounted) - PrintTicks(optimized_ticks, ticks, "ticks in optimized code") - PrintTicks(generated_ticks, ticks, "ticks in other lazily compiled code") - PrintTicks(v8_internal_ticks, ticks, "ticks in v8::internal::*") + print "%10d unaccounted ticks" % really_missed_ticks print "%10d total symbols" % len([c for c in code_map.AllCode()]) print "%10d used symbols" % len([c for c in code_map.UsedCode()]) print "%9.2fs library processing time" % mmap_time diff --git a/deps/v8/tools/plot-timer-events b/deps/v8/tools/plot-timer-events deleted file mode 100755 index 581e0ae333..0000000000 --- a/deps/v8/tools/plot-timer-events +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -# find the name of the log file to process, it must not start with a dash. -log_file="v8.log" -for arg in "$@" -do - if ! expr "X${arg}" : "^X-" > /dev/null; then - log_file=${arg} - fi -done - -tools_path=`cd $(dirname "$0");pwd` -if [ ! "$D8_PATH" ]; then - d8_public=`which d8` - if [ -x "$d8_public" ]; then D8_PATH=$(dirname "$d8_public"); fi -fi -[ -n "$D8_PATH" ] || D8_PATH=$tools_path/.. -d8_exec=$D8_PATH/d8 - -if [ ! -x "$d8_exec" ]; then - D8_PATH=`pwd`/out/native - d8_exec=$D8_PATH/d8 -fi - -if [ ! -x "$d8_exec" ]; then - d8_exec=`grep -m 1 -o '".*/d8"' $log_file | sed 's/"//g'` -fi - -if [ ! -x "$d8_exec" ]; then - echo "d8 shell not found in $D8_PATH" - echo "To build, execute 'make native' from the V8 directory" - exit 1 -fi - -if [ -n "$DISTORTION" ]; then - distortion=$DISTORTION -else - # Try to find out how much the instrumentation overhead is. - calibration_log=calibration.log - calibration_script="for (var i = 0; i < 1000000; i++) print();" - - $d8_exec --nocrankshaft --prof --logfile $calibration_log \ - --log-timer-events -e "$calibration_script" > /dev/null - t_1=`grep "V8.Execute" $calibration_log | tail -n1 | awk -F, '{print $4}'` - n_1=`grep "timer-event" $calibration_log | wc -l` - - $d8_exec --nocrankshaft --prof --logfile $calibration_log \ - --log-internal-timer-events -e "$calibration_script" > /dev/null - t_2=`grep "V8.Execute" $calibration_log | tail -n1 | awk -F, '{print $4}'` - n_2=`grep "timer-event" $calibration_log | wc -l` - - rm $calibration_log - - # Overhead in picoseconds. - distortion=`echo "1000*($t_1 - $t_2)/($n_1 - $n_2)" | bc` -fi - -if [ -n "$PLOT_RANGE" ]; then - plot_range=$PLOT_RANGE -else - plot_range=auto,auto -fi - -echo "DISTORTION=$distortion" -echo "PLOT_RANGE=$plot_range" - -echo -e "plot-range,$plot_range\ndistortion,$distortion" | cat - $log_file | - $d8_exec $tools_path/csvparser.js \ - $tools_path/splaytree.js $tools_path/codemap.js \ - $tools_path/logreader.js $tools_path/plot-timer-events.js \ - 2>/dev/null | gnuplot > timer-events.png diff --git a/deps/v8/tools/plot-timer-events.js b/deps/v8/tools/plot-timer-events.js deleted file mode 100644 index 4b17e76740..0000000000 --- a/deps/v8/tools/plot-timer-events.js +++ /dev/null @@ -1,576 +0,0 @@ -// Copyright 2012 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -var kV8BinarySuffixes = ["/d8", "/libv8.so"]; -var kStackFrames = 8; - -var kTimerEventWidth = 0.33; -var kExecutionFrameWidth = 0.2; -var kStackFrameWidth = 0.1; -var kGapWidth = 0.05; - -var kPauseTolerance = 0.1; // Milliseconds. -var kY1Offset = 10; - -var kResX = 1600; -var kResY = 600; -var kPauseLabelPadding = 5; -var kNumPauseLabels = 7; -var kTickHalfDuration = 0.5; // Milliseconds -var kCodeKindLabelPadding = 100; - -var num_timer_event = kY1Offset + 0.5; - - -function TimerEvent(color, pause, no_execution) { - this.color = color; - this.pause = pause; - this.ranges = []; - this.no_execution = no_execution; - this.index = ++num_timer_event; -} - - -var TimerEvents = { - 'V8.Execute': new TimerEvent("#000000", false, false), - 'V8.External': new TimerEvent("#3399FF", false, true), - 'V8.CompileFullCode': new TimerEvent("#CC0000", true, true), - 'V8.RecompileSynchronous': new TimerEvent("#CC0044", true, true), - 'V8.RecompileParallel': new TimerEvent("#CC4499", false, false), - 'V8.CompileEval': new TimerEvent("#CC4400", true, true), - 'V8.Parse': new TimerEvent("#00CC00", true, true), - 'V8.PreParse': new TimerEvent("#44CC00", true, true), - 'V8.ParseLazy': new TimerEvent("#00CC44", true, true), - 'V8.GCScavenger': new TimerEvent("#0044CC", true, true), - 'V8.GCCompactor': new TimerEvent("#4444CC", true, true), - 'V8.GCContext': new TimerEvent("#4400CC", true, true), -} - -var kExecutionEvent = TimerEvents['V8.Execute']; - - -function CodeKind(color, kinds) { - this.color = color; - this.in_execution = []; - this.stack_frames = []; - for (var i = 0; i < kStackFrames; i++) this.stack_frames.push([]); - this.kinds = kinds; -} - - -var CodeKinds = { - 'external ': new CodeKind("#3399FF", [-3]), - 'reg.exp. ': new CodeKind("#0000FF", [-2]), - 'runtime ': new CodeKind("#000000", [-1]), - 'full code': new CodeKind("#DD0000", [0]), - 'opt code ': new CodeKind("#00EE00", [1]), - 'code stub': new CodeKind("#FF00FF", [2]), - 'built-in ': new CodeKind("#AA00AA", [3]), - 'inl.cache': new CodeKind("#4444AA", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13]), -} - - -var xrange_start = Infinity; -var xrange_end = 0; -var obj_index = 0; -var execution_pauses = []; -var code_map = new CodeMap(); - -var xrange_start_override = undefined; -var xrange_end_override = undefined; -var distortion_per_entry = 0.005; // Milliseconds - -var sort_by_start = []; -var sort_by_end = []; -var sorted_ticks = []; - - -function Range(start, end) { - // Everthing from here are in milliseconds. - this.start = start; - this.end = end; -} - - -function Tick(tick) { - this.tick = tick; -} - - -Range.prototype.duration = function() { return this.end - this.start; } - - -function ProcessTimerEvent(name, start, length) { - var event = TimerEvents[name]; - if (event === undefined) return; - start /= 1000; // Convert to milliseconds. - length /= 1000; - var end = start + length; - var range = new Range(start, end); - event.ranges.push(range); - sort_by_start.push(range); - sort_by_end.push(range); -} - - -function ProcessCodeCreateEvent(type, kind, address, size, name) { - var code_entry = new CodeMap.CodeEntry(size, name); - code_entry.kind = kind; - code_map.addCode(address, code_entry); -} - - -function ProcessCodeMoveEvent(from, to) { - code_map.moveCode(from, to); -} - - -function ProcessCodeDeleteEvent(address) { - code_map.deleteCode(address); -} - - -function ProcessSharedLibrary(name, start, end) { - var code_entry = new CodeMap.CodeEntry(end - start, name); - code_entry.kind = -3; // External code kind. - for (var i = 0; i < kV8BinarySuffixes.length; i++) { - var suffix = kV8BinarySuffixes[i]; - if (name.indexOf(suffix, name.length - suffix.length) >= 0) { - code_entry.kind = -1; // V8 runtime code kind. - break; - } - } - code_map.addLibrary(start, code_entry); -} - - -function FindCodeKind(kind) { - for (name in CodeKinds) { - if (CodeKinds[name].kinds.indexOf(kind) >= 0) { - return CodeKinds[name]; - } - } -} - - -function ProcessTickEvent(pc, sp, timer, unused_x, unused_y, vmstate, stack) { - timer /= 1000; - var tick = new Tick(timer); - - var entered = false; - var entry = code_map.findEntry(pc); - if (entry) { - FindCodeKind(entry.kind).in_execution.push(tick); - entered = true; - } - - for (var i = 0; i < kStackFrames; i++) { - if (!stack[i]) break; - var entry = code_map.findEntry(stack[i]); - if (entry) { - FindCodeKind(entry.kind).stack_frames[i].push(tick); - entered = true; - } - } - - if (entered) sorted_ticks.push(tick); -} - - -function ProcessDistortion(distortion_in_picoseconds) { - distortion_per_entry = distortion_in_picoseconds / 1000000; -} - - -function ProcessPlotRange(start, end) { - xrange_start_override = start; - xrange_end_override = end; -} - - -function Undistort() { - // Undistort timers wrt instrumentation overhead. - sort_by_start.sort(function(a, b) { return b.start - a.start; }); - sort_by_end.sort(function(a, b) { return b.end - a.end; }); - sorted_ticks.sort(function(a, b) { return b.tick - a.tick; }); - var distortion = 0; - - var next_start = sort_by_start.pop(); - var next_end = sort_by_end.pop(); - var next_tick = sorted_ticks.pop(); - - function UndistortTicksUntil(tick) { - while (next_tick) { - if (next_tick.tick > tick) return; - next_tick.tick -= distortion; - next_tick = sorted_ticks.pop(); - } - } - - while (true) { - var next_start_start = next_start ? next_start.start : Infinity; - var next_end_end = next_end ? next_end.end : Infinity; - if (!next_start && !next_end) { - UndistortTicksUntil(Infinity); - break; - } - if (next_start_start <= next_end_end) { - UndistortTicksUntil(next_start_start); - // Undistort the start time stamp. - next_start.start -= distortion; - next_start = sort_by_start.pop(); - } else { - // Undistort the end time stamp. We completely attribute the overhead - // to the point when we stop and log the timer, so we increase the - // distortion only here. - UndistortTicksUntil(next_end_end); - next_end.end -= distortion; - distortion += distortion_per_entry; - next_end = sort_by_end.pop(); - } - } - - sort_by_start = undefined; - sort_by_end = undefined; - sorted_ticks = undefined; - - // Make sure that start <= end applies for every range. - for (name in TimerEvents) { - var ranges = TimerEvents[name].ranges; - for (var j = 0; j < ranges.length; j++) { - if (ranges[j].end < ranges[j].start) ranges[j].end = ranges[j].start; - } - } -} - - -function CollectData() { - // Collect data from log. - var logreader = new LogReader( - { 'timer-event' : { parsers: [null, parseInt, parseInt], - processor: ProcessTimerEvent }, - 'shared-library': { parsers: [null, parseInt, parseInt], - processor: ProcessSharedLibrary }, - 'code-creation': { parsers: [null, parseInt, parseInt, parseInt, null], - processor: ProcessCodeCreateEvent }, - 'code-move': { parsers: [parseInt, parseInt], - processor: ProcessCodeMoveEvent }, - 'code-delete': { parsers: [parseInt], - processor: ProcessCodeDeleteEvent }, - 'tick': { parsers: [parseInt, parseInt, parseInt, - null, null, parseInt, 'var-args'], - processor: ProcessTickEvent }, - 'distortion': { parsers: [parseInt], - processor: ProcessDistortion }, - 'plot-range': { parsers: [parseInt, parseInt], - processor: ProcessPlotRange }, - }); - - var line; - while (line = readline()) { - logreader.processLogLine(line); - } - - Undistort(); - - // Figure out plot range. - var execution_ranges = kExecutionEvent.ranges; - for (var i = 0; i < execution_ranges.length; i++) { - if (execution_ranges[i].start < xrange_start) { - xrange_start = execution_ranges[i].start; - } - if (execution_ranges[i].end > xrange_end) { - xrange_end = execution_ranges[i].end; - } - } - - // Collect execution pauses. - for (name in TimerEvents) { - var event = TimerEvents[name]; - if (!event.pause) continue; - var ranges = event.ranges; - for (var j = 0; j < ranges.length; j++) execution_pauses.push(ranges[j]); - } - execution_pauses = MergeRanges(execution_pauses); - - // Knock out time not spent in javascript execution. Note that this also - // includes time spent external code, which do not contribute to execution - // pauses. - var exclude_ranges = []; - for (name in TimerEvents) { - var event = TimerEvents[name]; - if (!event.no_execution) continue; - var ranges = event.ranges; - // Add ranges of this event to the pause list. - for (var j = 0; j < ranges.length; j++) { - exclude_ranges.push(ranges[j]); - } - } - - kExecutionEvent.ranges = MergeRanges(kExecutionEvent.ranges); - exclude_ranges = MergeRanges(exclude_ranges); - kExecutionEvent.ranges = ExcludeRanges(kExecutionEvent.ranges, - exclude_ranges); -} - - -function DrawBar(row, color, start, end, width) { - obj_index++; - command = "set object " + obj_index + " rect"; - command += " from " + start + ", " + (row - width); - command += " to " + end + ", " + (row + width); - command += " fc rgb \"" + color + "\""; - print(command); -} - - -function TicksToRanges(ticks) { - var ranges = []; - for (var i = 0; i < ticks.length; i++) { - var tick = ticks[i].tick; - ranges.push(new Range(tick - kTickHalfDuration, tick + kTickHalfDuration)); - } - return ranges; -} - - -function MergeRanges(ranges) { - ranges.sort(function(a, b) { return a.start - b.start; }); - var result = []; - var j = 0; - for (var i = 0; i < ranges.length; i = j) { - var merge_start = ranges[i].start; - if (merge_start > xrange_end) break; // Out of plot range. - var merge_end = ranges[i].end; - for (j = i + 1; j < ranges.length; j++) { - var next_range = ranges[j]; - // Don't merge ranges if there is no overlap (including merge tolerance). - if (next_range.start > merge_end + kPauseTolerance) break; - // Merge ranges. - if (next_range.end > merge_end) { // Extend range end. - merge_end = next_range.end; - } - } - if (merge_end < xrange_start) continue; // Out of plot range. - if (merge_end < merge_start) continue; // Not an actual range. - result.push(new Range(merge_start, merge_end)); - } - return result; -} - - -function ExcludeRanges(include, exclude) { - // We assume that both input lists are sorted and merged with MergeRanges. - var result = []; - var exclude_index = 0; - var include_index = 0; - var include_start, include_end, exclude_start, exclude_end; - - function NextInclude() { - if (include_index >= include.length) return false; - include_start = include[include_index].start; - include_end = include[include_index].end; - include_index++; - return true; - } - - function NextExclude() { - if (exclude_index >= exclude.length) { - // No more exclude, finish by repeating case (2). - exclude_start = Infinity; - exclude_end = Infinity; - return false; - } - exclude_start = exclude[exclude_index].start; - exclude_end = exclude[exclude_index].end; - exclude_index++; - return true; - } - - if (!NextInclude() || !NextExclude()) return include; - - while (true) { - if (exclude_end <= include_start) { - // (1) Exclude and include do not overlap. - // Include ##### - // Exclude ## - NextExclude(); - } else if (include_end <= exclude_start) { - // (2) Exclude and include do not overlap. - // Include ##### - // Exclude ### - result.push(new Range(include_start, include_end)); - if (!NextInclude()) break; - } else if (exclude_start <= include_start && - exclude_end < include_end && - include_start < exclude_end) { - // (3) Exclude overlaps with begin of include. - // Include ####### - // Exclude ##### - // Result #### - include_start = exclude_end; - NextExclude(); - } else if (include_start < exclude_start && - include_end <= exclude_end && - exclude_start < include_end) { - // (4) Exclude overlaps with end of include. - // Include ####### - // Exclude ##### - // Result #### - result.push(new Range(include_start, exclude_start)); - if (!NextInclude()) break; - } else if (exclude_start > include_start && exclude_end < include_end) { - // (5) Exclude splits include into two parts. - // Include ####### - // Exclude ## - // Result ## ### - result.push(new Range(include_start, exclude_start)); - include_start = exclude_end; - NextExclude(); - } else if (exclude_start <= include_start && exclude_end >= include_end) { - // (6) Exclude entirely covers include. - // Include ###### - // Exclude ######### - if (!NextInclude()) break; - } else { - throw new Error("this should not happen!"); - } - } - - return result; -} - - -function GnuplotOutput() { - xrange_start = (xrange_start_override || xrange_start_override == 0) - ? xrange_start_override : xrange_start; - xrange_end = (xrange_end_override || xrange_end_override == 0) - ? xrange_end_override : xrange_end; - print("set terminal pngcairo size " + kResX + "," + kResY + - " enhanced font 'Helvetica,10'"); - print("set yrange [0:" + (num_timer_event + 1) + "]"); - print("set xlabel \"execution time in ms\""); - print("set xrange [" + xrange_start + ":" + xrange_end + "]"); - print("set style fill pattern 2 bo 1"); - print("set style rect fs solid 1 noborder"); - print("set style line 1 lt 1 lw 1 lc rgb \"#000000\""); - print("set xtics out nomirror"); - print("unset key"); - - // Name Y-axis. - var ytics = []; - for (name in TimerEvents) { - var index = TimerEvents[name].index; - ytics.push('"' + name + '"' + ' ' + index); - } - ytics.push('"code kind being executed"' + ' ' + (kY1Offset - 1)); - ytics.push('"top ' + kStackFrames + ' js stack frames"' + ' ' + - (kY1Offset - 2)); - ytics.push('"pause times" 0'); - print("set ytics out nomirror (" + ytics.join(', ') + ")"); - - // Plot timeline. - for (var name in TimerEvents) { - var event = TimerEvents[name]; - var ranges = MergeRanges(event.ranges); - for (var i = 0; i < ranges.length; i++) { - DrawBar(event.index, event.color, - ranges[i].start, ranges[i].end, - kTimerEventWidth); - } - } - - // Plot code kind gathered from ticks. - for (var name in CodeKinds) { - var code_kind = CodeKinds[name]; - var offset = kY1Offset - 1; - // Top most frame. - var row = MergeRanges(TicksToRanges(code_kind.in_execution)); - for (var j = 0; j < row.length; j++) { - DrawBar(offset, code_kind.color, - row[j].start, row[j].end, kExecutionFrameWidth); - } - offset = offset - 2 * kExecutionFrameWidth - kGapWidth; - // Javascript frames. - for (var i = 0; i < kStackFrames; i++) { - offset = offset - 2 * kStackFrameWidth - kGapWidth; - row = MergeRanges(TicksToRanges(code_kind.stack_frames[i])); - for (var j = 0; j < row.length; j++) { - DrawBar(offset, code_kind.color, - row[j].start, row[j].end, kStackFrameWidth); - } - } - } - - // Add labels as legend for code kind colors. - var padding = kCodeKindLabelPadding * (xrange_end - xrange_start) / kResX; - var label_x = xrange_start; - var label_y = kY1Offset; - for (var name in CodeKinds) { - label_x += padding; - print("set label \"" + name + "\" at " + label_x + "," + label_y + - " textcolor rgb \"" + CodeKinds[name].color + "\"" + - " font \"Helvetica,9'\""); - } - - if (execution_pauses.length == 0) { - // Force plot and return without plotting execution pause impulses. - print("plot 1/0"); - return; - } - - // Label the longest pauses. - execution_pauses.sort( - function(a, b) { return b.duration() - a.duration(); }); - - var max_pause_time = execution_pauses[0].duration(); - padding = kPauseLabelPadding * (xrange_end - xrange_start) / kResX; - var y_scale = kY1Offset / max_pause_time / 2; - for (var i = 0; i < execution_pauses.length && i < kNumPauseLabels; i++) { - var pause = execution_pauses[i]; - var label_content = (pause.duration() | 0) + " ms"; - var label_x = pause.end + padding; - var label_y = Math.max(1, (pause.duration() * y_scale)); - print("set label \"" + label_content + "\" at " + - label_x + "," + label_y + " font \"Helvetica,7'\""); - } - - // Scale second Y-axis appropriately. - var y2range = max_pause_time * num_timer_event / kY1Offset * 2; - print("set y2range [0:" + y2range + "]"); - // Plot graph with impulses as data set. - print("plot '-' using 1:2 axes x1y2 with impulses ls 1"); - for (var i = 0; i < execution_pauses.length; i++) { - var pause = execution_pauses[i]; - print(pause.end + " " + pause.duration()); - } - print("e"); -} - - -CollectData(); -GnuplotOutput(); diff --git a/deps/v8/tools/run-llprof.sh b/deps/v8/tools/run-llprof.sh deleted file mode 100755 index d526170d1f..0000000000 --- a/deps/v8/tools/run-llprof.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# -# Copyright 2012 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -########## Global variable definitions - -# Ensure that <your CPU clock> / $SAMPLE_EVERY_N_CYCLES < $MAXIMUM_SAMPLE_RATE. -MAXIMUM_SAMPLE_RATE=10000000 -SAMPLE_EVERY_N_CYCLES=10000 -SAMPLE_RATE_CONFIG_FILE="/proc/sys/kernel/perf_event_max_sample_rate" -KERNEL_MAP_CONFIG_FILE="/proc/sys/kernel/kptr_restrict" - -########## Usage - -usage() { -cat << EOF -usage: $0 <benchmark_command> - -Executes <benchmark_command> under observation by the kernel's "perf" \ -framework, then calls the low level tick processor to analyze the results. -EOF -} - -if [ $# -eq 0 ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then - usage - exit 1 -fi - -########## Actual script execution - -ACTUAL_SAMPLE_RATE=$(cat $SAMPLE_RATE_CONFIG_FILE) -if [ "$ACTUAL_SAMPLE_RATE" -lt "$MAXIMUM_SAMPLE_RATE" ] ; then - echo "Setting appropriate maximum sample rate..." - echo $MAXIMUM_SAMPLE_RATE | sudo tee $SAMPLE_RATE_CONFIG_FILE -fi - -ACTUAL_KERNEL_MAP_RESTRICTION=$(cat $KERNEL_MAP_CONFIG_FILE) -if [ "$ACTUAL_KERNEL_MAP_RESTRICTION" -ne "0" ] ; then - echo "Disabling kernel address map restriction..." - echo 0 | sudo tee $KERNEL_MAP_CONFIG_FILE -fi - -echo "Running benchmark..." -perf record -R -e cycles -c $SAMPLE_EVERY_N_CYCLES -f -i $@ --ll-prof diff --git a/deps/v8/tools/run-tests.py b/deps/v8/tools/run-tests.py index f20af169d2..a49f6560a6 100755 --- a/deps/v8/tools/run-tests.py +++ b/deps/v8/tools/run-tests.py @@ -66,11 +66,6 @@ SUPPORTED_ARCHS = ["android_arm", "ia32", "mipsel", "x64"] -# Double the timeout for these: -SLOW_ARCHS = ["android_arm", - "android_ia32", - "arm", - "mipsel"] def BuildOptions(): @@ -155,7 +150,7 @@ def ProcessOptions(options): options.mode = tokens[1] options.mode = options.mode.split(",") for mode in options.mode: - if not mode.lower() in ["debug", "release"]: + if not mode in ["debug", "release"]: print "Unknown mode %s" % mode return False if options.arch in ["auto", "native"]: @@ -273,12 +268,12 @@ def Execute(arch, mode, args, options, suites, workspace): timeout = options.timeout if timeout == -1: # Simulators are slow, therefore allow a longer default timeout. - if arch in SLOW_ARCHS: + if arch in ["android", "arm", "mipsel"]: timeout = 2 * TIMEOUT_DEFAULT; else: timeout = TIMEOUT_DEFAULT; - timeout *= TIMEOUT_SCALEFACTOR[mode] + options.timeout *= TIMEOUT_SCALEFACTOR[mode] ctx = context.Context(arch, mode, shell_dir, mode_flags, options.verbose, timeout, options.isolates, @@ -298,9 +293,9 @@ def Execute(arch, mode, args, options, suites, workspace): for s in suites: s.ReadStatusFile(variables) s.ReadTestCases(ctx) + all_tests += s.tests if len(args) > 0: s.FilterTestCasesByArgs(args) - all_tests += s.tests s.FilterTestCasesByStatus(options.warn_unused) if options.cat: verbose.PrintTestSource(s.tests) diff --git a/deps/v8/tools/tick-processor.html b/deps/v8/tools/tick-processor.html deleted file mode 100644 index bc9f636cb7..0000000000 --- a/deps/v8/tools/tick-processor.html +++ /dev/null @@ -1,168 +0,0 @@ -<!DOCTYPE html> -<!-- Copyright 2012 the V8 project authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - -<html lang="en"> -<head> - <meta charset="utf-8"/> - <title>V8 Tick Processor</title> - - <style type="text/css"> - body { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10pt; - } - h4 { - margin-bottom: 0px; - } - p { - margin-top: 0px; - } - </style> - - <script src="splaytree.js"></script> - <script src="codemap.js"></script> - <script src="csvparser.js"></script> - <script src="consarray.js"></script> - <script src="profile.js"></script> - <script src="profile_view.js"></script> - <script src="logreader.js"></script> - <script src="tickprocessor.js"></script> - - <script type="text/javascript"> - -var v8log_content; -var textout; - -function load_logfile(evt) { - textout.value = ""; - var f = evt.target.files[0]; - if (f) { - var reader = new FileReader(); - reader.onload = function(event) { - v8log_content = event.target.result; - start_process(); - }; - reader.onerror = function(event) { - console.error("File could not be read! Code " + event.target.error.code); - }; - reader.readAsText(f); - } else { - alert("Failed to load file"); - } -} - -function print(arg) { - textout.value+=arg+"\n"; -} - -function start_process() { - ArgumentsProcessor.DEFAULTS = { - logFileName: 'v8.log', - snapshotLogFileName: null, - platform: 'unix', - stateFilter: null, - callGraphSize: 5, - ignoreUnknown: false, - separateIc: false, - targetRootFS: '', - nm: 'nm' - }; - - var entriesProviders = { - 'unix': UnixCppEntriesProvider, - 'windows': WindowsCppEntriesProvider, - 'mac': MacCppEntriesProvider - }; - - var snapshotLogProcessor; // not used - - var tickProcessor = new TickProcessor( - new (entriesProviders[ArgumentsProcessor.DEFAULTS.platform])( - ArgumentsProcessor.DEFAULTS.nm, - ArgumentsProcessor.DEFAULTS.targetRootFS), - ArgumentsProcessor.DEFAULTS.separateIc, - ArgumentsProcessor.DEFAULTS.callGraphSize, - ArgumentsProcessor.DEFAULTS.ignoreUnknown, - ArgumentsProcessor.DEFAULTS.stateFilter, - snapshotLogProcessor); - - tickProcessor.processLogChunk(v8log_content); - tickProcessor.printStatistics(); -} - -function Load() { - document.getElementById('fileinput').addEventListener( - 'change', load_logfile, false); - textout = document.getElementById('textout'); -} -</script> -</head> -<body onLoad="Load()"> - -<h3 style="margin-top: 2px;"> - Chrome V8 profiling log processor -</h3> -<p> -Process V8's profiling information log (sampling profiler tick information) -in your browser. Particularly useful if you don't have the V8 shell (d8) -at hand on your system. You still have to run Chrome with the appropriate -<a href="https://code.google.com/p/v8/wiki/ProfilingChromiumWithV8"> - command line flags</a> -to produce the profiling log. -</p> -<h4>Usage:</h4> -<p> -Click on the button and browse to the profiling log file (usually, v8.log). -Process will start automatically and the output will be visible in the below -text area. -</p> -<h4>Limitations and disclaimer:</h4> -<p> -This page offers a subset of the functionalities of the command-line tick -processor utility in the V8 repository. In particular, this page cannot -access the command-line utility that provides library symbol information, -hence the [C++] section of the output stays empty. Also consider that this -web-based tool is provided only for convenience and quick reference, you -should refer to the -<a href="https://code.google.com/p/v8/wiki/V8Profiler"> - command-line</a> -version for full output. -</p> -<p> -<input type="file" id="fileinput" /> -</p> -<p> -<textarea name="myTextArea" cols="120" rows="40" wrap="off" id="textout" - readonly="yes"></textarea> -</p> -<p style="font-style:italic;"> -Copyright the V8 Authors - Last change to this page: 12/12/2012 -</p> - - -</body> -</html> diff --git a/deps/v8/tools/tickprocessor.js b/deps/v8/tools/tickprocessor.js index 7530c6b37d..4c4886d878 100644 --- a/deps/v8/tools/tickprocessor.js +++ b/deps/v8/tools/tickprocessor.js @@ -73,7 +73,7 @@ function parseState(s) { function SnapshotLogProcessor() { LogReader.call(this, { 'code-creation': { - parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'], + parsers: [null, parseInt, parseInt, null, 'var-args'], processor: this.processCodeCreation }, 'code-move': { parsers: [parseInt, parseInt], processor: this.processCodeMove }, @@ -107,7 +107,7 @@ inherits(SnapshotLogProcessor, LogReader); SnapshotLogProcessor.prototype.processCodeCreation = function( - type, kind, start, size, name, maybe_func) { + type, start, size, name, maybe_func) { if (maybe_func.length) { var funcAddr = parseInt(maybe_func[0]); var state = parseState(maybe_func[1]); @@ -156,7 +156,7 @@ function TickProcessor( 'shared-library': { parsers: [null, parseInt, parseInt], processor: this.processSharedLibrary }, 'code-creation': { - parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'], + parsers: [null, parseInt, parseInt, null, 'var-args'], processor: this.processCodeCreation }, 'code-move': { parsers: [parseInt, parseInt], processor: this.processCodeMove }, @@ -167,7 +167,7 @@ function TickProcessor( 'snapshot-pos': { parsers: [parseInt, parseInt], processor: this.processSnapshotPosition }, 'tick': { - parsers: [parseInt, parseInt, parseInt, parseInt, + parsers: [parseInt, parseInt, parseInt, parseInt, parseInt, 'var-args'], processor: this.processTick }, 'heap-sample-begin': { parsers: [null, null, parseInt], @@ -231,9 +231,8 @@ TickProcessor.VmStates = { JS: 0, GC: 1, COMPILER: 2, - PARALLEL_COMPILER: 3, - OTHER: 4, - EXTERNAL: 5 + OTHER: 3, + EXTERNAL: 4 }; @@ -309,7 +308,7 @@ TickProcessor.prototype.processSharedLibrary = function( TickProcessor.prototype.processCodeCreation = function( - type, kind, start, size, name, maybe_func) { + type, start, size, name, maybe_func) { name = this.deserializedEntriesNames_[start] || name; if (maybe_func.length) { var funcAddr = parseInt(maybe_func[0]); @@ -350,7 +349,6 @@ TickProcessor.prototype.includeTick = function(vmState) { TickProcessor.prototype.processTick = function(pc, sp, - ns_since_start, is_external_callback, tos_or_external_callback, vmState, |