nyxsonsleep
V2EX  ›  问与答

perf 能统计到类似 sleep 类函数的耗时吗?

  •  
  •   nyxsonsleep · Aug 19, 2024 · 846 views
    This topic created in 657 days ago, the information mentioned may be changed or developed.

    我用 perf 可以根据 cpu 占用率进行统计函数的 heavy 程度。

    但是我在性能优化的时候发现有的函数在等待一些动作,但是这些等待的时间没被统计成函数的占用。

    目前我主要想知道各个函数在执行过程中的耗时占比。

    nyxsonsleep
        1
    nyxsonsleep  
    OP
       Aug 19, 2024
    好像懂了点,之前用的都是硬件事件。应该使用软件事件是吧?看起来似乎是 cpu-clock?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1145 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 23:34 · PVG 07:34 · LAX 16:34 · JFK 19:34
    ♥ Do have faith in what you're doing.