Add .gitignore file
[s390-tools.git] / mon_tools / mon_fsstatd.h
blobea27739e69cc2719355282c49fca3b1d6eee88c5
1 /*
2 * mon_fsstatd
3 * Author: Melissa Howland <melissa.howland@us.ibm.com>
5 * Copyright IBM Corp. 2006.
7 * Definitions used by mon_fsstatd.
8 */
11 #ifndef __mon_fsstatd_h__
12 #define __mon_fsstatd_h__
14 #include <getopt.h>
15 #include <linux/types.h>
16 #include <sys/ioctl.h>
17 #include "../include/zt_common.h"
19 /* mon_function values */
20 #define MONWRITE_START_INTERVAL 0x00 /* start interval recording */
21 #define MONWRITE_STOP_INTERVAL 0x01 /* stop interval or config recording */
23 #define MAX_REC_LEN 4010
24 #define MAX_NAMES_LEN 3900
25 #define MAX_NAME_LEN 1800
26 #define MAX_DIR_LEN 1800
27 #define MAX_TYPE_LEN 256
28 #define FSSTATD_APPLID 0x01
29 /* Assume usually lengths of name, dir and type <= 512 bytes total */
30 #define SMALL_MON_RECORD_LEN 602
31 #define LARGE_MON_RECORD_LEN 4010
33 struct monwrite_hdr {
34 unsigned char mon_function;
35 unsigned short applid;
36 unsigned char record_num;
37 unsigned short version;
38 unsigned short release;
39 unsigned short mod_level;
40 unsigned short datalen;
41 unsigned char hdrlen;
43 } __attribute__((packed));
45 struct fsstatd_hdr {
46 __u64 time_stamp;
47 __u16 fsstat_data_len;
48 __u16 fsstat_data_offset;
49 } __attribute__((packed));
51 struct fsstatd_data {
52 __u64 fs_bsize;
53 __u64 fs_frsize;
54 __u64 fs_blocks;
55 __u64 fs_bfree;
56 __u64 fs_bavail;
57 __u64 fs_files;
58 __u64 fs_ffree;
59 __u64 fs_favail;
60 __u64 fs_flag;
63 static struct option options[] = {
64 {"help", no_argument, NULL, 'h'},
65 {"version", no_argument, NULL, 'v'},
66 {"attach", no_argument, NULL, 'a'},
67 {"interval", required_argument, NULL, 'i'},
68 {NULL, 0, NULL, 0}
71 static const char opt_string[] = "+hvai:";
73 static const char help_text[] =
74 "mon_fsstatd: Daemon that writes file system utilization information\n"
75 "to the z/VM monitor stream.\n"
76 "\n"
77 "Usage: mon_fstatd [OPTIONS]\n"
78 "\n"
79 "Options:\n"
80 "-h, --help Print this help, then exit\n"
81 "-v, --version Print version information, then exit\n"
82 "-a, --attach Run in foreground\n"
83 "-i, --interval=<seconds> Sample interval\n";
84 #endif