mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
@@ -95,7 +95,7 @@ private:
|
||||
std::map<int, std::set<int>> BinderParser(std::ifstream& fin, std::string& stack, std::set<int>& asyncPids) const;
|
||||
std::map<int, std::set<int>> BinderLineParser(std::ifstream& fin, std::string& stack,
|
||||
std::map<uint32_t, uint32_t>& asyncBinderMap,
|
||||
std::vector<std::pair<uint32_t, uint64_t>>& freezeAsyncSpacePairs) const;
|
||||
std::vector<std::pair<uint32_t, uint64_t>>& freeAsyncSpacePairs) const;
|
||||
std::vector<std::string> GetFileToList(std::string line) const;
|
||||
void ParseBinderPids(const std::map<int, std::set<int>>& binderInfo, std::set<int>& pids, int pid, int layer) const;
|
||||
std::set<int> GetBinderPeerPids(std::string& stack, int pid, std::set<int>& asyncPids) const;
|
||||
|
||||
@@ -278,23 +278,25 @@ int AppfreezeManager::AcquireStack(const FaultData& faultData,
|
||||
std::string binderPidsStr;
|
||||
std::set<int> asyncPids;
|
||||
std::set<int> syncPids = GetBinderPeerPids(binderInfo, pid, asyncPids);
|
||||
std::set<int> pids;
|
||||
pids.insert(syncPids.begin(), syncPids.end());
|
||||
pids.insert(asyncPids.begin(), asyncPids.end());
|
||||
for (auto& pidTemp : pids) {
|
||||
TAG_LOGI(AAFwkTag::APPDFR, "pidTemp pids:%{public}d", pidTemp);
|
||||
if (syncPids.empty()) {
|
||||
binderInfo +="PeerBinder pids is empty\n";
|
||||
}
|
||||
for (auto& pidTemp : syncPids) {
|
||||
TAG_LOGI(AAFwkTag::APPDFR, "PeerBinder pidTemp pids:%{public}d", pidTemp);
|
||||
if (pidTemp != pid) {
|
||||
std::string content = "PeerBinder catcher stacktrace for pid : " + std::to_string(pidTemp) + "\n";
|
||||
content += CatcherStacktrace(pidTemp);
|
||||
binderInfo += content;
|
||||
if (syncPids.find(pidTemp) != syncPids.end()) {
|
||||
binderPidsStr += " " + std::to_string(pidTemp);
|
||||
}
|
||||
binderPidsStr += " " + std::to_string(pidTemp);
|
||||
}
|
||||
}
|
||||
|
||||
if (pids.empty()) {
|
||||
binderInfo +="PeerBinder pids is empty\n";
|
||||
for (auto& pidTemp : asyncPids) {
|
||||
TAG_LOGI(AAFwkTag::APPDFR, "AsyncBinder pidTemp pids:%{public}d", pidTemp);
|
||||
if (pidTemp != pid && syncPids.find(pidTemp) == syncPids.end()) {
|
||||
std::string content = "AsyncBinder catcher stacktrace for pid : " + std::to_string(pidTemp) + "\n";
|
||||
content += CatcherStacktrace(pidTemp);
|
||||
binderInfo += content;
|
||||
}
|
||||
}
|
||||
|
||||
std::string fileName = faultData.errorObject.name + "_" +
|
||||
@@ -353,10 +355,10 @@ std::map<int, std::set<int>> AppfreezeManager::BinderParser(std::ifstream& fin,
|
||||
int asyncBinderSize = asyncBinderPairs.size();
|
||||
int individualMaxSize = 2;
|
||||
for (int i = 0; i < individualMaxSize; i++) {
|
||||
if (freeAsyncSpaceSize > 0 && i < freeAsyncSpaceSize) {
|
||||
if (i < freeAsyncSpaceSize) {
|
||||
asyncPids.insert(freeAsyncSpacePairs[i].first);
|
||||
}
|
||||
if (asyncBinderSize > 0 && i < asyncBinderSize) {
|
||||
if (i < asyncBinderSize) {
|
||||
asyncPids.insert(asyncBinderPairs[i].first);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user