Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frames for recursive calls added to MutableTraceEventStackSource are shown as merged #2095

Open
ara-ayvazyan opened this issue Aug 9, 2024 · 2 comments

Comments

@ara-ayvazyan
Copy link

The following stack doesn't show X calling into X in the stack view:

public class Commands : CommandEnvironment
{
    public void TestFileView(string fileName, string viewName)
    {
        var etlFile = OpenETLFile(fileName);
        OpenStackViewer(new Stacks(new RecursiveCallRepro(etlFile.TraceLog), viewName, etlFile));
    }
}

internal class RecursiveCallRepro : MutableTraceEventStackSource
{
    public RecursiveCallRepro(TraceLog traceLog)
        : base(traceLog)
    {
        var sample = new StackSourceSample(this);
        sample.StackIndex = Interner.CallStackIntern(Interner.FrameIntern("X"), sample.StackIndex);
        sample.StackIndex = Interner.CallStackIntern(Interner.FrameIntern("X"), sample.StackIndex);
        AddSample(sample);
    }
}

image
image

@brianrob
Copy link
Member

This is interesting - I had not seen it before. This appears to be in the stack viewer itself, and not in the StackSource code. I did a test where I wrote some recursive code, but didn't hit this:

image

I suspect that this is due to the fact that there are IPs involved in the trace where we're just dealing with names in the code above, and so there is no way to disambiguate between the two X frames when it comes to how the viewer works. I have not had enough time to dig through and figure out what you'd need to do here to address this - do you have a scenario that is blocked here, or were you just testing and ran into this?

@ara-ayvazyan
Copy link
Author

I have a use case for this (if actual recursive call happens in user code, which is less likely), but can probably inject an intermediate frame to work around for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants