From fd459340a717933b5124f686f3c4f2ca0d3f32dc Mon Sep 17 00:00:00 2001 From: zy Date: Mon, 27 Nov 2023 21:01:02 -0500 Subject: [PATCH] START_WATC --- source/uapi/monitor_user_sw.h | 26 +++++++++++++------------- testcase/helloworld.c | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/source/uapi/monitor_user_sw.h b/source/uapi/monitor_user_sw.h index 9e12e71..78ca2a0 100644 --- a/source/uapi/monitor_user_sw.h +++ b/source/uapi/monitor_user_sw.h @@ -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, \ diff --git a/testcase/helloworld.c b/testcase/helloworld.c index 55ebc73..54b0138 100644 --- a/testcase/helloworld.c +++ b/testcase/helloworld.c @@ -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) {