{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/openj9/issues/1589","repository_url":"https://api.github.com/repos/eclipse/openj9","labels_url":"https://api.github.com/repos/eclipse/openj9/issues/1589/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/openj9/issues/1589/comments","events_url":"https://api.github.com/repos/eclipse/openj9/issues/1589/events","html_url":"https://github.com/eclipse/openj9/pull/1589","id":310197277,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc4NjU2Njk1","number":1589,"title":"Relocatable Debug Counters","user":{"login":"dsouzai","id":18743715,"node_id":"MDQ6VXNlcjE4NzQzNzE1","avatar_url":"https://avatars3.githubusercontent.com/u/18743715?v=4","gravatar_id":"","url":"https://api.github.com/users/dsouzai","html_url":"https://github.com/dsouzai","followers_url":"https://api.github.com/users/dsouzai/followers","following_url":"https://api.github.com/users/dsouzai/following{/other_user}","gists_url":"https://api.github.com/users/dsouzai/gists{/gist_id}","starred_url":"https://api.github.com/users/dsouzai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsouzai/subscriptions","organizations_url":"https://api.github.com/users/dsouzai/orgs","repos_url":"https://api.github.com/users/dsouzai/repos","events_url":"https://api.github.com/users/dsouzai/events{/privacy}","received_events_url":"https://api.github.com/users/dsouzai/received_events","type":"User","site_admin":false},"labels":[{"id":697962585,"node_id":"MDU6TGFiZWw2OTc5NjI1ODU=","url":"https://api.github.com/repos/eclipse/openj9/labels/comp:jit","name":"comp:jit","color":"1d76db","default":false},{"id":709763910,"node_id":"MDU6TGFiZWw3MDk3NjM5MTA=","url":"https://api.github.com/repos/eclipse/openj9/labels/depends:omr","name":"depends:omr","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-03-31T00:26:11Z","updated_at":"2018-06-26T13:50:32Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/eclipse/openj9/pulls/1589","html_url":"https://github.com/eclipse/openj9/pull/1589","diff_url":"https://github.com/eclipse/openj9/pull/1589.diff","patch_url":"https://github.com/eclipse/openj9/pull/1589.patch"},"body":"Depends on https://github.com/eclipse/omr/pull/2408\r\n\r\nI tested this with a simple java program:\r\n```\r\nimport java.lang.*;\r\n\r\npublic class SimpleAddTest {\r\n\r\n   private static int iter;\r\n   private static int count;\r\n\r\n   public static void addNum(int num) {\r\n         count += num;\r\n   }\r\n\r\n   public static void main (String[] args) {\r\n\r\n      iter = 100;\r\n      count = 0;\r\n      \r\n      int num = 1;\r\n\r\n      int i = 0;\r\n      while (i < iter) {\r\n         addNum(num);\r\n\t i++;\r\n      }\r\n\r\n      System.out.println(count);\r\n   }\r\n}\r\n```\r\n\r\nThis just does an add 100 times and prints out the total (which is 100). I added a dynamic debug counter in simplifier called \"CounterTest\".\r\n\r\n**JIT**\r\n```\r\n$> java '-Xjit:optLevel=cold,count=0,limit={SimpleAddTest.addNum*},debugCounters={CounterTest},verbose={compilePerformance},vlog=vlog' -Xshareclasses:name=debugCounterTest SimpleAddTest\r\n100\r\n\r\n== Dynamic debug counters ==\r\n  0: CounterTest |          100 |   __   0 __\r\n\r\n (cold) Compiling SimpleAddTest.addNum(I)V  OrdinaryMethod j9m=0000000002449B58 t=150 compThread=0 memLimit=262144 KB freePhysicalMemory=5228 MB\r\n+ (cold) SimpleAddTest.addNum(I)V @ 00007F0826600034-00007F0826600065 OrdinaryMethod - Q_SZ=0 Q_SZI=0 QW=2 j9m=0000000002449B58 bcsz=9 sync time=695us mem=[region=704 system=16384]KB compThread=0 CpuLoad=73%(18%avg) JvmCpu=0%\r\n```\r\n \r\n**AOT Compile run**\r\n```\r\n$> java '-Xaot:forceAOT,optLevel=cold,count=0,limit={SimpleAddTest.addNum*},debugCounters={CounterTest},verbose={compilePerformance},vlog=vlog' -Xshareclasses:name=debugCounterTest SimpleAddTest\r\n100\r\n\r\n== Dynamic debug counters ==\r\n  0: CounterTest |          100 |   __   0 __\r\n\r\n (AOT cold) Compiling SimpleAddTest.addNum(I)V  OrdinaryMethod j9m=00000000025C4658 t=275 compThread=0 memLimit=262144 KB freePhysicalMemory=5227 MB\r\n+ (AOT cold) SimpleAddTest.addNum(I)V @ 00007F7398A00034-00007F7398A00076 OrdinaryMethod - Q_SZ=0 Q_SZI=0 QW=2 j9m=00000000025C4658 bcsz=9 sync time=791us mem=[region=1408 system=16384]KB compThread=0 CpuLoad=73%(18%avg) JvmCpu=0%\r\n```\r\n\r\n**AOT Load run**\r\n```\r\n$> java '-Xaot:forceAOT,optLevel=cold,count=0,limit={SimpleAddTest.addNum*},debugCounters={CounterTest},verbose={compilePerformance},vlog=vlog' -Xshareclasses:name=debugCounterTest SimpleAddTest\r\n100\r\n\r\n== Dynamic debug counters ==\r\n  0: CounterTest |          100 |   __   0 __\r\n\r\n (cold) Compiling SimpleAddTest.addNum(I)V  OrdinaryMethod j9m=0000000001D5A658 t=179 compThread=0 memLimit=262144 KB freePhysicalMemory=5227 MB\r\n+ (AOT load) SimpleAddTest.addNum(I)V @ 00007F1D7A400034-00007F1D7A400076 Q_SZ=0 Q_SZI=0 QW=1 j9m=0000000001D5A658 bcsz=9 time=153us compThread=0\r\n```\r\n\r\nThere's still a bug somewhere though, since if I enable all debug counters, the number printed out by the java code is wrong (though the counters seem ok :P)\r\n\r\n**JIT**\r\n```\r\n$> java '-Xjit:optLevel=cold,count=0,limit={SimpleAddTest.addNum*},debugCounters={*},verbose={compilePerformance},vlog=vlog' -Xshareclasses:name=debugCounterTest SimpleAddTest\r\n100\r\n\r\n== Dynamic debug counters ==\r\n  0: CounterTest                                                |          100 |   __   0 __\r\n  4: blocks/coldCompiles/warmBlocks/=2                          |          100 |    100.00% |   100.00% |   100.00% |  __   4 __\r\n  5: cg.blocks                                                  |          100 |   __   5 __\r\n  7: cg.epilogues:no-preservedRegStoreBytesSaved                |          100 |    100.00% |  __   7 __\r\n  8: cg.prologues                                               |          100 |   __   8 __\r\n  9: cg.prologues:#frameBytes                                   |          800 |      8.00  |  __   9 __\r\n 10: cg.prologues:#instructionBytes                             |        10800 |    108.00  |  __  10 __\r\n 11: cg.prologues:#peakBytes                                    |          800 |      8.00  |  __  11 __\r\n 12: cg.prologues:inline                                        |          100 |    100.00% |  __  12 __\r\n 13: cg.prologues:no-preservedRegStoreBytesSaved                |          100 |    100.00% |  __  13 __\r\n 21: warmBlocks/byJittedBody/(SimpleAddTest.addNum(I)V)/cold/=2 |          100 |    100.00% |   100.00% |   100.00% |   100.00% |  __  21 __\r\n```\r\n\r\n**AOT Compile run**\r\n```\r\n$> java '-Xaot:forceAOT,optLevel=cold,count=0,limit={SimpleAddTest.addNum*},debugCounters={*},verbose={compilePerformance},vlog=vlog' -Xshareclasses:name=debugCounterTest SimpleAddTest\r\n-2030234688\r\n\r\n== Dynamic debug counters ==\r\n  0: CounterTest                                                |          100 |   __   0 __\r\n  4: blocks/coldCompiles/warmBlocks/=2                          |          100 |    100.00% |   100.00% |   100.00% |  __   4 __\r\n  5: cg.blocks                                                  |          100 |   __   5 __\r\n  7: cg.epilogues:no-preservedRegStoreBytesSaved                |          100 |    100.00% |  __   7 __\r\n  8: cg.prologues                                               |          100 |   __   8 __\r\n  9: cg.prologues:#frameBytes                                   |          800 |      8.00  |  __   9 __\r\n 10: cg.prologues:#instructionBytes                             |        10400 |    104.00  |  __  10 __\r\n 11: cg.prologues:#peakBytes                                    |          800 |      8.00  |  __  11 __\r\n 12: cg.prologues:inline                                        |          100 |    100.00% |  __  12 __\r\n 13: cg.prologues:no-preservedRegStoreBytesSaved                |          100 |    100.00% |  __  13 __\r\n 21: warmBlocks/byJittedBody/(SimpleAddTest.addNum(I)V)/cold/=2 |          100 |    100.00% |   100.00% |   100.00% |   100.00% |  __  21 __\r\n```\r\n\r\n**AOT Load run**\r\n```\r\n$> java '-Xaot:forceAOT,optLevel=cold,count=0,limit={SimpleAddTest.addNum*},debugCounters={*},verbose={compilePerformance},vlog=vlog' -Xshareclasses:name=debugCounterTest SimpleAddTest\r\n1972250816\r\n\r\n== Dynamic debug counters ==\r\n  0: CounterTest                                                |          100 |   __   0 __\r\n  4: blocks/coldCompiles/warmBlocks/=2                          |          100 |    100.00% |   100.00% |   100.00% |  __   4 __\r\n  5: cg.blocks                                                  |          100 |   __   5 __\r\n  7: cg.epilogues:no-preservedRegStoreBytesSaved                |          100 |    100.00% |  __   7 __\r\n  8: cg.prologues                                               |          100 |   __   8 __\r\n  9: cg.prologues:#frameBytes                                   |          800 |      8.00  |  __   9 __\r\n 10: cg.prologues:#instructionBytes                             |        10400 |    104.00  |  __  10 __\r\n 11: cg.prologues:#peakBytes                                    |          800 |      8.00  |  __  11 __\r\n 12: cg.prologues:inline                                        |          100 |    100.00% |  __  12 __\r\n 13: cg.prologues:no-preservedRegStoreBytesSaved                |          100 |    100.00% |  __  13 __\r\n 18: warmBlocks/byJittedBody/(SimpleAddTest.addNum(I)V)/cold/=2 |          100 |    100.00% |   100.00% |   100.00% |   100.00% |  __  18 __\r\n```\r\n\r\nCredit to @lmaisons for the idea of using the metadata to store the debug counter names."},"comment":{"url":"https://api.github.com/repos/eclipse/openj9/issues/comments/400316010","html_url":"https://github.com/eclipse/openj9/pull/1589#issuecomment-400316010","issue_url":"https://api.github.com/repos/eclipse/openj9/issues/1589","id":400316010,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDMxNjAxMA==","user":{"login":"mstoodle","id":10781812,"node_id":"MDQ6VXNlcjEwNzgxODEy","avatar_url":"https://avatars2.githubusercontent.com/u/10781812?v=4","gravatar_id":"","url":"https://api.github.com/users/mstoodle","html_url":"https://github.com/mstoodle","followers_url":"https://api.github.com/users/mstoodle/followers","following_url":"https://api.github.com/users/mstoodle/following{/other_user}","gists_url":"https://api.github.com/users/mstoodle/gists{/gist_id}","starred_url":"https://api.github.com/users/mstoodle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstoodle/subscriptions","organizations_url":"https://api.github.com/users/mstoodle/orgs","repos_url":"https://api.github.com/users/mstoodle/repos","events_url":"https://api.github.com/users/mstoodle/events{/privacy}","received_events_url":"https://api.github.com/users/mstoodle/received_events","type":"User","site_admin":false},"created_at":"2018-06-26T13:50:32Z","updated_at":"2018-06-26T13:50:32Z","author_association":"CONTRIBUTOR","body":"@andrewcraik I had been paying more attention to the dependent omr changes, but since I've now merged those, will now focus more on this one...Thanks for the ping."}}
{"actor":{"display_login":"mstoodle"}}