1

I have a program that launches a child process where the code I want to profile is running.

While I can run the Debug > Performance Profiler > CPU Usage on the parent process, I can't seem to see any of the child process events. Is this possible? Has anyone attempted this before?

Here is an example of how I'm launching the child process from the parent.

    using System.Diagnostics;
    
    namespace Parent
    {
        internal class Program
        {
            static void Main(string[] args)
            {
var proc = Process.Start("\"C:\\Users\\user\\source\\repos\\ProfileChild\\Child\\bin\\Debug\\net8.0\\Child.exe\"");
    
                if (proc != null)
                    proc.WaitForExit();
            }
        }
    }
2
  • “Launches a client program” - how? By running a .exe file? Commented Dec 3, 2024 at 2:31
  • @stuartd I've added an example that shows how I'm launching the child process. Commented Dec 3, 2024 at 19:28

1 Answer 1

0

To analyze the CPU usage of a child process in Visual Studio, you can try the following:

1: Start the parent process.

2: Open the Debug menu and select Attach to Process.

3: Find and select the child process in the process list and click Attach.

4: Then you can perform performance analysis and the CPU usage of the child process should be recorded.

Related documents you can refer to: Document 1, Document 2

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.