• Home
  • Raw
  • Download

Lines Matching refs:rawStack

264     StackDataRepeater::RawStack rawStack;  in TakeResultsFromShmem()  local
265 RawStackPtr rawData(&rawStack, [](StackDataRepeater::RawStack* del) {}); in TakeResultsFromShmem()
623 inline uint32_t StackPreprocess::GetCallStackId(const RawStackPtr& rawStack, std::vector<CallFrame>… in GetCallStackId() argument
629 if ((rawStack->stackConext->type == FREE_MSG) && !hookConfig_.free_stack_report()) { in GetCallStackId()
631 } else if ((rawStack->stackConext->type == MUNMAP_MSG) && !hookConfig_.munmap_stack_report()) { in GetCallStackId()
636 …if (rawStack->stackConext->type == MEMORY_USING_MSG && hookConfig_.js_stack_report() == NAPI_CALL_… in GetCallStackId()
638 GetMemTag(rawStack->stackConext->tagId, tagName); in GetCallStackId()
650 if ((!hookConfig_.fp_unwind()) && rawStack->stackSize == 0) { in GetCallStackId()
658 GetMemTag(rawStack->stackConext->tagId, tagName); in GetCallStackId()
674 void StackPreprocess::SetEventFrame(const ReportEventBaseData& rawStack, in SetEventFrame() argument
678 event->set_tid(rawStack.tid); in SetEventFrame()
679 event->set_addr(rawStack.addr); in SetEventFrame()
685 auto size = static_cast<uint64_t>(rawStack.mallocSize); in SetEventFrame()
694 event->set_thread_name_id(rawStack.tid); in SetEventFrame()
697 event->set_thread_name_id(rawStack.tid); in SetEventFrame()
701 void StackPreprocess::SetEventFrame(const RawStackPtr& rawStack, std::vector<CallFrame>& callFrames, in SetEventFrame() argument
706 event->set_pid(rawStack->stackConext->pid); in SetEventFrame()
707 event->set_tid(rawStack->stackConext->tid); in SetEventFrame()
708 event->set_addr((uint64_t)rawStack->stackConext->addr); in SetEventFrame()
715 auto size = static_cast<uint64_t>(rawStack->stackConext->mallocSize); in SetEventFrame()
725 event->set_thread_name_id(rawStack->stackConext->tid); in SetEventFrame()
732 event->set_thread_name_id(rawStack->stackConext->tid); in SetEventFrame()
756 void StackPreprocess::SetAllocStatisticsFrame(const RawStackPtr& rawStack, std::vector<CallFrame>& … in SetAllocStatisticsFrame() argument
765 GetMemTag(rawStack->stackConext->tagId, tagName); in SetAllocStatisticsFrame()
774 callStack_.push_back(rawStack->stackConext->mallocSize | SIZE_MASK); in SetAllocStatisticsFrame()
783 GetMemTag(rawStack->stackConext->tagId, tagName); in SetAllocStatisticsFrame()
792 SetAllocStatisticsData(rawStack, stackId, true); in SetAllocStatisticsFrame()
796 SetAllocStatisticsData(rawStack, stackId); in SetAllocStatisticsFrame()
801 void StackPreprocess::SetAllocStatisticsFrame(const RawStackPtr& rawStack, T& stackData) in SetAllocStatisticsFrame() argument
803 callStack_.resize(rawStack->fpDepth + 1); in SetAllocStatisticsFrame()
804 callStack_[0] = (rawStack->stackConext->mallocSize | SIZE_MASK); in SetAllocStatisticsFrame()
805 if (memcpy_s(callStack_.data() + 1, sizeof(uint64_t) * rawStack->fpDepth, in SetAllocStatisticsFrame()
806 rawStack->data, sizeof(uint64_t) * rawStack->fpDepth) != EOK) { in SetAllocStatisticsFrame()
814 SetAllocStatisticsData(rawStack, stackId, true); in SetAllocStatisticsFrame()
818 SetAllocStatisticsData(rawStack, stackId); in SetAllocStatisticsFrame()
823 void StackPreprocess::SetHookData(RawStackPtr rawStack, T& stackData) in SetHookData() argument
827 switch (rawStack->stackConext->type) { in SetHookData()
831 SetFreeStatisticsData((uint64_t)rawStack->stackConext->addr); in SetHookData()
835 rawStack->stackConext->mallocSize = ComputeAlign(rawStack->stackConext->mallocSize); in SetHookData()
839 SetAllocStatisticsFrame(rawStack, stackData); in SetHookData()
863 void StackPreprocess::SetApplyAndReleaseMatchFrame(RawStackPtr rawStack, std::vector<CallFrame>& ca… in SetApplyAndReleaseMatchFrame() argument
867 if (rawStack->stackConext->type != PR_SET_VMA_MSG) { in SetApplyAndReleaseMatchFrame()
868 stackMapId = GetCallStackId(rawStack, callFrames, stackData); in SetApplyAndReleaseMatchFrame()
870 rawStack->stackConext->tagId = prctlPeriodTags_.size(); in SetApplyAndReleaseMatchFrame()
871 prctlPeriodTags_.emplace_back(reinterpret_cast<char*>(rawStack->data)); in SetApplyAndReleaseMatchFrame()
872 applyAndReleaseMatchPeriodListData_.emplace_back(rawStack->stackConext); in SetApplyAndReleaseMatchFrame()
874 if (rawStack->stackConext->type == MALLOC_MSG) { in SetApplyAndReleaseMatchFrame()
875 rawStack->stackConext->mallocSize = ComputeAlign(rawStack->stackConext->mallocSize); in SetApplyAndReleaseMatchFrame()
876 } else if (rawStack->stackConext->type == PR_SET_VMA_MSG) { in SetApplyAndReleaseMatchFrame()
879 uint64_t addr = reinterpret_cast<uint64_t>(rawStack->stackConext->addr); in SetApplyAndReleaseMatchFrame()
885 applyAndReleaseMatchPeriodListData_.emplace_back(rawStack->stackConext, stackMapId); in SetApplyAndReleaseMatchFrame()
891 void StackPreprocess::SetHookData(RawStackPtr rawStack, std::vector<CallFrame>& callFrames, T& stac… in SetHookData() argument
895 switch (rawStack->stackConext->type) { in SetHookData()
899 SetFreeStatisticsData((uint64_t)rawStack->stackConext->addr); in SetHookData()
903 rawStack->stackConext->mallocSize = ComputeAlign(rawStack->stackConext->mallocSize); in SetHookData()
907 SetAllocStatisticsFrame(rawStack, callFrames, stackData); in SetHookData()
914 … PROFILER_LOG_ERROR(LOG_CORE, "statistics event type:%d error", rawStack->stackConext->type); in SetHookData()
923 … !(rawStack->stackConext->type == MEMORY_TAG || rawStack->stackConext->type == PR_SET_VMA_MSG)) { in SetHookData()
924 stackMapId = GetCallStackId(rawStack, callFrames, stackData); in SetHookData()
936 hookData->set_tv_sec(rawStack->stackConext->ts.tv_sec); in SetHookData()
937 hookData->set_tv_nsec(rawStack->stackConext->ts.tv_nsec); in SetHookData()
939 if (rawStack->stackConext->type == MALLOC_MSG) { in SetHookData()
941 SetEventFrame(rawStack, callFrames, allocEvent, stackMapId); in SetHookData()
942 } else if (rawStack->stackConext->type == FREE_MSG) { in SetHookData()
944 SetEventFrame(rawStack, callFrames, freeEvent, stackMapId); in SetHookData()
945 } else if (rawStack->stackConext->type == MMAP_MSG) { in SetHookData()
947 SetEventFrame(rawStack, callFrames, mmapEvent, stackMapId); in SetHookData()
948 } else if (rawStack->stackConext->type == MMAP_FILE_PAGE_MSG) { in SetHookData()
952 if (GetMemTag(rawStack->stackConext->tagId, tagName)) { in SetHookData()
955 SetEventFrame(rawStack, callFrames, mmapEvent, stackMapId, tagName); in SetHookData()
956 } else if (rawStack->stackConext->type == MUNMAP_MSG) { in SetHookData()
958 SetEventFrame(rawStack, callFrames, munmapEvent, stackMapId); in SetHookData()
959 } else if (rawStack->stackConext->type == PR_SET_VMA_MSG) { in SetHookData()
962 std::string tagName(reinterpret_cast<char*>(rawStack->data)); in SetHookData()
963 tagEvent->set_addr((uint64_t)rawStack->stackConext->addr); in SetHookData()
964 tagEvent->set_size(rawStack->stackConext->mallocSize); in SetHookData()
967 } else if (rawStack->stackConext->type == MEMORY_USING_MSG) { in SetHookData()
970 GetMemTag(rawStack->stackConext->tagId, tagName); in SetHookData()
971 SetEventFrame(rawStack, callFrames, mmapEvent, stackMapId, tagName); in SetHookData()
972 } else if (rawStack->stackConext->type == MEMORY_UNUSING_MSG) { in SetHookData()
974 SetEventFrame(rawStack, callFrames, munmapEvent, stackMapId); in SetHookData()
993 inline void StackPreprocess::SetAllocStatisticsData(const RawStackPtr& rawStack, size_t stackId, bo… in SetAllocStatisticsData() argument
1001 record.applySize += rawStack->stackConext->mallocSize; in SetAllocStatisticsData()
1002 allocAddrMap_[(uint64_t)rawStack->stackConext->addr] = in SetAllocStatisticsData()
1003 std::pair(rawStack->stackConext->mallocSize, &recordIter->second); in SetAllocStatisticsData()
1008 record.pid = rawStack->stackConext->pid; in SetAllocStatisticsData()
1011 record.applySize = rawStack->stackConext->mallocSize; in SetAllocStatisticsData()
1012 switch (rawStack->stackConext->type) { in SetAllocStatisticsData()
1027 record.tagId = rawStack->stackConext->tagId; in SetAllocStatisticsData()
1037 allocAddrMap_[(uint64_t)rawStack->stackConext->addr] = in SetAllocStatisticsData()
1038 std::pair(rawStack->stackConext->mallocSize, &recordIter->second); in SetAllocStatisticsData()
1043 void StackPreprocess::WriteFrames(RawStackPtr rawStack, const std::vector<CallFrame>& callFrames) in WriteFrames() argument
1047 if (rawStack->stackConext->type == PR_SET_VMA_MSG) { in WriteFrames()
1049 std::string tagName(reinterpret_cast<char*>(rawStack->data)); in WriteFrames()
1051 rawStack->stackConext->pid, rawStack->stackConext->tid, in WriteFrames()
1052 (int64_t)rawStack->stackConext->ts.tv_sec, rawStack->stackConext->ts.tv_nsec, in WriteFrames()
1053 (uint64_t)rawStack->stackConext->addr, (prefix + tagName).c_str()); in WriteFrames()
1057 switch (rawStack->stackConext->type) { in WriteFrames()
1075rawStack->stackConext->pid, rawStack->stackConext->tid, (int64_t)rawStack->stackConext->ts.tv_sec, in WriteFrames()
1076rawStack->stackConext->ts.tv_nsec, (uint64_t)rawStack->stackConext->addr, rawStack->stackConext->m… in WriteFrames()
1620 for (const auto& rawStack: applyAndReleaseMatchPeriodListData_) { in FlushRecordApplyAndReleaseMatchData() local
1622 hookData->set_tv_sec(rawStack.ts.tv_sec); in FlushRecordApplyAndReleaseMatchData()
1623 hookData->set_tv_nsec(rawStack.ts.tv_nsec); in FlushRecordApplyAndReleaseMatchData()
1624 if (rawStack.type == MALLOC_MSG) { in FlushRecordApplyAndReleaseMatchData()
1626 SetEventFrame(rawStack, allocEvent, rawStack.stackMapId); in FlushRecordApplyAndReleaseMatchData()
1627 } else if (rawStack.type == FREE_MSG) { in FlushRecordApplyAndReleaseMatchData()
1629 SetEventFrame(rawStack, freeEvent, rawStack.stackMapId); in FlushRecordApplyAndReleaseMatchData()
1630 } else if (rawStack.type == MMAP_MSG) { in FlushRecordApplyAndReleaseMatchData()
1632 SetEventFrame(rawStack, mmapEvent, rawStack.stackMapId); in FlushRecordApplyAndReleaseMatchData()
1633 } else if (rawStack.type == MMAP_FILE_PAGE_MSG) { in FlushRecordApplyAndReleaseMatchData()
1637 if (GetMemTag(rawStack.tagId, tagName)) { in FlushRecordApplyAndReleaseMatchData()
1640 SetEventFrame(rawStack, mmapEvent, rawStack.stackMapId, tagName); in FlushRecordApplyAndReleaseMatchData()
1641 } else if (rawStack.type == MUNMAP_MSG) { in FlushRecordApplyAndReleaseMatchData()
1643 SetEventFrame(rawStack, munmapEvent, rawStack.stackMapId); in FlushRecordApplyAndReleaseMatchData()
1644 } else if (rawStack.type == PR_SET_VMA_MSG) { in FlushRecordApplyAndReleaseMatchData()
1647 tagEvent->set_addr(rawStack.addr); in FlushRecordApplyAndReleaseMatchData()
1648 tagEvent->set_size(rawStack.mallocSize); in FlushRecordApplyAndReleaseMatchData()
1649 tagEvent->set_tag(prefix + prctlPeriodTags_[rawStack.tagId]); in FlushRecordApplyAndReleaseMatchData()
1651 } else if (rawStack.type == MEMORY_USING_MSG) { in FlushRecordApplyAndReleaseMatchData()
1654 GetMemTag(rawStack.tagId, tagName); in FlushRecordApplyAndReleaseMatchData()
1655 SetEventFrame(rawStack, mmapEvent, rawStack.stackMapId, tagName); in FlushRecordApplyAndReleaseMatchData()
1656 } else if (rawStack.type == MEMORY_UNUSING_MSG) { in FlushRecordApplyAndReleaseMatchData()
1658 SetEventFrame(rawStack, munmapEvent, rawStack.stackMapId); in FlushRecordApplyAndReleaseMatchData()