简体   繁体   English

实时分析 DSP 对象的 CPU 使用情况

[英]Profile CPU Usage of DSP objects in Realtime

Description描述

Our Application is based of DSP synthesizer mostly used to create music, written in C Language, and I want to create a system-wide feature to give visual feedback to the user so they can find out which DSP objects are the most CPU-hungry.我们的应用程序基于主要用于创作音乐的 DSP 合成器,用 C 语言编写,我想创建一个系统范围的功能来向用户提供视觉反馈,以便他们找出哪些 DSP 对象最需要 CPU。

I researched a lot but I can't find a way to do implement this feature.我研究了很多,但找不到实现此功能的方法。

Can anyone guide me how can I implement this feature?谁能指导我如何实现此功能?

I just want someone to point me in the right direction!!我只是想让有人指出我正确的方向!!

Thanks in Advance提前致谢

I have tried to understand how Windows Task Manager works and how ps command in Linux works...我试图了解 Windows 任务管理器如何工作以及 Linux 中的 ps 命令如何工作......

I also looked into Win32API but they all just show currently running processes, and My task is to find the CPU usage of DSP objects currently in use...我还查看了 Win32API,但它们都只显示当前正在运行的进程,我的任务是查找当前正在使用的 DSP 对象的 CPU 使用率……

my naive approach would involve counting CPU cycles in each method of the object, but I have no idea if thats even the right place to start thinking about it我天真的方法是计算 object 的每个方法中的 CPU 周期,但我不知道这是否是开始考虑它的正确位置

how about this: measure the time each block takes to do its thing?这个怎么样:测量每个块完成它的事情所花费的时间?

the scheduler calls each perform-routine in the DSP graph.调度程序调用 DSP 图中的每个执行例程。 so you just need to measure the time it takes for the perform-routine to return.所以你只需要测量执行例程返回所需的时间。 the longer it takes, the more CPU-hungry the object is (eventually scale the values by the block size)花费的时间越长,object 对 CPU 的消耗就越大(最终按块大小缩放值)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM