Signed-off-by: GlaryCastle <yangpeng190@huawei.com>

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
This commit is contained in:
GlaryCastle
2022-07-07 20:39:40 +08:00
parent 2cdd5d4f67
commit 2588889ce0
4 changed files with 14 additions and 6 deletions
+9 -1
View File
@@ -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<std::string> &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<std::string> &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
+1 -1
View File
@@ -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)
+1
View File
@@ -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);
+3 -4
View File
@@ -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<std::u16string> &args)
{
IMSA_HILOGI("InputMethodSystemAbility::Dump");
std::vector<std::string> 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;
}