In node (v10.15.3), I've been profiling with node --prof <script> then summarizing the output with node --prof-process <output>. The resulting summary has a lot of unaccounted for ticks, which might connect to the slew of errors when running that second step, similar to the following:
...
Code move event for unknown code: 0x3663777f8b98
Code move event for unknown code: 0x3663777f9018
Code move event for unknown code: 0x3663777f9790
Code move event for unknown code: 0x36635f5fb5a8
Code move event for unknown code: 0x3663777f9b78
Code move event for unknown code: 0x3663777f9d00
Code move event for unknown code: 0x3663777fa150
Code move event for unknown code: 0x3663777fa7f8
Code move event for unknown code: 0x36635f5fe630
What does this "Code move event for unknown code" error signify? Is there a remedy to this that would give me more details in my profiling investigation?
In short: it means something was weird, and there's (probably) nothing you can do about it :-(
The log file generated with --prof contains, among other things, three related types of entries:
(1) "code object for function F created at address A with size S"
(2) "code object moved from address A1 to address A2"
(3) "execution sample was taken at address E"
The tick processor uses entries of types (1) and (2) to build up a map of code objects corresponding to functions, so when it sees an entry of type (3) it looks for the right function such that A <= E && E <= A+S and then reports that function as having received a profiler tick.
When something about the data is inconsistent, it can happen that the log file contains a move event (entry of type (2)) for a supposed code object at an address A1 that was never mentioned in an entry of type (1) before. In that case, the tick processor doesn't know what to do, so it prints a warning.
Your guess that this is somehow related to seeing many unaccounted ticks is very likely correct.
One workaround you can try (which may or may not help) is to specify --nocompact-code-space along with --prof. That shouldn't be necessary, but then you shouldn't be getting those move events for unknown code either...
Found the root cause. In my case, it was because for MacOS, the symbols are processed through c++filt and nm. The latter was not working properly because:
» nm --version
Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.
After running this command to accept the license, the symbols resolved correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With