告警处理

Signed-off-by: zengxj <zengxiangjun8@h-partners.com>
Change-Id: I126ccb4b22d47bfcb2e479d59c9afd7613088eee
This commit is contained in:
zengxj 2024-10-12 15:15:09 +08:00
parent 3e666fa31e
commit c5f51f1ebc
2 changed files with 7 additions and 3 deletions

View File

@ -151,6 +151,8 @@ class EventParserCodeGenerator(FtraceEventCodeGenerator):
def generate_parse_functions(self, category, f):
count = 0
if category not in self.grouped_event_formats.keys():
return
for event in self.grouped_event_formats[category]:
count += 1
if count > 1:

View File

@ -122,14 +122,16 @@ private:
std::thread logSaver_;
};
#define HHLOG(level, expression, format, ...) { \
#define HHLOG(level, expression, format, ...) { \
if ((expression) and \
(!HHLogger::GetInstance().IsStopped()) and \
(HHLogger::GetInstance().GetLogLevel() <= HHLOG_##level)) { \
const char prefix[] {" [" #level "] %s %d %s: %s"}; \
char buffer[HHLogger::MAX_FORMAT_SIZE]; \
(void)snprintf_s(buffer, sizeof(buffer), sizeof(buffer) -1, \
prefix, __FILE__, __LINE__, __FUNCTION__, format); \
if (snprintf_s(buffer, sizeof(buffer), sizeof(buffer) -1, \
prefix, __FILE__, __LINE__, __FUNCTION__, format) < 0) { \
HHLogger::GetInstance().PutLog("snprintf_s error!"); \
} \
HHLogger::GetInstance().PutLog(buffer, ##__VA_ARGS__); \
} \
}