From ae788f89e1da7499ebfecb35224fb3165affac99 Mon Sep 17 00:00:00 2001 From: echodo <2220386943@qq.com> Date: Wed, 5 Feb 2025 17:49:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=96=87=E6=A1=A3,=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0sampling=E6=A8=A1=E5=BC=8Fpd=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Details_Usage.md | 2 ++ docs/Python_API.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Details_Usage.md b/docs/Details_Usage.md index 789a011..2857246 100644 --- a/docs/Details_Usage.md +++ b/docs/Details_Usage.md @@ -285,6 +285,7 @@ evtList[0] = "sched:sched_switch"; PmuAttr attr = {0}; attr.evtList = evtList; attr.numEvt = 1; +int pd = PmuOpen(SAMPLING, &attr); ``` ```python @@ -295,6 +296,7 @@ pmu_attr = kperf.PmuAttr( sampleRate=1000, symbolMode=kperf.SymbolMode.RESOLVE_ELF # 不需要符号解析,可以不使用该参数 ) +pd = kperf.open(kperf.PmuTaskType.SAMPLING, pmu_attr) ``` tracepoint支持Counting和Sampling两种模式,API调用流程和两者相似。 diff --git a/docs/Python_API.md b/docs/Python_API.md index 0a8586d..1725879 100644 --- a/docs/Python_API.md +++ b/docs/Python_API.md @@ -22,7 +22,7 @@ kperf.open(collector_type=kperf.PmuTaskType, pmu_attr=kperf.PmuAttr) * sampleRate 采样频率,可通过/proc/sys/kernel/perf_event_max_sample_rate调整最大的采样频率 * useFreq - 是否启用采样频率,如果设置,将可以使用采用频率 + 是否启用采样频率,如果设置,将可以使用采样频率 * excludeUser 排除对用户态数据的采集 * excludeKernel -- Gitee