From 256c2c69e204be5b163dde0a36eede3e908d9da3 Mon Sep 17 00:00:00 2001 From: echodo <2220386943@qq.com> Date: Fri, 4 Jul 2025 10:55:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=96=99=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Details_Usage.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/Details_Usage.md b/docs/Details_Usage.md index d2bfa43..010ea46 100644 --- a/docs/Details_Usage.md +++ b/docs/Details_Usage.md @@ -66,6 +66,7 @@ kperf.disable(pd) ``` ```go +// go代码示例 kperf.PmuEnable(pd) time.Sleep(time.Second) kperf.PmuDisable(pd) @@ -659,7 +660,7 @@ perf stat -e "{cycles,branch-loads,branch-load-misses,iTLB-loads}",inst_retired 如果对多个相关联的事件采集,可以把关联的事件放到一个事件组。比如,计算bad speculation需要用到事件inst_retired,inst_spec和cycles,计算retiring需要用到事件inst_retired和cycles。那么perf应该这样使用: ``` -perf stat -e "{inst_retired,inst_spec,cycles}","{inst_spec,cycles}" +perf stat -e "{inst_retired,inst_spec,cycles}","{inst_retired,cycles}" ``` 用libkperf可以这样实现: ```c++ -- Gitee