Skip to content

Optimized functions discard inlining information when profiling with linux perf (or samply) #63816

@GuillaumeLagrange

Description

@GuillaumeLagrange

Version

v24.15.0

Platform

Linux badlands 6.12.91 #1-NixOS SMP PREEMPT_DYNAMIC Sat May 23 11:05:02 UTC 2026 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

basic.js

Using samply for profiling for simplicity, but the result is the same using perf record, then perf inject then the folding flamegraph scripts.

samply record -- node --perf-prof --interpreted-frames-native-stack --expose-gc --allow-natives-syntax basic.js

Yields this profile on my machine that you can load with samply load ./profile.json.gz

profile.json.gz

Image

Notice the lost parent_1->a calls as children of the optimized root_function

How often does it reproduce? Is there a required condition?

100%, at least on x86

What is the expected behavior? Why is that the expected behavior?

Using latest d8 canary

$ ./d8 --version
V8 version 15.0.245.4

Yields this profile

$ samply record -- ./d8 --perf-prof --interpreted-frames-native-stack --expose-gc --allow-natives-syntax basic.js

profile.json.gz

Image

Note: the root function is transformed into a Builtin::EntryTrampoline because of this bug: https://issues.chromium.org/issues/520898842
I am using stock node/d8 builds to reduce the number of moving parts

What do you see instead?

We should see the inlined function as we do in the latest d8 build.

Additional information

I was not able to test with a stock node 26 build because it seems that it output corrupted jit dumps on my machine for an unrelated issue.

I have a patch that backported some of the v8 changes into the node24 branch and seemed to fix the issue, which I would be interested to submit.

The open question is about backporting

  1. Is the team willing to backport this? Since node 24 will not be deprecated until 2027, this would help improve linux perf profiling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions