diff --git a/bundle.json b/bundle.json index b43c8c64be30faec829f5315552b33631793ea72..8deb812fb4fe4db4a302cbec67b4bc67c7595c60 100644 --- a/bundle.json +++ b/bundle.json @@ -33,7 +33,8 @@ "rom": "296KB", "ram": "13125KB", "hisysevent_config": [ - "//base/startup/appspawn/hisysevent.yaml" + "//base/startup/appspawn/hisysevent.yaml", + "//base/startup/appspawn/startup_events.yaml" ], "deps": { "components": [ diff --git a/hisysevent.yaml b/hisysevent.yaml index 7c5e078e8a4b339a9dc68131b0a640337d3a3c8a..10df09ac4c3c8e1f24ba15ab58a54c1045032d8a 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -13,13 +13,6 @@ domain: APPSPAWN -PROCESS_EXIT: - __BASE: {type: BEHAVIOR, level: CRITICAL, tag: Stability, desc: process exit reason} - PROCESS_NAME: {type: STRING, desc: process name} - PID: {type: UINT32, desc: process id} - UID: {type: UINT32, desc: user id} - STATUS: {type: INT32, desc: exit code or signal number} - SPAWN_CHILD_PROCESS_FAIL: __BASE: {type: FAULT, level: CRITICAL, desc: Spawn Child Process Fail} PROCESS_NAME: {type: STRING, desc: Process Name} diff --git a/modules/sysevent/event_reporter.cpp b/modules/sysevent/event_reporter.cpp index c70ace7ab1354bc6a82c7a359c6501c6518d143b..5a22925a7c5b6368bcf87e1cd147116786fa3dd1 100644 --- a/modules/sysevent/event_reporter.cpp +++ b/modules/sysevent/event_reporter.cpp @@ -45,7 +45,7 @@ void ProcessMgrRemoveApp(const char* processName, int pid, int uid, int status) } if (signal != 0) { - int ret = HiSysEventWrite(HiSysEvent::Domain::APPSPAWN, KEY_PROCESS_EXIT, HiSysEvent::EventType::BEHAVIOR, + int ret = HiSysEventWrite(HiSysEvent::Domain::STARTUP, KEY_PROCESS_EXIT, HiSysEvent::EventType::BEHAVIOR, KEY_NAME, pname, KEY_PID, pid, KEY_UID, uid, KEY_STATUS, status); if (ret != 0) { APPSPAWN_LOGE("ProcessMgrRemoveApp error, ret: %{public}d", ret); diff --git a/startup_events.yaml b/startup_events.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4bf186289f4303624350b90cf128d98d3de4bdb0 --- /dev/null +++ b/startup_events.yaml @@ -0,0 +1,21 @@ +# Copyright (c) 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +domain: STARTUP + +PROCESS_EXIT: + __BASE: {type: BEHAVIOR, level: CRITICAL, tag: Stability, desc: process exit reason} + PROCESS_NAME: {type: STRING, desc: process name} + PID: {type: UINT32, desc: process id} + UID: {type: UINT32, desc: user id} + STATUS: {type: INT32, desc: exit code or signal number}