File: rawlog.h

package info (click to toggle)
atop 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,328 kB
  • sloc: ansic: 35,620; python: 257; sh: 248; makefile: 193
file content (107 lines) | stat: -rw-r--r-- 4,778 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
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
/*
** ATOP - System & Process Monitor
**
** The program 'atop' offers the possibility to view the activity of 
** the system on system-level as well as process-level.
** ==========================================================================
** Author:      Gerlof Langeveld
** E-mail:      gerlof.langeveld@atoptool.nl
** Date:        September 2002
** --------------------------------------------------------------------------
** Copyright (C) 2000-2010 Gerlof Langeveld
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
** Free Software Foundation; either version 2, or (at your option) any
** later version.
**
** This program is distributed in the hope that it will be useful, but
** WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
** --------------------------------------------------------------------------
*/

#ifndef __RAWLOG__
#define __RAWLOG__

/*
** structure describing the raw file contents
**
** layout raw file:    rawheader
**
**                     rawrecord                                       \
**                     compressed system-level statistics               |
**                     compressed process-level statistics              | sample 1
**                     compressed cgroupv2-level statistics (optional)  |
**                     compressed cgroupv2 pidlist          (optional) /
**
**                     rawrecord                                       \
**                     compressed system-level statistics               |
**                     compressed process-level statistics              | sample 2
**                     compressed cgroupv2-level statistics (optional)  |
**                     compressed cgroupv2 pidlist          (optional) /
**
** etcetera .....
*/
#define	MYMAGIC		(unsigned int) 0xfeedbeef
#define READAHEADOFF	22
#define READAHEADSIZE	(1 << READAHEADOFF)

struct rawheader {
	unsigned int	magic;

	unsigned short	aversion;	/* creator atop version with MSB */
	unsigned short	future1;	/* can be reused 		 */
	unsigned short	future2;	/* can be reused 		 */
	unsigned short	rawheadlen;	/* length of struct rawheader    */
	unsigned short	rawreclen;	/* length of struct rawrecord    */
	unsigned short	hertz;		/* clock interrupts per second   */
	unsigned short	pidwidth;	/* number of digits for PID/TID  */
	unsigned short	sfuture[5];	/* future use                    */
	unsigned int	sstatlen;	/* length of struct sstat        */
	unsigned int	tstatlen;	/* length of struct tstat        */
	struct utsname	utsname;	/* info about this system        */
	char		cfuture[8];	/* future use                    */

	unsigned int	pagesize;	/* size of memory page (bytes)   */
	int		supportflags;  	/* used features                 */
	int		osrel;		/* OS release number             */
	int		osvers;		/* OS version number             */
	int		ossub;		/* OS version subnumber          */
	int		cstatlen;	/* length of struct cstat        */
	int		ifuture[5];	/* future use                    */
};

struct rawrecord {
	time_t		curtime;	/* current time (epoch)         */

	unsigned short	flags;		/* various flags                */
	unsigned short	ncgroups;	/* number of cgroups 		*/
	unsigned short	sfuture[2];	/* future use                   */

	unsigned int	scomplen;	/* length of compressed sstat   */
	unsigned int	pcomplen;	/* length of compressed tstat's */
	unsigned int	interval;	/* interval (number of seconds) */
	unsigned int	ndeviat;	/* number of tasks in list      */
	unsigned int	nactproc;	/* number of processes in list  */
	unsigned int	ntask;		/* total number of tasks        */
	unsigned int    totproc;	/* total number of processes	*/
	unsigned int    totrun;		/* number of running  threads	*/
	unsigned int    totslpi;	/* number of sleeping threads(S)*/
	unsigned int    totslpu;	/* number of sleeping threads(D)*/
	unsigned int	totzomb;	/* number of zombie processes   */
	unsigned int	nexit;		/* number of exited processes   */
	unsigned int	noverflow;	/* number of overflow processes */
	unsigned int    totidle;	/* number of idle     threads(I)*/
	unsigned int	ccomplen;	/* length of compressed cstats  */
	unsigned int	coriglen;	/* length of original   cstats	*/
	unsigned int	ncgpids;	/* number of cgroups pidlist 	*/
	unsigned int	icomplen;	/* length of compressed pidlist */
	unsigned int	ifuture;	/* future use                   */
};
#endif