Oh, ok, that makes sense. I thought I saw code relocations in production which were messing with our profiling, but we are using the CodeEventHandler API, so code moves are not disabled.
It's possible to make Linux perf understand code relocations though: --perf-prof writes a jitdump file, which has support for code relocations through timestamps. I'm already writing a pull request to report code moves through the CodeEventHandler API. Would you be interested in a pull request to make --perf-prof work with code relocations as well? On Thu, Sep 12, 2019, 2:03 AM Jakob Kummerow <[email protected]> wrote: > Code relocation is not supported *by (external) profiling tools, *because > mapping a pc to a function when processing the log file is hard when that > function has been moving around over time. Without profiling, Code objects > are relocatable. > > The CHECK right below the comment you found guarantees that it is not > outdated: CHECK(from.IsBytecodeArray()); would cause a crash if the > function was called with a Code object. > > And src/flags/flag-definitions.h is where the magic happens: > DEFINE_NEG_IMPLICATION(perf_prof, > compact_code_space) turns off code space compaction when profiling. > > > On Thu, Sep 12, 2019 at 2:25 AM <[email protected]> wrote: > >> I just found this comment on the codebase: >> >> // We may receive a CodeMove event if a BytecodeArray object moves. >> Otherwise >> // code relocation is not supported. >> >> ( >> https://chromium.googlesource.com/v8/v8/+/refs/heads/master/src/diagnostics/perf-jit.cc#497 >> ) >> >> I thought (optimized) code objects were allowed relocation (enabled by >> default with --compact-code-space). Is this comment outdated, or is my >> understanding incorrect? >> >> -- >> -- >> v8-dev mailing list >> [email protected] >> http://groups.google.com/group/v8-dev >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/v8-dev/cb765436-928c-4f29-b334-cf60581ae89f%40googlegroups.com >> <https://groups.google.com/d/msgid/v8-dev/cb765436-928c-4f29-b334-cf60581ae89f%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to a topic in the > Google Groups "v8-dev" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/v8-dev/7cGYttemOFQ/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/v8-dev/CAKSzg3QuW2X9a53ZpgmdfhVXefM%2BNecNabdkN3ikRrzQtpWcbg%40mail.gmail.com > <https://groups.google.com/d/msgid/v8-dev/CAKSzg3QuW2X9a53ZpgmdfhVXefM%2BNecNabdkN3ikRrzQtpWcbg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAHQke3u2rPoYTSEscKTwiy6iYsHMBsDQj-6O%3DcdpsPMRsbmqyw%40mail.gmail.com.
