Skip to content

Support symbol and asm data#39

Merged
BrytonLee merged 4 commits intoOptimatistOpenSource:mainfrom
saying121:sampling
Sep 23, 2025
Merged

Support symbol and asm data#39
BrytonLee merged 4 commits intoOptimatistOpenSource:mainfrom
saying121:sampling

Conversation

@saying121
Copy link
Contributor

@saying121 saying121 commented Sep 22, 2025

新增的结构用途:ElfSymbol会在profilingTask结束后一同上传,后续选中对应symbol后触发反汇编上传对应指令

@saying121 saying121 requested a review from BrytonLee September 22, 2025 03:41
proto/psh.proto Outdated

message ElfSymbol {
string filename = 1;
repeated Symbol symbols = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加一个buildid字段,避免同名ELF文件,但是内容不一样。

proto/psh.proto Outdated
uint64 size = 4;
}

message Insns {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个可以在罗霄这端来做,不需要在PSH上解析。PSH可以直接把二进制文件传回给罗霄,罗霄通过build id进行索引。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把二进制传回的话,elfsymbol也可以在罗霄解析了,只需要传回文件跟build_id再加一些任务信息

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对,build_id每次都传回来,二进制文件按需传回,如果build_id 对应的二进制文件已经缓存了,就不需要再传送了。

proto/psh.proto Outdated
PerfDataProto perf_data = 3;
ElfSymbol symbol = 4;
Insns insns = 5;
ElfFile symbol = 4;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ElfFile elf_file = 4;, symbol不是一个准确的变量名。

@saying121 saying121 force-pushed the sampling branch 2 times, most recently from 251eb83 to f5f727e Compare September 23, 2025 01:46
proto/psh.proto Outdated
message ElfFile {
string filename = 1;
bytes build_id = 2;
bytes bytes = 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3和4的顺序换一下,假如protobuf是按照数字的顺序对排放结构体的字段,可能会出现arch的访问低效的问题(Data cache miss),bytes只要大于一个cache line就可能会导致arch不在cache line里面。

@BrytonLee BrytonLee merged commit 2f963d4 into OptimatistOpenSource:main Sep 23, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments