683bc302e1b8980e9daec4e78b6f4899ad92ac60
[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 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 GPtrArray *process_table; /* struct processtop */
25 GPtrArray *files_table; /* struct files */
26 GPtrArray *cpu_table; /* struct cputime */
27 GHashTable *perf_list; /* struct perfcounter */
28 unsigned long start;
29 unsigned long end;
30 unsigned int nbproc;
31 unsigned int nbnewproc;
32 unsigned int nbdeadproc;
33 unsigned int nbthreads;
34 unsigned int nbnewthreads;
35 unsigned int nbdeadthreads;
36 unsigned int nbfiles;
37 unsigned int nbnewfiles;
38 unsigned int nbclosedfiles;
39 } lttngtop;
40
41 struct processtop {
42 unsigned int puuid;
43 int pid;
44 char *comm;
45 int tid;
46 int ppid;
47 int oldpid;
48 int oldtid;
49 int oldppid;
50 unsigned long birth;
51 unsigned long death;
52 unsigned long lastactivity;
53 /* Files managing */
54 GPtrArray *process_files_table;
55 struct file_history *files_history;
56 GPtrArray *threads;
57 GHashTable *perf;
58 struct processtop *threadparent;
59 /* IO calculting */
60 unsigned long totalfileread;
61 unsigned long totalfilewrite;
62 unsigned long fileread;
63 unsigned long filewrite;
64 struct syscalls *syscall_info;
65 unsigned long totalcpunsec;
66 unsigned long threadstotalcpunsec;
67 };
68
69 struct perfcounter
70 {
71 unsigned long count;
72 int visible;
73 int sort;
74 };
75
76 struct cputime {
77 guint id;
78 struct processtop *current_task;
79 unsigned long task_start;
80 GHashTable *perf;
81 };
82
83 /*
84 * used for "relative seeks" (with fd, for example fs.lseek)
85 * and for "absolute seeks" (events occuring on a device without
86 * any link to a particular process)
87 */
88 struct seeks {
89 unsigned long offset;
90 unsigned long count;
91 };
92
93 struct ioctls {
94 unsigned int command;
95 unsigned long count;
96 };
97
98 struct files {
99 struct processtop *ref;
100 unsigned int fuuid;
101 int fd;
102 char *name;
103 int oldfd;
104 int device;
105 int openmode;
106 unsigned long openedat;
107 unsigned long closedat;
108 unsigned long lastaccess;
109 unsigned long read;
110 unsigned long write;
111 unsigned long nbpoll;
112 unsigned long nbselect;
113 unsigned long nbopen;
114 unsigned long nbclose;
115 //struct *seeks; /* relative seeks inside the file */
116 //struct *ioctls;
117 /* XXX : average wait time */
118 };
119
120 struct file_history {
121 struct files *file;
122 struct file_history *next;
123 };
124
125 struct sockets {
126 int fd;
127 int parent_fd; /* on accept a new fd is created from the bound socket */
128 int family;
129 int type;
130 int protocol;
131 int sock_address;
132 unsigned long openedat;
133 unsigned long closedat;
134 unsigned long bind_address;
135 unsigned long remote_address;
136 //struct *sock_options;
137 };
138
139 struct sock_options {
140 int name;
141 int value;
142 };
143
144 struct vmas {
145 unsigned long start;
146 unsigned long end;
147 unsigned long flags;
148 unsigned long prot;
149 char *description; /* filename or description if possible (stack, heap) */
150 unsigned long page_faults;
151 };
152
153 struct syscalls {
154 unsigned int id;
155 unsigned long count;
156 uint64_t cpu_id;
157 unsigned int type;
158 unsigned int tid;
159 unsigned int fd;
160 };
161
162 struct signals {
163 int dest_pid;
164 int id;
165 unsigned long count;
166 };
167
168 struct file_info {
169 struct file_info *next;
170 char *name;
171 int fd;
172 int status;
173 };
174
175 #endif /* LTTNGTOPTYPES_H */
This page took 0.032321 seconds and 4 git commands to generate.