From 2588889ce057b194e0b0afa8316a8caf32b18c87 Mon Sep 17 00:00:00 2001 From: GlaryCastle Date: Thu, 7 Jul 2022 20:39:40 +0800 Subject: [PATCH] Signed-off-by: GlaryCastle Changes to be committed: modified: services/dfx/src/inputmethod_dump.cpp modified: services/dfx/src/inputmethod_sysevent.cpp modified: services/dfx/src/inputmethod_trace.cpp modified: services/src/input_method_system_ability.cpp --- services/dfx/src/inputmethod_dump.cpp | 10 +++++++++- services/dfx/src/inputmethod_sysevent.cpp | 2 +- services/dfx/src/inputmethod_trace.cpp | 1 + services/src/input_method_system_ability.cpp | 7 +++---- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/services/dfx/src/inputmethod_dump.cpp b/services/dfx/src/inputmethod_dump.cpp index 4b68678..93bdbfe 100644 --- a/services/dfx/src/inputmethod_dump.cpp +++ b/services/dfx/src/inputmethod_dump.cpp @@ -14,6 +14,7 @@ */ #include "inputmethod_dump.h" +#include "global.h" namespace OHOS { namespace MiscServices { @@ -45,10 +46,14 @@ void InputmethodDump::AddErrorInfo(const std::string &error) bool InputmethodDump::Dump(int fd, const std::vector &args) { + IMSA_HILOGI("InputmethodDump::Dump start."); std::string command = ""; if (args.size() == CMD_ONE_PARAM) { command = args.at(SUB_CMD_NAME); - } else if (command == CMD_HELP) { + } else { + ShowIllealInfomation(fd); + } + if (command == CMD_HELP) { ShowHelp(fd); } else if (command == CMD_ALL_DUMP) { if (!dumpAllMethod_) { @@ -58,6 +63,7 @@ bool InputmethodDump::Dump(int fd, const std::vector &args) } else { ShowIllealInfomation(fd); } + IMSA_HILOGI("InputmethodDump::Dump command=%{public}s.", command.c_str()); return true; } @@ -73,7 +79,9 @@ void InputmethodDump::ShowHelp(int fd) void InputmethodDump::ShowIllealInfomation(int fd) { + IMSA_HILOGI("InputmethodDump::ShowIllealInfomation start."); dprintf(fd, "%s\n", illegalInfo.c_str()); + IMSA_HILOGI("InputmethodDump::ShowIllealInfomation end."); } } // namespace MiscServices } // namespace OHOS \ No newline at end of file diff --git a/services/dfx/src/inputmethod_sysevent.cpp b/services/dfx/src/inputmethod_sysevent.cpp index 29a37ee..4da6688 100644 --- a/services/dfx/src/inputmethod_sysevent.cpp +++ b/services/dfx/src/inputmethod_sysevent.cpp @@ -21,7 +21,7 @@ namespace OHOS { namespace MiscServices { namespace { using HiSysEventNameSpace = OHOS::HiviewDFX::HiSysEvent; -const std::string DOMAIN_STR = std::string(HiSysEventNameSpace::Domain::OTHERS); +const std::string DOMAIN_STR = std::string(HiSysEventNameSpace::Domain::INPUTMETHOD); } // namespace void FaultReporter(int32_t userId, std::string bundname, int32_t errCode) diff --git a/services/dfx/src/inputmethod_trace.cpp b/services/dfx/src/inputmethod_trace.cpp index 0408bbb..f9a8b46 100644 --- a/services/dfx/src/inputmethod_trace.cpp +++ b/services/dfx/src/inputmethod_trace.cpp @@ -27,6 +27,7 @@ void ValueTrace(const std::string &name, int64_t count) { CountTrace(HITRACE_TAG_MISC, name, count); } + InputmethodTrace::InputmethodTrace(const std::string &value) { StartTrace(HITRACE_TAG_MISC, value); diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index b97abc7..126d6ef 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -122,7 +122,6 @@ namespace MiscServices { } InitHiTrace(); InputmethodTrace tracer("InputMethodController Attach trace."); - ValueTrace("InputMethodController", -1); InputmethodDump::GetInstance().AddDumpAllMethod( std::bind(&InputMethodSystemAbility::DumpAllMethod, this, std::placeholders::_1)); IMSA_HILOGI("Start ImsaService ErrorCode::NO_ERROR."); @@ -131,13 +130,13 @@ namespace MiscServices { int InputMethodSystemAbility::Dump(int fd, const std::vector &args) { + IMSA_HILOGI("InputMethodSystemAbility::Dump"); std::vector argsStr; for (auto item : args) { argsStr.emplace_back(Str16ToStr8(item)); } - if (InputmethodDump::GetInstance().Dump(fd, argsStr)) { - return ERR_OK; - } + IMSA_HILOGI("InputMethodSystemAbility::InputmethodDump::Dump"); + InputmethodDump::GetInstance().Dump(fd, argsStr); return ERR_OK; }