kprobe support
[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 char *hostname;
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 };
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 int flag;
108 unsigned long openedat;
109 unsigned long closedat;
110 unsigned long lastaccess;
111 unsigned long read;
112 unsigned long write;
113 unsigned long nbpoll;
114 unsigned long nbselect;
115 unsigned long nbopen;
116 unsigned long nbclose;
117 //struct *seeks; /* relative seeks inside the file */
118 //struct *ioctls;
119 /* XXX : average wait time */
120 };
121
122 struct file_history {
123 struct files *file;
124 struct file_history *next;
125 };
126
127 struct sockets {
128 int fd;
129 int parent_fd; /* on accept a new fd is created from the bound socket */
130 int family;
131 int type;
132 int protocol;
133 int sock_address;
134 unsigned long openedat;
135 unsigned long closedat;
136 unsigned long bind_address;
137 unsigned long remote_address;
138 //struct *sock_options;
139 };
140
141 struct sock_options {
142 int name;
143 int value;
144 };
145
146 struct vmas {
147 unsigned long start;
148 unsigned long end;
149 unsigned long flags;
150 unsigned long prot;
151 char *description; /* filename or description if possible (stack, heap) */
152 unsigned long page_faults;
153 };
154
155 struct syscalls {
156 unsigned int id;
157 unsigned long count;
158 uint64_t cpu_id;
159 unsigned int type;
160 unsigned int tid;
161 unsigned int fd;
162 };
163
164 struct signals {
165 int dest_pid;
166 int id;
167 unsigned long count;
168 };
169
170 struct file_info {
171 struct file_info *next;
172 char *name;
173 int fd;
174 int status;
175 };
176
177 /* header for cputop display */
178 struct header_view {
179 char *title;
180 int visible;
181 int sort;
182 int reverse;
183 };
184
185 struct kprobes {
186 char *probe_name;
187 char *symbol_name;
188 int probe_addr;
189 int probe_offset;
190 int count;
191 };
192
193 #endif /* LTTNGTOPTYPES_H */
This page took 0.046217 seconds and 4 git commands to generate.