admin管理员组文章数量:1327984
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();
}
}
}
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();
}
}
}
Share
Improve this question
edited Jan 26 at 8:38
marc_s
756k184 gold badges1.4k silver badges1.5k bronze badges
asked Dec 3, 2024 at 1:04
Russel85Russel85
111 silver badge3 bronze badges
2
- “Launches a client program” - how? By running a .exe file? – stuartd Commented Dec 3, 2024 at 2:31
- @stuartd I've added an example that shows how I'm launching the child process. – Russel85 Commented Dec 3, 2024 at 19:28
1 Answer
Reset to default 0To 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
本文标签: cIs it possible to profile a NET child process using Visual Studio39s Profiling ToolsStack Overflow
版权声明:本文标题:c# - Is it possible to profile a NET child process using Visual Studio's Profiling Tools - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742250606a2440687.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论