add oaded func base vaddr in proto report file

Signed-off-by: zhangcui <zhangcui11@huawei.com>
This commit is contained in:
zhangcui 2022-09-21 08:11:08 +00:00 committed by Gitee
parent cda897fb8a
commit 11e2e0bc5d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) 2021 Huawei Device Co., Ltd. // Copyright (c) 2021-2022 Huawei Device Co., Ltd.
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
@ -41,6 +41,9 @@ message CallStackSample {
// index of SymbolTableFile::symbol_name, base from 0 // index of SymbolTableFile::symbol_name, base from 0
// -1 means not found // -1 means not found
optional int32 function_name_id = 3; optional int32 function_name_id = 3;
// loaded function base vaddr
optional uint64 loaded_vaddr = 4;
} }
repeated CallStackFrame callStackFrame = 3; repeated CallStackFrame callStackFrame = 3;

View File

@ -126,7 +126,7 @@ bool ReportProtobufFileWriter::ProcessSampleRecord(
for (const CallFrame &frame : recordSample.callFrames_) { for (const CallFrame &frame : recordSample.callFrames_) {
auto callframe = sample->add_callstackframe(); auto callframe = sample->add_callstackframe();
callframe->set_symbols_vaddr(frame.vaddrInFile_); callframe->set_symbols_vaddr(frame.vaddrInFile_);
callframe->set_loaded_vaddr(frame.ip_ - frame.offsetToVaddr_);
for (auto fileIt = symbolsFiles.begin(); fileIt != symbolsFiles.end(); fileIt++) { for (auto fileIt = symbolsFiles.begin(); fileIt != symbolsFiles.end(); fileIt++) {
if (fileIt->get()->filePath_ == frame.filePath_) { if (fileIt->get()->filePath_ == frame.filePath_) {
callframe->set_symbols_file_id(fileIt - symbolsFiles.begin()); callframe->set_symbols_file_id(fileIt - symbolsFiles.begin());