!162 miscservices_inputmethod dfx bugfix

Merge pull request !162 from GlaryCastle/master
This commit is contained in:
openharmony_ci
2022-07-08 03:51:03 +00:00
committed by Gitee
4 changed files with 11 additions and 6 deletions
+7 -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;
}
+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);
+2 -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,12 @@ 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;
}
InputmethodDump::GetInstance().Dump(fd, argsStr);
return ERR_OK;
}