aboutsummaryrefslogtreecommitdiff
path: root/include/linux/taskstats.h
blob: 5017026d299ed1df6c41acd8039d4fe99ec60b80 (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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* taskstats.h - exporting per-task statistics
 *
 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
 *           (C) Balbir Singh,   IBM Corp. 2006
 *           (C) Jay Lan,        SGI, 2006
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2.1 of the GNU Lesser General Public License
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it would be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef _LINUX_TASKSTATS_H
#define _LINUX_TASKSTATS_H

#include <linux/types.h>



#define TASKSTATS_VERSION	8
#define TS_COMM_LEN		32	

struct taskstats {

	__u16	version;
	__u32	ac_exitcode;		

	__u8	ac_flag;		
	__u8	ac_nice;		


	__u64	cpu_count __attribute__((aligned(8)));
	__u64	cpu_delay_total;

	

	__u64	blkio_count;
	__u64	blkio_delay_total;

	
	__u64	swapin_count;
	__u64	swapin_delay_total;

	__u64	cpu_run_real_total;

	__u64	cpu_run_virtual_total;
	
	

	
	char	ac_comm[TS_COMM_LEN];	
	__u8	ac_sched __attribute__((aligned(8)));
					
	__u8	ac_pad[3];
	__u32	ac_uid __attribute__((aligned(8)));
					
	__u32	ac_gid;			
	__u32	ac_pid;			
	__u32	ac_ppid;		
	__u32	ac_btime;		
	__u64	ac_etime __attribute__((aligned(8)));
					
	__u64	ac_utime;		
	__u64	ac_stime;		
	__u64	ac_minflt;		
	__u64	ac_majflt;		
	

	
	__u64	coremem;		
	__u64	virtmem;		

	__u64	hiwater_rss;		
	__u64	hiwater_vm;		

	
	__u64	read_char;		
	__u64	write_char;		/* bytes written */
	__u64	read_syscalls;		
	__u64	write_syscalls;		
	

#define TASKSTATS_HAS_IO_ACCOUNTING
	
	__u64	read_bytes;		
	__u64	write_bytes;		
	__u64	cancelled_write_bytes;	

	__u64  nvcsw;			
	__u64  nivcsw;			

	
	__u64	ac_utimescaled;		
	__u64	ac_stimescaled;		
	__u64	cpu_scaled_run_real_total; 

	
	__u64	freepages_count;
	__u64	freepages_delay_total;
};



enum {
	TASKSTATS_CMD_UNSPEC = 0,	
	TASKSTATS_CMD_GET,		
	TASKSTATS_CMD_NEW,		
	__TASKSTATS_CMD_MAX,
};

#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)

enum {
	TASKSTATS_TYPE_UNSPEC = 0,	
	TASKSTATS_TYPE_PID,		
	TASKSTATS_TYPE_TGID,		
	TASKSTATS_TYPE_STATS,		
	TASKSTATS_TYPE_AGGR_PID,	
	TASKSTATS_TYPE_AGGR_TGID,	
	TASKSTATS_TYPE_NULL,		
	__TASKSTATS_TYPE_MAX,
};

#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)

enum {
	TASKSTATS_CMD_ATTR_UNSPEC = 0,
	TASKSTATS_CMD_ATTR_PID,
	TASKSTATS_CMD_ATTR_TGID,
	TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
	TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
	__TASKSTATS_CMD_ATTR_MAX,
};

#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)


#define TASKSTATS_GENL_NAME	"TASKSTATS"
#define TASKSTATS_GENL_VERSION	0x1

#endif