Lines Matching refs:stack
564 bool EventLogger::IsKernelStack(const std::string& stack)
566 return (!stack.empty() && stack.find("Stack backtrace") != std::string::npos);
569 void EventLogger::GetNoJsonStack(std::string& stack, std::string& contentStack,
573 stack = contentStack;
575 } else if (DfxJsonFormatter::FormatKernelStack(contentStack, stack, isFormat)) {
577 contentStack = stack;
578 stack = "";
579 if (!isFormat || !DfxJsonFormatter::FormatJsonStack(contentStack, stack)) {
580 stack = contentStack;
584 stack = "Failed to format kernel stack\n";
590 std::string& stack, const std::string& msg, std::string& kernelStack)
603 if (!jsonStack.empty() && jsonStack[0] == '[') { // json stack info should start with '['
605 if (!DfxJsonFormatter::FormatJsonStack(jsonStack, stack)) {
606 stack = jsonStack;
609 GetNoJsonStack(stack, jsonStack, kernelStack, true);
612 GetFailedDumpStackMsg(stack, event);
619 FreezeJsonUtil::WriteKeyValue(jsonFd, "stack", jsonStack);
666 std::string stack;
670 stack = "";
672 GetNoJsonStack(stack, line, kernelStack, false);
674 oss << stack << std::endl;
683 std::string stack;
687 GetAppFreezeStack(jsonFd, event, stack, msg, kernelStack);
703 stack = event->GetEventValue("STACK");
704 HIVIEW_LOGI("Current stack is? stack:%{public}s", stack.c_str());
705 if (FileUtil::FileExists(stack)) {
706 stack = GetAppFreezeFile(stack);
709 GetNoJsonStack(tempStack, stack, kernelStack, false);
711 stack = tempStack;
713 GetFailedDumpStackMsg(stack, event);
718 if (!stack.empty()) {
719 oss << StringUtil::UnescapeJsonStringValue(stack) << std::endl;
729 void EventLogger::GetFailedDumpStackMsg(std::string& stack, std::shared_ptr<SysEvent> event)
732 if (dbHelper_ != nullptr && stack.size() >= failedStackStart.size() &&
733 !stack.compare(0, failedStackStart.size(), failedStackStart) &&
734 stack.find("syscall SIGDUMP error") != std::string::npos) {
749 stack += appendStack.empty() ? "\ncan not get process kill reason" : "\nprocess may be killed by : "