Hardware trace reconstruction of runtime compiled code. (9th February 2018) - Sharma, Suchakrapani Datt; Dagenais, Michel R.
Summary: Hardware tracing has emerged as a low‐cost technique to analyze systems at a very fine granularity, thus mitigating the need for software‐only trace approaches for performance analysis. State‐of‐the‐art trace hardware on modern Intel and ARM processors allows recording change‐of‐flow instructions in executable binaries, such as branches, for off‐line reconstruction. This conventional userspace–based trace reconstruction, however, is not robust enough in the common scenarios where runtime code is being generated, compiled, and executed. We therefore propose a novel kernel‐assisted mechanism called FlowJIT to reconstruct hardware traces with a low overhead of around 1.3 μ s per code page modification event. We further show the efficacy or our technique with the help of 2 illustrative usecases that cover the JIT compiled code scenario and a same‐page instruction modification scenario. Our implementation has been open sourced as a patch for the Linux kernel.