File: nfsiostat.h

package info (click to toggle)
sysstat 10.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,832 kB
  • sloc: ansic: 18,352; sh: 872; tcl: 736; makefile: 466
file content (57 lines) | stat: -rw-r--r-- 1,886 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * nfsiostat: Report NFS I/O statistics
 * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved
 * Written by Ivana Varekova <varekova@redhat.com>
 */

#ifndef _NFSIOSTAT_H
#define _NFSIOSTAT_H

#include "common.h"

#define NFSMOUNTSTATS  "/proc/self/mountstats"

/* I_: iostat - D_: Display - F_: Flag */
#define I_D_TIMESTAMP		0x001
#define I_D_KILOBYTES		0x002
#define I_D_MEGABYTES		0x004
#define I_D_ISO			0x008
#define I_D_HUMAN_READ		0x010
#define I_D_DEBUG		0x020

#define DISPLAY_TIMESTAMP(m)	(((m) & I_D_TIMESTAMP)     == I_D_TIMESTAMP)
#define DISPLAY_KILOBYTES(m)	(((m) & I_D_KILOBYTES)     == I_D_KILOBYTES)
#define DISPLAY_MEGABYTES(m)	(((m) & I_D_MEGABYTES)     == I_D_MEGABYTES)
#define DISPLAY_ISO(m)		(((m) & I_D_ISO)           == I_D_ISO)
#define DISPLAY_HUMAN_READ(m)	(((m) & I_D_HUMAN_READ)    == I_D_HUMAN_READ)
#define DISPLAY_DEBUG(m)	(((m) & I_D_DEBUG)         == I_D_DEBUG)

/* Environment variable */
#define ENV_POSIXLY_CORRECT	"POSIXLY_CORRECT"

/* Preallocation constats */
#define NR_NFS_PREALLOC	2

struct io_nfs_stats {
	unsigned long long rd_normal_bytes	__attribute__ ((aligned (8)));
	unsigned long long wr_normal_bytes	__attribute__ ((packed));
	unsigned long long rd_direct_bytes	__attribute__ ((packed));
	unsigned long long wr_direct_bytes	__attribute__ ((packed));
	unsigned long long rd_server_bytes	__attribute__ ((packed));
	unsigned long long wr_server_bytes	__attribute__ ((packed));
	unsigned long rpc_sends			__attribute__ ((packed));
	unsigned long nfs_rops			__attribute__ ((packed));
	unsigned long nfs_wops			__attribute__ ((packed));
};

#define IO_NFS_STATS_SIZE	(sizeof(struct io_nfs_stats))

struct io_hdr_stats {
	unsigned int active		__attribute__ ((aligned (4)));
	unsigned int used		__attribute__ ((packed));
	char name[MAX_NAME_LEN];
};

#define IO_HDR_STATS_SIZE	(sizeof(struct io_hdr_stats))

#endif  /* _NFSIOSTAT_H */