有没有办法查看一个进程正在使用的每个内核有多少CPU使用率? [英] Is there a way to see how much CPU usage per core a process is using?

查看:164
本文介绍了有没有办法查看一个进程正在使用的每个内核有多少CPU使用率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在perfmon中您可以看到每个内核使用了多少资源,以及特定进程使用了​​多少CPU.但是,我似乎找不到一种方法来查看进程使用的CPU数量(按内核划分).

I know in perfmon you can see how much each core is utilized, and how much total CPU a particular process is using. However I can't seem to find a way to see how much CPU a process is using broken down by cores.

是否有内置的方式来查看此信息?有程序化的方式来查看此内容吗? (首选C#)我是否在通过问这个问题来说明Windows(Vista)如何处理核心用法和上下文切换的误解?

Is there a built-in way to see this information? Is there a programmatic way to see this? (C# preferred) Am I demonstrating a misunderstanding of how Windows (Vista) handles core usage and context switching by asking this question?

更清楚地说明我想查找的内容.我的进程是仅使用30-40%的总CPU(在四核上)是因为它没有足够的多线程来利用更多资源,还是因为I/O绑定过多并且磁盘访问是瓶颈?

More clarification of what I want to find out. Is my process only using 30-40% total CPU (on a quad core) because it's not sufficiently multi-threaded to utilize more or is it because it's too I/O bound and disk access is the bottleneck?

那么有没有办法做到这一点? (除了确保计算机上没有其他CPU活动正在进行之外)

So is there no way to do this at all? (other than make sure there's no other CPU activity going on on the computer)

推荐答案

您不能直接获取给定进程的每个处理器的周期时间,但是可以使用QueryIdleProcessorCycleTime随时间估算(因为它返回空闲状态)所有逻辑处理器(即核心)和QueryProcessCycleTime的时间,并假定它是唯一正在运行的非空闲进程.

You can't directly get the per-processer cycle times for a given process, but you can estimate it over time with QueryIdleProcessorCycleTime (as it returns idle times for all logical processors, i.e., cores) and QueryProcessCycleTime and assuming that it is the only non-idling process running.

这篇关于有没有办法查看一个进程正在使用的每个内核有多少CPU使用率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆