diff --git a/proto/report_sample.proto b/proto/report_sample.proto index d5d7f6c..fffd50a 100644 --- a/proto/report_sample.proto +++ b/proto/report_sample.proto @@ -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"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -41,6 +41,9 @@ message CallStackSample { // index of SymbolTableFile::symbol_name, base from 0 // -1 means not found optional int32 function_name_id = 3; + + // loaded function base vaddr + optional uint64 loaded_vaddr = 4; } repeated CallStackFrame callStackFrame = 3; diff --git a/src/report_protobuf_file.cpp b/src/report_protobuf_file.cpp index 994a4d5..42aa0da 100644 --- a/src/report_protobuf_file.cpp +++ b/src/report_protobuf_file.cpp @@ -126,7 +126,7 @@ bool ReportProtobufFileWriter::ProcessSampleRecord( for (const CallFrame &frame : recordSample.callFrames_) { auto callframe = sample->add_callstackframe(); callframe->set_symbols_vaddr(frame.vaddrInFile_); - + callframe->set_loaded_vaddr(frame.ip_ - frame.offsetToVaddr_); for (auto fileIt = symbolsFiles.begin(); fileIt != symbolsFiles.end(); fileIt++) { if (fileIt->get()->filePath_ == frame.filePath_) { callframe->set_symbols_file_id(fileIt - symbolsFiles.begin());