已合并
fix: kernel trace at low version kernel #478
wuying39创建于 6 天前
fix: kernel trace at low version kernel #478
已合并
wuying39创建于 6 天前
wuying39
wuying39
6 天前
问题: pr期望解决的问题
原因: 问题产生的原因
方法: 问题解决的方法
likedislike
Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 wuying39 的贡献)
wuying39wuying39
6 天前 创建了 pull request,commit 864737ef
atomgit-bot
atomgit-bot
6 天前 评论:

变更摘要

该 PR 旨在修复低版本内核上的 kernel trace 采集失败问题:低版本内核的 ftrace IP(function-graph 记录的补丁点地址)可能与 /proc/kallsyms 中的符号地址不一致,且 tracefs 未提供 available_filter_functions_addrs,导致按地址精确匹配时大量记录丢失。本改动在精确匹配之外增加"按内核符号范围回退"的地址解析路径,并为 function-graph 补充 set_graph_function 过滤配置,相关改动涉及 pmu/trace/kernel_trace_raw.cpppmu/trace/kernel_trace_util.cpp

主要改动

  • 符号解析改为全量收集: ResolveKernelSymbols 不再按请求函数列表过滤,而是解析整个 /proc/kallsyms 中类型为 t/T/w/W 的文本符号并建立地址表,为范围回退提供基础数据。
  • 新增范围回退地址解析: RawTraceStream 新增 canonicalAddressRanges(排序后的地址区间表)与 rangeResolvedAddressRecords 计数;在 canonicalAddressByTraceAddress 精确匹配失败后,通过 std::upper_bound 在范围表中查找最近的前驱符号地址作为 canonicalAddress,仍失败才计入 addressMissRecords 并丢弃。
  • 填充并维护地址范围表: StartRawTraceStreamsession.addresses 中的符号地址填充 canonicalAddressRanges,并做排序与去重,供后续二分查找使用。
  • 新增 graph 过滤配置: 新增 WriteGraphFunctionFilter 向 tracefs 的 set_graph_function 写入过滤函数(该文件不存在时静默跳过),并在 ConfigureGlobalTraceFs 中与原有 WriteFunctionFilter 一并调用。
  • 范围解析结果日志化: TakeRawTraceEventsrangeResolvedAddressRecords 非零时输出 "symbolized ftrace IPs by kernel symbol range" 的告警日志,便于观察回退解析发生情况。
likedislike
atomgit-bot
atomgit-bot
6 天前 评论:

代码审查

✅ 未发现问题

likedislike
openeuler-ci-botopeneuler-ci-bot成员
6 天前 将znzju,hubin1305,Vchanger,chendh1设为审查人
openeuler-ci-botopeneuler-ci-bot成员
6 天前 添加了label:sig/A-Tune
openeuler-ci-bot
openeuler-ci-bot成员
6 天前 评论:

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 .

likedislike
openeuler-ci-botopeneuler-ci-bot成员
6 天前 添加了label:openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-bot成员
6 天前 评论:

CLA Signature Pass

wuying39, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
openeuler-ci-botopeneuler-ci-bot成员
6 天前 添加了label:ci_processing
openeuler-ci-bot
openeuler-ci-bot成员
6 天前 评论:

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

likedislike
openeuler-ci-botopeneuler-ci-bot成员
5 天前 删除了label:ci_processing
openeuler-ci-bot
openeuler-ci-bot成员
5 天前 评论:
Check Name Build Result 详情 Build Details
check_sca SUCCESS #356
check_code SUCCESS
check_package_license WARNING • 仓库copyright检查未通过: 缺少项目级Copyright声明文件
x86_64 check_build SUCCESS #356
likedislike
openeuler-ci-botopeneuler-ci-bot成员
5 天前 添加了label:ci_successful
openeuler-ci-bot
openeuler-ci-bot成员
5 天前 评论:
likedislike
GalaxyG成员
5 天前 评论:

/lgtm
/approve

likedislike
openeuler-ci-botopeneuler-ci-bot成员
5 天前 添加了label:approvedlgtm
openeuler-ci-bot
openeuler-ci-bot成员
5 天前 评论:

Review Code Feedback

  • The label lgtm, approved was added to this pull request. It means that GalaxyG reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-botopeneuler-ci-bot成员
5 天前 合入了pull request,合并节点 SHA:288cc1399dfdaa53473d1e1dae1e0c4402f38cfd