START_WATC

This commit is contained in:
zy
2023-11-27 21:01:02 -05:00
parent 3fc08d6b18
commit fd459340a7
2 changed files with 14 additions and 14 deletions

View File

@@ -1,22 +1,22 @@
#ifndef UAPI_MONITOR_SW_H
#define UAPI_MONITOR_SW_H
//!todo SWATCH_CHAR
#define SWATCH_CHAR(name, ptr, threshold) \
//!todo START_WATCH_CHAR
#define START_WATCH_CHAR(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(char), threshold, 0, 1, 0); \
start_watch(w_arg); \
} while (0)
#define SWATCH_CHAR_LESS(name, ptr, threshold) \
#define START_WATCH_CHAR_LESS(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(char), threshold, 0, 0, 0); \
start_watch(w_arg); \
} while (0)
#define SWATCH_UCHAR(name, ptr, threshold) \
#define START_WATCH_UCHAR(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(unsigned char), threshold, 1, 1, \
@@ -24,7 +24,7 @@
start_watch(w_arg); \
} while (0)
#define SWATCH_UCHAR_LESS(name, ptr, threshold) \
#define START_WATCH_UCHAR_LESS(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(unsigned char), threshold, 1, 0, \
@@ -32,21 +32,21 @@
start_watch(w_arg); \
} while (0)
#define SWATCH_INT(name, ptr, threshold) \
#define START_WATCH_INT(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(int), threshold, 0, 1, 0); \
start_watch(w_arg); \
} while (0)
#define SWATCH_INT_LESS(name, ptr, threshold) \
#define START_WATCH_INT_LESS(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(int), threshold, 0, 0, 0); \
start_watch(w_arg); \
} while (0)
#define SWATCH_UINT(name, ptr, threshold) \
#define START_WATCH_UINT(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(unsigned int), threshold, 1, 1, \
@@ -54,7 +54,7 @@
start_watch(w_arg); \
} while (0)
#define SWATCH_UINT_LESS(name, ptr, threshold) \
#define START_WATCH_UINT_LESS(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(unsigned int), threshold, 1, 0, \
@@ -62,21 +62,21 @@
start_watch(w_arg); \
} while (0)
#define SWATCH_LONG(name, ptr, threshold) \
#define START_WATCH_LONG(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(long), threshold, 0, 1, 0); \
start_watch(w_arg); \
} while (0)
#define SWATCH_LONG_LESS(name, ptr, threshold) \
#define START_WATCH_LONG_LESS(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(long), threshold, 0, 0, 0); \
start_watch(w_arg); \
} while (0)
#define SWATCH_ULONG(name, ptr, threshold) \
#define START_WATCH_ULONG(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(unsigned long), threshold, 1, 1, \
@@ -84,7 +84,7 @@
start_watch(w_arg); \
} while (0)
#define SWATCH_ULONG_LESS(name, ptr, threshold) \
#define START_WATCH_ULONG_LESS(name, ptr, threshold) \
do { \
watch_arg w_arg = {0}; \
init_watch_arg(&w_arg, name, ptr, sizeof(unsigned long), threshold, 1, 0, \

View File

@@ -20,7 +20,7 @@ int main() {
// 拷贝字符串
strncpy(watch_args[i].name, name, (MAX_NAME_LEN + 1));
SWATCH_INT(name, &temps[i], (110 + i));
START_WATCH_INT(name, &temps[i], (110 + i));
}
while (temps[NUM_VARS - 1] < 205) {