summaryrefslogtreecommitdiff
path: root/source/uapi/monitor_user.h
blob: be178195afe6754b98e467d5a455111f94ae6286 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef UAPI_MONITOR_H
#define UAPI_MONITOR_H
// monitor_interface.h
#include "monitor_user_sw.h"
#include <string.h>
#include <sys/types.h>
#include <unistd.h>

#define MAX_NAME_LEN (127) // max name length

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 is_unsigned; // unsigned flag (true: unsigned, false: signed)
  unsigned char above_threshold;  // reverse flag (true: >, false: <)
  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 is_unsigned,
                    unsigned char above_threshold, unsigned long time_ns);

// start watch
int start_watch(watch_arg w_arg);

// cancel watch
int cancel_watch(void);

#endif