From 6f8d2fc33fa3619d67c51ee12b869e922d783bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A8=8A=E6=99=AF=E4=B9=90?= Date: Sun, 27 Apr 2025 13:54:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9appspawn=20=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=80=80=E5=87=BA=E6=89=93=E7=82=B9=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 樊景乐 --- bundle.json | 3 ++- hisysevent.yaml | 7 ------- modules/sysevent/event_reporter.cpp | 2 +- startup_events.yaml | 21 +++++++++++++++++++++ 4 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 startup_events.yaml diff --git a/bundle.json b/bundle.json index b43c8c64..8deb812f 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 7c5e078e..10df09ac 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 c70ace7a..5a22925a 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 00000000..4bf18628 --- /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} -- Gitee