I've been wanting to do this for a while, and I really need it for some performance debugging I'm doing, so I might as well get something landed into ToT.
Created attachment 299954 [details] patch
New output: ``` Sampling rate: 1000 microseconds Top functions as <numSamples 'functionName:sourceID'> 128 'findGraphNode:2' 119 'findGraphNode:3' 32 'load:-1' 9 '(program):1' 5 'splice:-1' 4 'search:3' 3 'init:3' 2 'GraphNode:1' 2 'neighbors:3' 1 'push:-1' 1 'init:2' 1 'neighbors:2' Sampling rate: 1000 microseconds Hottest bytecodes as <numSamples 'functionName#hash:JITType:bytecodeIndex'> 97 'findGraphNode#EBmwVP:Baseline:33 <-- search#DTtNtq:FTL:407' 93 'findGraphNode#EBmwVP:Baseline:55 <-- search#DTtNtq:FTL:407' 32 'load#<nil>:None:<nil>' 20 'findGraphNode#EBmwVP:Baseline:27 <-- search#DTtNtq:FTL:407' 18 'findGraphNode#EBmwVP:Baseline:27 <-- search#DTtNtq:DFG:407' 6 'findGraphNode#EBmwVP:Baseline:33 <-- search#DTtNtq:DFG:407' 5 'splice#<nil>:None:<nil>' 4 'findGraphNode#EBmwVP:Baseline:68 <-- search#DTtNtq:DFG:407' 4 'init#Ct2Vq3:Baseline:45' 3 'findGraphNode#EBmwVP:Baseline:66 <-- search#DTtNtq:DFG:407' 2 '(program)#BS1Qqp:Baseline:311123' 2 'findGraphNode#EBmwVP:Baseline:51 <-- search#DTtNtq:DFG:407' 2 'findGraphNode#EBmwVP:DFG:27' 1 'search#DTtNtq:FTL:177' 1 'findGraphNode#EBmwVP:Baseline:55 <-- search#DTtNtq:FTL:475' 1 '(program)#BS1Qqp:Baseline:310955' 1 'neighbors#CZggLo:Baseline:0' 1 'neighbors#CZggLo:DFG:0' 1 'search#DTtNtq:Baseline:109' 1 '(program)#BS1Qqp:Baseline:193614' 1 '(program)#BS1Qqp:Baseline:127359' 1 'GraphNode#BmXric:DFG:9' 1 '(program)#BS1Qqp:Baseline:260298' 1 'GraphNode#BmXric:Baseline:1' 1 'search#DTtNtq:DFG:385' 1 '(program)#BS1Qqp:Baseline:61835' 1 '(program)#BS1Qqp:Baseline:310878' 1 'search#DTtNtq:Baseline:140' 1 'search#DTtNtq:Baseline:297' 1 '(program)#BS1Qqp:Baseline:310982' 1 'findGraphNode#EBmwVP:FTL:33' 1 'push#<nil>:None:<nil>' 1 'neighbors#CZggLo:DFG:52' ``` Old output: ``` Sampling rate: 1000 microseconds Hottest functions as <numSamples 'functionName:sourceID'> 117 'findGraphNode:2' 114 'findGraphNode:3' 29 'load:-1' 12 '(program):1' 6 'neighbors:2' 4 'init:3' 2 'splice:-1' 2 'GraphNode:1' 2 'search:3' 2 'search:2' 1 '(program):2' 1 'init:2' 1 'removeGraphNode:3' 1 'neighbors:3' Sampling rate: 1000 microseconds Hottest bytecodes as <numSamples 'functionName#hash:JITType:bytecodeIndex'> 112 'findGraphNode#EBmwVP:Baseline:33' 64 'findGraphNode#EBmwVP:Baseline:55' 35 'findGraphNode#EBmwVP:Baseline:27' 29 'load#<nil>:None:<nil>' 6 'findGraphNode#EBmwVP:Baseline:42' 5 '(program)#BS1Qqp:Baseline:310855' 4 'findGraphNode#EBmwVP:Baseline:66' 3 'findGraphNode#EBmwVP:Baseline:68' 3 'init#Ct2Vq3:Baseline:45' 3 'findGraphNode#EBmwVP:Baseline:26' 2 'splice#<nil>:None:<nil>' 2 'neighbors#CZggLo:DFG:20' 2 'neighbors#CZggLo:Baseline:1' 1 'neighbors#CZggLo:DFG:280' 1 '(program)#BS1Qqp:Baseline:310886' 1 'GraphNode#BmXric:DFG:44' 1 '(program)#BS1Qqp:Baseline:288234' 1 'findGraphNode#EBmwVP:DFG:81' 1 'neighbors#CZggLo:Baseline:151' 1 'search#DTtNtq:Baseline:110' 1 'findGraphNode#EBmwVP:DFG:27' 1 'GraphNode#BmXric:DFG:84' 1 'neighbors#CZggLo:Baseline:202' 1 'search#DTtNtq:FTL:116' 1 'search#DTtNtq:FTL:110' 1 'init#Ct2Vq3:Baseline:100' 1 '(program)#BS1Qqp:Baseline:311021' 1 '(program)#AnfNV6:LLInt:237' 1 'findGraphNode#EBmwVP:DFG:42' 1 'findGraphNode#EBmwVP:DFG:26' 1 '(program)#BS1Qqp:Baseline:87198' 1 '(program)#BS1Qqp:Baseline:141719' 1 'init#Ct2Vq3:Baseline:109' 1 '(program)#BS1Qqp:Baseline:25997' 1 '(program)#BS1Qqp:Baseline:219366' 1 'removeGraphNode#DqCfaQ:Baseline:33' 1 'search#DTtNtq:Baseline:286' ```
Comment on attachment 299954 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=299954&action=review LGTM > Source/JavaScriptCore/runtime/SamplingProfiler.cpp:462 > + StackFrame::CodeLocation machineLocation; > + populateCodeLocation(machineCodeBlock, machineOrigin.bytecodeIndex, machineLocation); Is this already computed when we called appendCodeBlock() in origin.walkUpInlineStack()? If so, can we just grab the machineLocation from stackTrace?
Comment on attachment 299954 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=299954&action=review >> Source/JavaScriptCore/runtime/SamplingProfiler.cpp:462 >> + populateCodeLocation(machineCodeBlock, machineOrigin.bytecodeIndex, machineLocation); > > Is this already computed when we called appendCodeBlock() in origin.walkUpInlineStack()? If so, can we just grab the machineLocation from stackTrace? Looks like you should just be able to get it from stackTrace.frames.last().semanticLocation since the last one is always for the machineCodeBlock.
Comment on attachment 299954 [details] patch Attachment 299954 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2959924 New failing tests: inspector/sampling-profiler/expression-location-info.html
Created attachment 299959 [details] Archive of layout-test-results from ews106 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Comment on attachment 299954 [details] patch Attachment 299954 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2959944 New failing tests: inspector/sampling-profiler/expression-location-info.html
Created attachment 299960 [details] Archive of layout-test-results from ews103 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 299954 [details] patch Attachment 299954 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2959947 New failing tests: inspector/sampling-profiler/expression-location-info.html
Created attachment 299961 [details] Archive of layout-test-results from ews113 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 299954 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=299954&action=review >>> Source/JavaScriptCore/runtime/SamplingProfiler.cpp:462 >>> + populateCodeLocation(machineCodeBlock, machineOrigin.bytecodeIndex, machineLocation); >> >> Is this already computed when we called appendCodeBlock() in origin.walkUpInlineStack()? If so, can we just grab the machineLocation from stackTrace? > > Looks like you should just be able to get it from stackTrace.frames.last().semanticLocation since the last one is always for the machineCodeBlock. Yeah, good call. Will fix. > Source/JavaScriptCore/runtime/SamplingProfiler.h:113 > + bool lineNumber() const lol at bool and C's type system. This is the bug causing inspector failure.
Created attachment 299966 [details] patch for landing
Comment on attachment 299966 [details] patch for landing Clearing flags on attachment: 299966 Committed r211316: <http://trac.webkit.org/changeset/211316>
All reviewed patches have been landed. Closing bug.