Markdown Tutorial
A simple example of a Markdown blog post.
1700 字
|
9 分钟
go:linkname的使用与原理
最近在搞ospp时遇到了个难题,为分析runtime栈并与spanid和traceid通过label结合,我们需要用到pprof包的cpu_profiile,但是目前的对于全局cpuprofile增加label的唯一方法是通过ctx去传递,由于我们的agent需要混合编译到用户代码,这也就导致如果我们在agent设置全局ctx去传递label的话,用户就可能会对链路造成破坏(用户要增添自己的label也要去创建ctx,而这会覆盖😭)。目前有两种思路,第一种比较容易实现,我可以在toolkit去暴露一个函数让用户能够获取到当前的profile ctx,这样用户就可以在这个ctx的基础上去增添label,不会造成label丢失或混乱,但这样会对用户造成代码的侵入,且会增加用户的学习成本,并不是最优选择,所以就需要走第二条路,重写(或新增)pprof的部分方法,来实现不需要借助ctx传递就能设置label的方法。正当我借助ai分析源码时,一个不好的消息传来,最为关键的设置label的一个方法是为导出的😅。
844 字
|
4 分钟
Markdown Mermaid
A simple example of a Markdown blog post with Mermaid.
578 字
|
3 分钟
Chen
A simple example of a Markdown blog post.
438 字
|
2 分钟
Include Video in the Posts
This post demonstrates how to include embedded video in a blog post.
62 字
|
1 分钟
封面
示例歌曲
示例艺术家
封面
示例歌曲
示例艺术家
0:00 / 0:00