!590 Alarm cleaning and fix hitrace tool parsing

Merge pull request !590 from Federer-JC/master
This commit is contained in:
openharmony_ci 2024-09-24 02:55:09 +00:00 committed by Gitee
commit 5d9b6fad1b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 3 deletions

View File

@ -452,7 +452,7 @@ def parse_smbus_result(data, one_event):
protocol_map = {0: "QUICK", 1: "BYTE", 2: "BYTE_DATA", 3: "WORD_DATA", \
4: "PROC_CALL", 5: "BLOCK_DATA", 6: "I2C_BLOCK_BROKEN", 7: "BLOCK_PROC_CALL", 8: "I2C_BLOCK_DATA"}
read_write = "wr" if read_write_value == 0 else "rd"
read_write = "wr" if read_write_value == 0 else "rd"
return "i2c-%d a=%03x f=%04x c=%x %s %s res=%d" \
% (adapter_nr, addr, flags, command, protocol_map.get(protocol, ''), read_write, res)

View File

@ -179,7 +179,7 @@ void DelOldRecordTraceFile(const int& fileLimit)
}
size_t deleteNum = fileList.size() - traceFileLimit;
for (int i = 0; i < deleteNum; ++i) {
for (size_t i = 0; i < deleteNum; ++i) {
if (remove((TRACE_DEFAULT_DIR + fileList[i].filename).c_str()) == 0) {
HILOG_INFO(LOG_CORE, "DelOldRecordTraceFile: delete first: %{public}s success.",
fileList[i].filename.c_str());
@ -192,7 +192,7 @@ void DelOldRecordTraceFile(const int& fileLimit)
void ClearOldTraceFile(std::vector<std::string>& fileLists, const int& fileLimit)
{
if (fileLists.size() <= 0) {
if (fileLists.size() == 0) {
return;
}