nyxsonsleep
V2EX  ›  问与答

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

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

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

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

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

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