This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-variable-monitor/source/uapi/monitor_user.h

32 lines
992 B
C
Raw Normal View History

#ifndef UAPI_MONITOR_H
#define UAPI_MONITOR_H
2023-11-16 13:17:49 +08:00
// monitor_interface.h
#include "monitor_user_sw.h"
#include <string.h>
2023-11-16 13:17:49 +08:00
#include <sys/types.h>
#include <unistd.h>
2023-11-16 13:17:49 +08:00
#define MAX_NAME_LEN (15) // max name length
2023-11-16 13:17:49 +08:00
typedef struct {
pid_t task_id; // current process id
char name[MAX_NAME_LEN + 1]; // name
void *ptr; // virtual address
int length_byte; // byte
long long threshold; // threshold value
unsigned char unsigned_flag; // unsigned flag (true: unsigned, false: signed)
unsigned char above_threshold; // reverse flag (true: >, false: <)
2023-11-16 13:17:49 +08:00
unsigned long time_ns; // timer interval (ns)
} watch_arg;
void init_watch_arg(watch_arg *wg, char *name, void *ptr, int length_byte,
long long threshold, unsigned char unsigned_flag,
unsigned char above_threshold, unsigned long time_ns);
2023-11-16 13:17:49 +08:00
// start watch
int start_watch(watch_arg w_arg);
// cancel watch
int cancel_watch(void);
#endif