Add project status to readme
[lttngtop.git] / src / lttngtoptypes.h
1 /*
2 * Copyright (C) 2011-2012 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 along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #ifndef LTTNGTOPTYPES_H
19 #define LTTNGTOPTYPES_H
20
21 #include <glib.h>
22
23 struct lttngtop {
24 GHashTable *process_hash_table; /* struct processtop */
25 GPtrArray *process_table; /* struct processtop */
26 GPtrArray *files_table; /* struct files */
27 GPtrArray *cpu_table; /* struct cputime */
28 GPtrArray *kprobes_table; /* struct kprobes */
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 struct host *host;
47 int tid;
48 int ppid;
49 int vpid;
50 int vtid;
51 int vppid;
52 unsigned long birth;
53 unsigned long death;
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 struct syscall *current_syscall;
83 };
84
85 /*
86 * used for "relative seeks" (with fd, for example fs.lseek)
87 * and for "absolute seeks" (events occuring on a device without
88 * any link to a particular process)
89 */
90 struct seeks {
91 unsigned long offset;
92 unsigned long count;
93 };
94
95 struct ioctls {
96 unsigned int command;
97 unsigned long count;
98 };
99
100 struct files {
101 struct processtop *ref;
102 unsigned int fuuid;
103 int fd;
104 char *name;
105 int oldfd;
106 int device;
107 int openmode;
108 int flag;
109 unsigned long openedat;
110 unsigned long closedat;
111 unsigned long lastaccess;
112 unsigned long read;
113 unsigned long write;
114 unsigned long nbpoll;
115 unsigned long nbselect;
116 unsigned long nbopen;
117 unsigned long nbclose;
118 //struct *seeks; /* relative seeks inside the file */
119 //struct *ioctls;
120 /* XXX : average wait time */
121 };
122
123 struct file_history {
124 struct files *file;
125 struct file_history *next;
126 };
127
128 struct sockets {
129 int fd;
130 int parent_fd; /* on accept a new fd is created from the bound socket */
131 int family;
132 int type;
133 int protocol;
134 int sock_address;
135 unsigned long openedat;
136 unsigned long closedat;
137 unsigned long bind_address;
138 unsigned long remote_address;
139 //struct *sock_options;
140 };
141
142 struct sock_options {
143 int name;
144 int value;
145 };
146
147 struct vmas {
148 unsigned long start;
149 unsigned long end;
150 unsigned long flags;
151 unsigned long prot;
152 char *description; /* filename or description if possible (stack, heap) */
153 unsigned long page_faults;
154 };
155
156 struct syscall {
157 char *name;
158 unsigned long ts_start;
159 uint64_t cpu_id;
160 };
161
162 struct syscalls {
163 unsigned int id;
164 unsigned long count;
165 uint64_t cpu_id;
166 unsigned int type;
167 unsigned int tid;
168 unsigned int fd;
169 };
170
171 struct signals {
172 int dest_pid;
173 int id;
174 unsigned long count;
175 };
176
177 struct file_info {
178 struct file_info *next;
179 char *name;
180 int fd;
181 int status;
182 };
183
184 /* header for cputop display */
185 struct header_view {
186 char *title;
187 int visible;
188 int sort;
189 int reverse;
190 };
191
192 struct kprobes {
193 char *probe_name;
194 char *symbol_name;
195 int probe_addr;
196 int probe_offset;
197 int count;
198 };
199
200 struct host {
201 char *hostname;
202 int filter;
203 };
204
205 #endif /* LTTNGTOPTYPES_H */
This page took 0.032538 seconds and 4 git commands to generate.