{"id":191,"date":"2013-04-10T17:30:46","date_gmt":"2013-04-10T16:30:46","guid":{"rendered":"http:\/\/blog.mozilla.org\/jseward\/?p=191"},"modified":"2013-04-10T17:30:46","modified_gmt":"2013-04-10T16:30:46","slug":"profiler-backend-news-10-april-2013","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/jseward\/2013\/04\/10\/profiler-backend-news-10-april-2013\/","title":{"rendered":"Profiler backend news, 10 April 2013"},"content":{"rendered":"<p>Here is some news about work on <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Performance\/Profiling_with_the_Built-in_Profiler\">Firefox&#8217;s built-in time profiler<\/a> (SPS), and in particular the work being done to use native stack unwinding by using the in-tree copy of the Breakpad unwinding library.<\/p>\n<p>There has been a lot of activity in the two and a half weeks since we got back from Paris.\u00a0 Some of that has been fixing fallout from the initial patch (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=779291\">779291<\/a>), which proved difficult to land.<\/p>\n<p>The immediate goals are to have the new profiling backend available on nightly builds for desktop Linux, Android and B2G.\u00a0 Currently 64- and 32-bit Linux work.\u00a0 If you want to give it a try, <a href=\"http:\/\/nightly.mozilla.org\/\">grab one<\/a> and follow the instructions shown <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Performance\/Profiling_with_the_Built-in_Profiler#Using_native_stack_unwinding_on_32-_and_64-bit_Linux\">here<\/a>.<\/p>\n<ul>\n<li>Benoit committed a patch (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=851748\">851748<\/a>) to remove some of the worst code duplication resulting from the 779291 landing.\u00a0 He also cleaned up some of the profiler headers <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=851611\">(851611<\/a>).<\/li>\n<\/ul>\n<ul>\n<li>Currently the profiler backend is controlled by environment variables it reads at startup.\u00a0 Benoit made a step towards making these configurable within the GUI (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=856331\">856331<\/a>).<\/li>\n<\/ul>\n<ul>\n<li>One current problem is that it&#8217;s difficult to establish why unwinding gives poor results.\u00a0 Breakpad sometimes fails to find or read CFI information for a shared object.\u00a0 But that&#8217;s difficult to diagnose because the profiler&#8217;s logging facilities are poor.\u00a0 I improved Breakpad&#8217;s logging facilities somewhat (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=853851\">853851<\/a>, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=857242\">857242<\/a>) so we can send diagnostic information to the Android log or Linux console.\u00a0 An as-yet unactioned item is to extract CFI-coverage statistics from Breakpad (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=859775\">859775<\/a>) so as to make it obvious where objects lack adequate CFI.<\/li>\n<\/ul>\n<ul>\n<li>Another problem that quickly appeared is that, as a last-ditch measure, Breakpad will try to unwind using stack scanning.\u00a0 This is inherently imprecise and often adds non-existent frames to the trace, which seriously confuses the profile results.\u00a0 I added a patch (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=855977\">855977<\/a>) to disable stack scanning by default, but allows it to be selectively re-enabled if required.<\/li>\n<\/ul>\n<ul>\n<li>There was some evaluation of unwinding ability on desktop Linux (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=855466\">855466<\/a>).\u00a0 64-bit works well; 32-bit works, but not so well, for reasons that are not yet entirely clear.<\/li>\n<\/ul>\n<ul>\n<li>There is ongoing work to allow the profiler to work well on Android nightlies.\u00a0 The problem is that nightlies use Mike Hommey&#8217;s alternative runtime linker (faulty.lib) and that requires some plumbing work to allow Breakpad to read unwind information direct out of the APK file.\u00a0 Currently we have a proof of concept patch (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=802240\">802240<\/a>) that appears to work, but requires some revision before landing.<\/li>\n<\/ul>\n<ul>\n<li>There was investigation of a problem causing Firefox to livelock when starting any external program (<a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=837390\">837390<\/a>).\u00a0 This seems to be a bad interaction between the fork() syscall and the profiler signals.\u00a0 An initial patch was posted.<\/li>\n<\/ul>\n<p>Ongoing activities include: finishing up support for faulty.lib on Android, fixing the hang-at-fork problem, and trying to get a handle on why Breakpad gives us poorer unwind results than we expect, especially when doing frame-pointer based unwinding.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is some news about work on Firefox&#8217;s built-in time profiler (SPS), and in particular the work being done to use native stack unwinding by using the in-tree copy of the Breakpad unwinding library. There has been a lot of &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/jseward\/2013\/04\/10\/profiler-backend-news-10-april-2013\/\">Continue reading<\/a><\/p>\n","protected":false},"author":240,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/posts\/191"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/jseward\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}