Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 wuying39 的贡献)变更摘要
该 PR 旨在修复低版本内核上的 kernel trace 采集失败问题:低版本内核的 ftrace IP(function-graph 记录的补丁点地址)可能与 /proc/kallsyms 中的符号地址不一致,且 tracefs 未提供 available_filter_functions_addrs,导致按地址精确匹配时大量记录丢失。本改动在精确匹配之外增加"按内核符号范围回退"的地址解析路径,并为 function-graph 补充 set_graph_function 过滤配置,相关改动涉及 pmu/trace/kernel_trace_raw.cpp 与 pmu/trace/kernel_trace_util.cpp。
主要改动
- 符号解析改为全量收集:
ResolveKernelSymbols不再按请求函数列表过滤,而是解析整个/proc/kallsyms中类型为t/T/w/W的文本符号并建立地址表,为范围回退提供基础数据。 - 新增范围回退地址解析:
RawTraceStream新增canonicalAddressRanges(排序后的地址区间表)与rangeResolvedAddressRecords计数;在canonicalAddressByTraceAddress精确匹配失败后,通过std::upper_bound在范围表中查找最近的前驱符号地址作为canonicalAddress,仍失败才计入addressMissRecords并丢弃。 - 填充并维护地址范围表:
StartRawTraceStream用session.addresses中的符号地址填充canonicalAddressRanges,并做排序与去重,供后续二分查找使用。 - 新增 graph 过滤配置: 新增
WriteGraphFunctionFilter向 tracefs 的set_graph_function写入过滤函数(该文件不存在时静默跳过),并在ConfigureGlobalTraceFs中与原有WriteFunctionFilter一并调用。 - 范围解析结果日志化:
TakeRawTraceEvents在rangeResolvedAddressRecords非零时输出 "symbolized ftrace IPs by kernel symbol range" 的告警日志,便于观察回退解析发生情况。


Welcome To openEuler Community
Hey @wuying39 , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.
Contact Guide
If you have any questions, please contact the SIG: A-Tune ,
and any of the maintainers: @Vchanger, @chendh1, @hubin1305, @znzju ,
and any of the committers: @GalaxyG, @eggilu, @jinyao2561 .


门禁正在运行, 您可以通过以下链接查看实时门禁检查结果.
若您对门禁结果含义不清晰或者遇到问题不知如何解决,可参考门禁指导手册
门禁入口及编码规范检查: multiarch/openeuler/trigger/libkperf/356/console


问题: pr期望解决的问题
原因: 问题产生的原因
方法: 问题解决的方法