gitignore ctags file
[lttngtop.git] / src / lttngtoptypes.h
1 /*
2 * Copyright (C) 2011 Julien Desfossez
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16 * MA 02111-1307, USA.
17 */
18
19 #ifndef LTTNGTOPTYPES_H
20 #define LTTNGTOPTYPES_H
21
22 #include <glib.h>
23
24 struct lttngtop {
25 GPtrArray *process_table; /* struct processtop */
26 GPtrArray *files_table; /* struct files */
27 GPtrArray *cpu_table; /* struct cputime */
28 GHashTable *perf_list; /* struct perfcounter */
29 unsigned long start;
30 unsigned long end;
31 unsigned int nbproc;
32 unsigned int nbnewproc;
33 unsigned int nbdeadproc;
34 unsigned int nbthreads;
35 unsigned int nbnewthreads;
36 unsigned int nbdeadthreads;
37 unsigned int nbfiles;
38 unsigned int nbnewfiles;
39 unsigned int nbclosedfiles;
40 } lttngtop;
41
42 struct processtop {
43 unsigned int puuid;
44 int pid;
45 char *comm;
46 int tid;
47 int ppid;
48 int oldpid;
49 int oldtid;
50 int oldppid;
51 unsigned long birth;
52 unsigned long death;
53 unsigned long lastactivity;
54 /* Files managing */
55 GPtrArray *process_files_table;
56 struct file_history *files_history;
57 GPtrArray *threads;
58 GHashTable *perf;
59 struct processtop *threadparent;
60 /* IO calculting */
61 unsigned long totalfileread;
62 unsigned long totalfilewrite;
63 unsigned long fileread;
64 unsigned long filewrite;
65 struct syscalls *syscall_info;
66 unsigned long totalcpunsec;
67 unsigned long threadstotalcpunsec;
68 };
69
70 struct perfcounter
71 {
72 unsigned long count;
73 int visible;
74 int sort;
75 };
76
77 struct cputime {
78 guint id;
79 struct processtop *current_task;
80 unsigned long task_start;
81 GHashTable *perf;
82 };
83
84 /*
85 * used for "relative seeks" (with fd, for example fs.lseek)
86 * and for "absolute seeks" (events occuring on a device without
87 * any link to a particular process)
88 */
89 struct seeks {
90 unsigned long offset;
91 unsigned long count;
92 };
93
94 struct ioctls {
95 unsigned int command;
96 unsigned long count;
97 };
98
99 struct files {
100 struct processtop *ref;
101 unsigned int fuuid;
102 int fd;
103 char *name;
104 int oldfd;
105 int device;
106 int openmode;
107 unsigned long openedat;
108 unsigned long closedat;
109 unsigned long lastaccess;
110 unsigned long read;
111 unsigned long write;
112 unsigned long nbpoll;
113 unsigned long nbselect;
114 unsigned long nbopen;
115 unsigned long nbclose;
116 //struct *seeks; /* relative seeks inside the file */
117 //struct *ioctls;
118 /* XXX : average wait time */
119 };
120
121 struct file_history {
122 struct files *file;
123 struct file_history *next;
124 };
125
126 struct sockets {
127 int fd;
128 int parent_fd; /* on accept a new fd is created from the bound socket */
129 int family;
130 int type;
131 int protocol;
132 int sock_address;
133 unsigned long openedat;
134 unsigned long closedat;
135 unsigned long bind_address;
136 unsigned long remote_address;
137 //struct *sock_options;
138 };
139
140 struct sock_options {
141 int name;
142 int value;
143 };
144
145 struct vmas {
146 unsigned long start;
147 unsigned long end;
148 unsigned long flags;
149 unsigned long prot;
150 char *description; /* filename or description if possible (stack, heap) */
151 unsigned long page_faults;
152 };
153
154 struct syscalls {
155 unsigned int id;
156 unsigned long count;
157 unsigned int cpu_id;
158 unsigned int type;
159 unsigned int tid;
160 unsigned int fd;
161 };
162
163 struct signals {
164 int dest_pid;
165 int id;
166 unsigned long count;
167 };
168
169 struct file_info {
170 struct file_info *next;
171 char *name;
172 int fd;
173 int status;
174 };
175
176 #endif /* LTTNGTOPTYPES_H */
This page took 0.031804 seconds and 4 git commands to generate.