Home
last modified time | relevance | path

Searched refs:sysEvent (Results 1 – 25 of 68) sorted by relevance

123

/base/hiviewdfx/hiview/plugins/eventlogger/test/unittest/common/
Devent_logger_test.cpp54 std::shared_ptr<SysEvent> sysEvent = std::make_shared<SysEvent>("EventLoggerTest_001", variable
56 sysEvent->SetEventValue("PACKAGE_NAME", "");
57 sysEvent->SetEventValue("MODULE_NAME", "");
58 EXPECT_EQ(eventLogger->IsHandleAppfreeze(sysEvent), true);
59 sysEvent->SetEventValue("PACKAGE_NAME", "EventLoggerTest");
60 EXPECT_EQ(eventLogger->IsHandleAppfreeze(sysEvent), true);
61 sysEvent->SetEventValue("PID", 0);
62 sysEvent->SetEventValue("eventLog_action", "");
63 std::shared_ptr<OHOS::HiviewDFX::Event> event = std::static_pointer_cast<Event>(sysEvent);
77 std::shared_ptr<SysEvent> sysEvent = std::make_shared<SysEvent>(testName, variable
[all …]
/base/hiviewdfx/hiview/base/test/unittest/common/
Dsys_event_test.cpp110 … std::shared_ptr<SysEvent> sysEvent = std::make_shared<SysEvent>("test", nullptr, sysEventCreator); variable
113 …std::cout << "size=" << sysEvent->AsJsonStr().size() << ", jsonStr:" << sysEvent->AsJsonStr() << s…
115 auto eventJsonStr = sysEvent->AsJsonStr();
135 … std::shared_ptr<SysEvent> sysEvent = std::make_shared<SysEvent>("test", nullptr, sysEventCreator); variable
138 …std::cout << "size=" << sysEvent->AsJsonStr().size() << ", jsonStr:" << sysEvent->AsJsonStr() << s…
140 auto eventJsonStr = sysEvent->AsJsonStr();
168 auto sysEvent = std::make_shared<SysEvent>("SysEventSource", nullptr, jsonStr); variable
169 ASSERT_TRUE(sysEvent != nullptr);
170 int64_t dest = sysEvent->GetEventIntValue("INT_VAL1");
172 dest = sysEvent->GetEventIntValue("INT_VAL2");
[all …]
/base/hiviewdfx/hiview/plugins/sys_dispatcher/
Dsys_dispatcher.cpp45 void SysEventDispatcher::DispatchEvent(std::shared_ptr<SysEvent>& sysEvent) in DispatchEvent() argument
47 …auto dispatchList = GetHiviewContext()->GetDisPatcherInfo(sysEvent->eventType_, sysEvent->eventNam… in DispatchEvent()
48 sysEvent->GetTag(), sysEvent->domain_); in DispatchEvent()
52 ptr->OnEventListeningCallback(*sysEvent); in DispatchEvent()
67 std::shared_ptr<SysEvent> sysEvent = Event::DownCastTo<SysEvent>(event); in Convert2SysEvent() local
68 if (sysEvent == nullptr) { in Convert2SysEvent()
71 return sysEvent; in Convert2SysEvent()
76 auto sysEvent = Convert2SysEvent(event); in OnEvent() local
77 DispatchEvent(sysEvent); in OnEvent()
78 SysEventServiceAdapter::OnSysEvent(sysEvent); in OnEvent()
/base/hiviewdfx/hiview/plugins/freeze_detector/test/unittest/common/
Dfreeze_detector_test.cpp51 auto sysEvent = std::make_shared<SysEvent>(name, nullptr, jsonStr); in makeEvent() local
52 sysEvent->SetEventValue("name_", eventName); in makeEvent()
53 sysEvent->SetEventValue("type_", 1); in makeEvent()
54 sysEvent->SetEventValue("time_", time); in makeEvent()
55 sysEvent->SetEventValue("pid_", getpid()); in makeEvent()
56 sysEvent->SetEventValue("tid_", gettid()); in makeEvent()
57 sysEvent->SetEventValue("uid_", getuid()); in makeEvent()
58 sysEvent->SetEventValue("tz_", TimeUtil::GetTimeZone()); in makeEvent()
59 sysEvent->SetEventValue("PID", getpid()); in makeEvent()
60 sysEvent->SetEventValue("UID", getuid()); in makeEvent()
[all …]
/base/hiviewdfx/hiview/plugins/reliability/bbox_detectors/test/moduletest/
Dbbox_detector_module_test.cpp62 auto sysEvent = make_shared<SysEvent>("test", nullptr, sysEventCreator); variable
64 shared_ptr<Event> event = dynamic_pointer_cast<Event>(sysEvent);
67 ASSERT_EQ(sysEvent->GetEventValue("MODULE"), "AP");
68 ASSERT_EQ(sysEvent->GetEventValue("REASON"), "AP_S_PANIC");
69 ASSERT_EQ(sysEvent->GetEventValue("LOG_PATH"), "/data/hisi_logs/19700106031950-00001111");
97 auto sysEvent = make_shared<SysEvent>("test", nullptr, sysEventCreator); variable
99 shared_ptr<Event> event = dynamic_pointer_cast<Event>(sysEvent);
102 ASSERT_EQ(sysEvent->GetEventValue("MODULE"), "AP");
103 ASSERT_EQ(sysEvent->GetEventValue("REASON"), "AP_S_HWWATCHDOG");
104 ASSERT_EQ(sysEvent->GetEventValue("LOG_PATH"), "/data/hisi_logs/19700106031950-00001111");
[all …]
/base/hiviewdfx/hisysevent/test/moduletest/common/
Dhisysevent_wrote_result_check_test.cpp75 void OnEvent(std::shared_ptr<HiSysEventRecord> sysEvent) final in OnEvent() argument
77 if (sysEvent == nullptr || assertFunc_ == nullptr) { in OnEvent()
80 ASSERT_TRUE(assertFunc_(sysEvent)); in OnEvent()
165 for (auto sysEvent : *sysEvents) { in CompareEventQueryResultWithPattern()
166 std::string eventJsonStr = sysEvent.AsJson(); in CompareEventQueryResultWithPattern()
203 auto watcher = std::make_shared<Watcher>([val] (std::shared_ptr<HiSysEventRecord> sysEvent) { in __anon9d12b01b0202() argument
204 if (sysEvent == nullptr) { in __anon9d12b01b0202()
208 sysEvent->GetParamValue(PARAM_KEY, ret); in __anon9d12b01b0202()
227 auto watcher = std::make_shared<Watcher>([val] (std::shared_ptr<HiSysEventRecord> sysEvent) { in __anon9d12b01b0402() argument
228 if (sysEvent == nullptr) { in __anon9d12b01b0402()
[all …]
/base/hiviewdfx/hiview/plugins/sysevent_source/
Dsysevent_source.cpp113 std::shared_ptr<SysEvent> sysEvent = Convert2SysEvent(event); in CheckValidSysEvent() local
114 if (sysEvent == nullptr || sysEventParser_ == nullptr) { in CheckValidSysEvent()
119 if (!sysEventParser_->HandleEventJson(sysEvent)) { in CheckValidSysEvent()
120 sysEventStat_->AccumulateEvent(sysEvent->domain_, sysEvent->eventName_, false); in CheckValidSysEvent()
124 sysEvent->domain_.c_str(), sysEvent->eventName_.c_str(), sysEvent->GetEventSeq()); in CheckValidSysEvent()
125sysEvent->SetTag(sysEventParser_->GetTagByDomainAndName(sysEvent->domain_, sysEvent->eventName_)); in CheckValidSysEvent()
126sysEvent->eventType_ = sysEventParser_->GetTypeByDomainAndName(sysEvent->domain_, sysEvent->eventN… in CheckValidSysEvent()
127sysEvent->preserve_ = sysEventParser_->GetPreserveByDomainAndName(sysEvent->domain_, sysEvent->eve… in CheckValidSysEvent()
142 std::shared_ptr<SysEvent> sysEvent = Event::DownCastTo<SysEvent>(event); in Convert2SysEvent() local
143 if (sysEvent == nullptr) { in Convert2SysEvent()
[all …]
Dplatform_monitor.cpp243 std::shared_ptr<SysEvent> sysEvent = std::make_shared<SysEvent>("", nullptr, eventCreator); in CreateProfileReport() local
244 return sysEvent; in CreateProfileReport()
269 std::shared_ptr<SysEvent> sysEvent = CreateProfileReport(perfMeasure); in ReportCycleProfile() local
270 if (sysEvent == nullptr) { in ReportCycleProfile()
273 … HIVIEW_LOGI("report event[%{public}s|%{public}s|%{public}" PRIu64 "].", sysEvent->domain_.c_str(), in ReportCycleProfile()
274 sysEvent->eventName_.c_str(), sysEvent->GetEventUintValue("time_")); in ReportCycleProfile()
275 HiviewGlobal::GetInstance()->PostSyncEventToTarget(EVENT_SERVICE_PLUGIN, sysEvent); in ReportCycleProfile()
371 std::shared_ptr<SysEvent> sysEvent = std::make_shared<SysEvent>("", nullptr, eventCreator); in ReportBreakProfile() local
372 … HIVIEW_LOGI("report event[%{public}s|%{public}s|%{public}" PRIu64 "].", sysEvent->domain_.c_str(), in ReportBreakProfile()
373 sysEvent->eventName_.c_str(), sysEvent->GetEventUintValue("time_")); in ReportBreakProfile()
[all …]
/base/hiviewdfx/hiview/base/event_store/utility/writer/
Dsys_event_doc_writer.cpp61 int SysEventDocWriter::Write(const std::shared_ptr<SysEvent>& sysEvent) in Write() argument
63 if (sysEvent == nullptr) { in Write()
72 if (int ret = GetContentSize(sysEvent, contentSize); ret != DOC_STORE_SUCCESS) { in Write()
84 if (auto ret = WriteHeader(sysEvent, contentSize); ret != DOC_STORE_SUCCESS) { in Write()
87 return WriteContent(sysEvent, contentSize); in Write()
109 return WriteContent(sysEvent, contentSize); in Write()
136 int SysEventDocWriter::GetContentSize(const std::shared_ptr<SysEvent>& sysEvent, uint32_t& contentS… in GetContentSize() argument
138 if (sysEvent->AsRawData() == nullptr) { in GetContentSize()
142 uint32_t dataSize = *(reinterpret_cast<uint32_t*>(sysEvent->AsRawData())); in GetContentSize()
151 int SysEventDocWriter::WriteHeader(const std::shared_ptr<SysEvent>& sysEvent, uint32_t contentSize) in WriteHeader() argument
[all …]
/base/update/sys_installer/services/module_update/service/src/
Dcrash_sys_event_listener.cpp26 void CrashSysEventListener::OnEvent(std::shared_ptr<HiSysEventRecord> sysEvent) in OnEvent() argument
29 if (sysEvent == nullptr) { in OnEvent()
33 if (strcmp(sysEvent->GetDomain().c_str(), CRASH_DOMAIN) == 0 in OnEvent()
34 && strcmp(sysEvent->GetEventName().c_str(), CRASH_NAME) == 0 in OnEvent()
35 && sysEvent->GetEventType() == CRASH_TYPE) { in OnEvent()
37 int ret = sysEvent->GetParamValue(PROCESS_NAME_KEY, processName); in OnEvent()
/base/hiviewdfx/hiview/base/event_store/store/
Dsys_event_doc.cpp42 int SysEventDoc::Insert(const std::shared_ptr<SysEvent>& sysEvent) in Insert() argument
44 if (sysEvent == nullptr) { in Insert()
51 if (ret = InitWriter(sysEvent); ret != 0) { in Insert()
57 if (ret = writer_->Write(sysEvent); ret == DOC_STORE_NEW_FILE) { in Insert()
59 if (ret = CreateCurFile(GetDir(), sysEvent); ret != DOC_STORE_SUCCESS) { in Insert()
65 return writer_->Write(sysEvent); in Insert()
81 int SysEventDoc::InitWriter(const std::shared_ptr<SysEvent>& sysEvent) in InitWriter() argument
84 type_ = sysEvent->eventType_; in InitWriter()
85 level_ = sysEvent->GetLevel(); in InitWriter()
86 if (auto ret = UpdateCurFile(sysEvent); ret != 0) { in InitWriter()
[all …]
/base/hiviewdfx/hiview/base/event_store/utility/writer/include/
Dsys_event_doc_writer.h32 int Write(const std::shared_ptr<SysEvent>& sysEvent);
35 int WriteHeader(const std::shared_ptr<SysEvent>& sysEvent, uint32_t contentSize);
36 int WriteContent(const std::shared_ptr<SysEvent>& sysEvent, uint32_t contentSize);
37 …int BuildContent(const std::shared_ptr<SysEvent>& sysEvent, uint8_t** contentPtr, uint32_t content…
40 int GetContentSize(const std::shared_ptr<SysEvent>& sysEvent, uint32_t& contentSize);
/base/hiviewdfx/hiview/plugins/faultlogger/service/
Dfaultlog_database.cpp49 auto sysEvent = std::make_unique<SysEvent>("FaultLogDatabase", nullptr, rawData); in ParseFaultLogInfoFromJson() local
50 HIVIEW_LOGI("parse FaultLogInfo from %{public}s. 0", sysEvent->AsJsonStr().c_str()); in ParseFaultLogInfoFromJson()
52 info.time = static_cast<int64_t>(std::atoll(sysEvent->GetEventValue("HAPPEN_TIME").c_str())); in ParseFaultLogInfoFromJson()
54 info.time = sysEvent->GetEventIntValue("HAPPEN_TIME") != DEFAULT_INT_VALUE? in ParseFaultLogInfoFromJson()
55 sysEvent->GetEventIntValue("HAPPEN_TIME") : sysEvent->GetEventIntValue("time_"); in ParseFaultLogInfoFromJson()
57 info.pid = sysEvent->GetEventIntValue("PID") != DEFAULT_INT_VALUE? in ParseFaultLogInfoFromJson()
58 sysEvent->GetEventIntValue("PID") : sysEvent->GetEventIntValue("pid_"); in ParseFaultLogInfoFromJson()
60 info.id = sysEvent->GetEventIntValue("UID") != DEFAULT_INT_VALUE? in ParseFaultLogInfoFromJson()
61 sysEvent->GetEventIntValue("UID") : sysEvent->GetEventIntValue("uid_"); in ParseFaultLogInfoFromJson()
62 info.faultLogType = std::atoi(sysEvent->GetEventValue("FAULT_TYPE").c_str()); in ParseFaultLogInfoFromJson()
[all …]
Dfaultlogger.cpp368 auto sysEvent = std::static_pointer_cast<SysEvent>(event); in JudgmentRateLimiting() local
369 long pid = sysEvent->GetPid(); in JudgmentRateLimiting()
386 sysEvent->eventId_, sysEvent->eventName_.c_str(), eventPid.c_str(), interval); in JudgmentRateLimiting()
393 sysEvent->eventId_, sysEvent->eventName_.c_str(), eventPid.c_str(), interval); in JudgmentRateLimiting()
424 auto sysEvent = std::static_pointer_cast<SysEvent>(event); in OnEvent() local
426 sysEvent->AsJsonStr().c_str()); in OnEvent()
428 info.time = sysEvent->happenTime_; in OnEvent()
429 info.id = sysEvent->GetUid(); in OnEvent()
430 info.pid = sysEvent->GetPid(); in OnEvent()
432 …info.module = isJsError ? sysEvent->GetEventValue("PACKAGE_NAME") : sysEvent->GetEventValue("MODUL… in OnEvent()
[all …]
/base/hiviewdfx/hisysevent/frameworks/native/
Dhisysevent_tool_listener.cpp30 void HiSysEventToolListener::OnEvent(std::shared_ptr<HiSysEventRecord> sysEvent) in OnEvent() argument
32 if (sysEvent == nullptr) { in OnEvent()
36 std::cout << eventJsonDecorator->DecorateEventJsonStr(*sysEvent) << std::endl; in OnEvent()
39 std::cout << sysEvent->AsJson() << std::endl; in OnEvent()
/base/hiviewdfx/hiview/core/test/unittest/common/
Devent_json_parser_test.cpp55 std::shared_ptr<SysEvent> sysEvent = nullptr; variable
56 ASSERT_FALSE(sysEventParser->HandleEventJson(sysEvent));
59 sysEvent = std::make_shared<SysEvent>("SysEventService", nullptr, invalidJsonStr);
60 ASSERT_FALSE(sysEventParser->HandleEventJson(sysEvent));
63 sysEvent = std::make_shared<SysEvent>("SysEventService", nullptr, jsonStr);
65 ASSERT_TRUE(sysEventParser->HandleEventJson(sysEvent));
/base/hiviewdfx/hiview/plugins/event_store/
Dsys_event_store.cpp74 std::shared_ptr<SysEvent> sysEvent = Event::DownCastTo<SysEvent>(event); in Convert2SysEvent() local
75 if (sysEvent == nullptr) { in Convert2SysEvent()
78 return sysEvent; in Convert2SysEvent()
87 std::shared_ptr<SysEvent> sysEvent = Convert2SysEvent(event); in OnEvent() local
88 if (sysEvent->preserve_) { in OnEvent()
89 sysEventDbMgr_->SaveToStore(sysEvent); in OnEvent()
/base/hiviewdfx/faultloggerd/tools/crash_validator/
Dcrash_validator.cpp58 void CrashValidator::OnEvent(std::shared_ptr<HiviewDFX::HiSysEventRecord> sysEvent) in OnEvent() argument
61 auto domain = sysEvent->GetDomain(); in OnEvent()
62 auto eventName = sysEvent->GetEventName(); in OnEvent()
64 HandleCppCrashEvent(sysEvent); in OnEvent()
66 HandleProcessExitEvent(sysEvent); in OnEvent()
167 void CrashValidator::HandleCppCrashEvent(std::shared_ptr<HiviewDFX::HiSysEventRecord> sysEvent) in HandleCppCrashEvent() argument
171 sysEvent->GetParamValue(KEY_HAPPEN_TIME, crashEvent.time); in HandleCppCrashEvent()
172 sysEvent->GetParamValue(KEY_UID, crashEvent.uid); in HandleCppCrashEvent()
173 sysEvent->GetParamValue(KEY_PID, crashEvent.pid); in HandleCppCrashEvent()
174 sysEvent->GetParamValue(KEY_LOG_PATH, crashEvent.path); in HandleCppCrashEvent()
[all …]
/base/hiviewdfx/hiview/plugins/reliability/bbox_detectors/
Dbbox_detector_plugin.cpp74 auto sysEvent = Event::DownCastTo<SysEvent>(event); in OnEvent() local
75 HandleBBoxEvent(sysEvent); in OnEvent()
87 void BBoxDetectorPlugin::HandleBBoxEvent(std::shared_ptr<SysEvent> &sysEvent) in HandleBBoxEvent() argument
89 std::string event = sysEvent->GetEventValue("REASON"); in HandleBBoxEvent()
90 std::string module = sysEvent->GetEventValue("MODULE"); in HandleBBoxEvent()
91 std::string timeStr = sysEvent->GetEventValue("SUB_LOG_PATH"); in HandleBBoxEvent()
92 std::string LOG_PATH = sysEvent->GetEventValue("LOG_PATH"); in HandleBBoxEvent()
93 std::string name = sysEvent->GetEventValue("name_"); in HandleBBoxEvent()
105 sysEvent->SetEventValue("HAPPEN_TIME", happenTime_); in HandleBBoxEvent()
111 sysEvent->SetEventValue("FIRST_FRAME", eventInfos["FIRST_FRAME"].empty() ? "/" : in HandleBBoxEvent()
[all …]
/base/hiviewdfx/hiview/plugins/freeze_detector/
Dfreeze_detector_plugin.cpp106 SysEvent& sysEvent = static_cast<SysEvent&>(eventRef); in MakeWatchPoint() local
108 long seq = sysEvent.GetSeq(); in MakeWatchPoint()
109 long tid = sysEvent.GetTid(); in MakeWatchPoint()
110 long pid = sysEvent.GetEventIntValue(FreezeCommon::EVENT_PID); in MakeWatchPoint()
111 pid = pid ? pid : sysEvent.GetPid(); in MakeWatchPoint()
112 long uid = sysEvent.GetEventIntValue(FreezeCommon::EVENT_UID); in MakeWatchPoint()
113 uid = uid ? uid : sysEvent.GetUid(); in MakeWatchPoint()
114 std::string packageName = sysEvent.GetEventValue(FreezeCommon::EVENT_PACKAGE_NAME); in MakeWatchPoint()
115 std::string processName = sysEvent.GetEventValue(FreezeCommon::EVENT_PROCESS_NAME); in MakeWatchPoint()
116 std::string hiteaceTime = sysEvent.GetEventValue(FreezeCommon::HIREACE_TIME); in MakeWatchPoint()
[all …]
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/
Dhisysevent_listener_c.cpp31 void HiSysEventListenerC::OnEvent(std::shared_ptr<OHOS::HiviewDFX::HiSysEventRecord> sysEvent) in OnEvent() argument
33 if (onEvent_ == nullptr || sysEvent == nullptr) { in OnEvent()
38 HiSysEventRecordConvertor::ConvertRecord(*sysEvent, record); in OnEvent()
/base/hiviewdfx/hiview/base/event_store/store/include/
Dsys_event_doc.h36 int Insert(const std::shared_ptr<SysEvent>& sysEvent);
40 int InitWriter(const std::shared_ptr<SysEvent>& sysEvent);
48 int UpdateCurFile(const std::shared_ptr<SysEvent>& sysEvent);
49 int CreateCurFile(const std::string& dir, const std::shared_ptr<SysEvent>& sysEvent);
/base/hiviewdfx/hiview/plugins/eventlogger/
Devent_logger.cpp64 auto sysEvent = Event::DownCastTo<SysEvent>(event); in IsInterestedPipelineEvent() local
65 if (eventLoggerConfig_.find(sysEvent->eventName_) == eventLoggerConfig_.end()) { in IsInterestedPipelineEvent()
69 sysEvent->AsJsonStr().c_str()); in IsInterestedPipelineEvent()
71 EventLoggerConfig::EventLoggerConfigData& configOut = eventLoggerConfig_[sysEvent->eventName_]; in IsInterestedPipelineEvent()
72 sysEvent->eventName_ = configOut.name; in IsInterestedPipelineEvent()
73 sysEvent->SetValue("eventLog_action", configOut.action); in IsInterestedPipelineEvent()
74 sysEvent->SetValue("eventLog_interval", configOut.interval); in IsInterestedPipelineEvent()
85 auto sysEvent = Event::DownCastTo<SysEvent>(onEvent); in OnEvent() local
86 if (!IsHandleAppfreeze(sysEvent)) { in OnEvent()
90 long pid = sysEvent->GetEventIntValue("PID"); in OnEvent()
[all …]
/base/hiviewdfx/hiview/plugins/unified_collector/
Dunified_collector.cpp38 ProcessState GetProcessStateByEvent(const SysEvent& sysEvent) in GetProcessStateByEvent() argument
40 std::string eventName = sysEvent.GetEventName(); in GetProcessStateByEvent()
62 SysEvent& sysEvent = static_cast<SysEvent&>(const_cast<Event&>(event)); in OnEventListeningCallback() local
63 int32_t procId = sysEvent.GetEventIntValue("APP_PID"); in OnEventListeningCallback()
68 ProcessState procState = GetProcessStateByEvent(sysEvent); in OnEventListeningCallback()
/base/hiviewdfx/hisysevent/frameworks/native/c_wrapper/source/
Dhisysevent_rust_listener.cpp41 void HiSysEventRustListener::OnEvent(std::shared_ptr<OHOS::HiviewDFX::HiSysEventRecord> sysEvent) in OnEvent() argument
43 if (watcher_ == nullptr || sysEvent == nullptr) { in OnEvent()
48 HiSysEventRecordConvertor::ConvertRecord(*sysEvent, record); in OnEvent()

123