3d8fc4040880c9a4f4dfc95031eae7dc7bd28c74
[lttngtop.git] / src / common.c
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 #include <babeltrace/ctf/events.h>
19 #include <stdlib.h>
20 #include <linux/unistd.h>
21 #include <string.h>
22 #include "common.h"
23
24 uint64_t get_cpu_id(const struct bt_ctf_event *event)
25 {
26 const struct bt_definition *scope;
27 uint64_t cpu_id;
28
29 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_PACKET_CONTEXT);
30 cpu_id = bt_ctf_get_uint64(bt_ctf_get_field(event, scope, "cpu_id"));
31 if (bt_ctf_field_get_error()) {
32 fprintf(stderr, "[error] get cpu_id\n");
33 return -1ULL;
34 }
35
36 return cpu_id;
37 }
38
39 uint64_t get_context_tid(const struct bt_ctf_event *event)
40 {
41 const struct bt_definition *scope;
42 uint64_t tid;
43
44 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
45 tid = bt_ctf_get_int64(bt_ctf_get_field(event,
46 scope, "_tid"));
47 if (bt_ctf_field_get_error()) {
48 fprintf(stderr, "Missing tid context info\n");
49 return -1ULL;
50 }
51
52 return tid;
53 }
54
55 uint64_t get_context_pid(const struct bt_ctf_event *event)
56 {
57 const struct bt_definition *scope;
58 uint64_t pid;
59
60 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
61 pid = bt_ctf_get_int64(bt_ctf_get_field(event,
62 scope, "_pid"));
63 if (bt_ctf_field_get_error()) {
64 fprintf(stderr, "Missing pid context info\n");
65 return -1ULL;
66 }
67
68 return pid;
69 }
70
71 uint64_t get_context_ppid(const struct bt_ctf_event *event)
72 {
73 const struct bt_definition *scope;
74 uint64_t ppid;
75
76 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
77 ppid = bt_ctf_get_int64(bt_ctf_get_field(event,
78 scope, "_ppid"));
79 if (bt_ctf_field_get_error()) {
80 fprintf(stderr, "Missing ppid context info\n");
81 return -1ULL;
82 }
83
84 return ppid;
85 }
86
87 uint64_t get_context_vtid(const struct bt_ctf_event *event)
88 {
89 const struct definition *scope;
90 uint64_t vtid;
91
92 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
93 vtid = bt_ctf_get_int64(bt_ctf_get_field(event,
94 scope, "_vtid"));
95 if (bt_ctf_field_get_error()) {
96 return -1ULL;
97 }
98
99 return vtid;
100 }
101
102 uint64_t get_context_vpid(const struct bt_ctf_event *event)
103 {
104 const struct definition *scope;
105 uint64_t vpid;
106
107 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
108 vpid = bt_ctf_get_int64(bt_ctf_get_field(event,
109 scope, "_vpid"));
110 if (bt_ctf_field_get_error()) {
111 return -1ULL;
112 }
113
114 return vpid;
115 }
116
117 uint64_t get_context_vppid(const struct bt_ctf_event *event)
118 {
119 const struct definition *scope;
120 uint64_t vppid;
121
122 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
123 vppid = bt_ctf_get_int64(bt_ctf_get_field(event,
124 scope, "_vppid"));
125 if (bt_ctf_field_get_error()) {
126 return -1ULL;
127 }
128
129 return vppid;
130 }
131
132 char *get_context_comm(const struct bt_ctf_event *event)
133 {
134 const struct bt_definition *scope;
135 char *comm;
136
137 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
138 comm = bt_ctf_get_char_array(bt_ctf_get_field(event,
139 scope, "_procname"));
140 if (bt_ctf_field_get_error()) {
141 fprintf(stderr, "Missing comm context info\n");
142 return NULL;
143 }
144
145 return comm;
146 }
147
148 char *get_context_hostname(const struct bt_ctf_event *event)
149 {
150 const struct definition *scope;
151 char *hostname;
152
153 scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
154 hostname = bt_ctf_get_char_array(bt_ctf_get_field(event,
155 scope, "_hostname"));
156 if (bt_ctf_field_get_error()) {
157 return NULL;
158 }
159
160 return hostname;
161 }
162
163 /*
164 * To get the parent process, put the pid in the tid field
165 * because the parent process gets pid = tid
166 */
167 struct processtop *find_process_tid(struct lttngtop *ctx, int tid, char *comm)
168 {
169 struct processtop *tmp;
170
171 tmp = g_hash_table_lookup(ctx->process_hash_table,
172 (gconstpointer) (unsigned long) tid);
173
174 return tmp;
175 }
176
177 struct processtop* add_proc(struct lttngtop *ctx, int tid, char *comm,
178 unsigned long timestamp, char *hostname)
179 {
180 struct processtop *newproc;
181
182 /* if the PID already exists, we just rename the process */
183 /* FIXME : need to integrate with clone/fork/exit to be accurate */
184 newproc = find_process_tid(ctx, tid, comm);
185
186 if (!newproc) {
187 newproc = g_new0(struct processtop, 1);
188 newproc->tid = tid;
189 newproc->birth = timestamp;
190 newproc->process_files_table = g_ptr_array_new();
191 newproc->files_history = NULL;
192 newproc->totalfileread = 0;
193 newproc->totalfilewrite = 0;
194 newproc->fileread = 0;
195 newproc->filewrite = 0;
196 newproc->syscall_info = NULL;
197 newproc->threadparent = NULL;
198 newproc->threads = g_ptr_array_new();
199 newproc->perf = g_hash_table_new(g_str_hash, g_str_equal);
200 g_ptr_array_add(ctx->process_table, newproc);
201 g_hash_table_insert(ctx->process_hash_table,
202 (gpointer) (unsigned long) tid, newproc);
203 if (lookup_tid_list(tid)) {
204 add_filter_tid_list(tid, newproc);
205 }
206 ctx->nbnewthreads++;
207 ctx->nbthreads++;
208 }
209 newproc->comm = strdup(comm);
210 if (hostname) {
211 if (newproc->hostname && strcmp(newproc->hostname, hostname) != 0) {
212 free(newproc->hostname);
213 }
214 newproc->hostname = strdup(hostname);
215 if (is_hostname_filtered(hostname)) {
216 add_filter_tid_list(tid, newproc);
217 }
218 }
219
220 return newproc;
221 }
222
223 struct processtop* update_proc(struct processtop* proc, int pid, int tid,
224 int ppid, int vpid, int vtid, int vppid, char *comm, char *hostname)
225 {
226 if (proc) {
227 proc->pid = pid;
228 proc->tid = tid;
229 proc->ppid = ppid;
230 proc->vpid = vpid;
231 proc->vtid = vtid;
232 proc->vppid = vppid;
233 if (strcmp(proc->comm, comm) != 0) {
234 free(proc->comm);
235 proc->comm = strdup(comm);
236 }
237 if (hostname && !proc->hostname) {
238 proc->hostname = strdup(hostname);
239 if (is_hostname_filtered(hostname)) {
240 add_filter_tid_list(tid, proc);
241 }
242 }
243 }
244 return proc;
245 }
246
247 /*
248 * This function just sets the time of death of a process.
249 * When we rotate the cputime we remove it from the process list.
250 */
251 void death_proc(struct lttngtop *ctx, int tid, char *comm,
252 unsigned long timestamp)
253 {
254 struct processtop *tmp;
255 tmp = find_process_tid(ctx, tid, comm);
256
257 g_hash_table_remove(ctx->process_hash_table,
258 (gpointer) (unsigned long) tid);
259 if (tmp && strcmp(tmp->comm, comm) == 0) {
260 tmp->death = timestamp;
261 ctx->nbdeadthreads++;
262 ctx->nbthreads--;
263 }
264 }
265
266 struct processtop* get_proc(struct lttngtop *ctx, int tid, char *comm,
267 unsigned long timestamp, char *hostname)
268 {
269 struct processtop *tmp;
270
271 tmp = find_process_tid(ctx, tid, comm);
272 if (tmp && strcmp(tmp->comm, comm) == 0) {
273 return tmp;
274 }
275 return add_proc(ctx, tid, comm, timestamp, hostname);
276 }
277
278 struct processtop *get_proc_pid(struct lttngtop *ctx, int tid, int pid,
279 unsigned long timestamp, char *hostname)
280 {
281 struct processtop *tmp;
282 tmp = find_process_tid(ctx, tid, NULL);
283 if (tmp && tmp->pid == pid)
284 return tmp;
285 return add_proc(ctx, tid, "Unknown", timestamp, hostname);
286 }
287
288 void add_thread(struct processtop *parent, struct processtop *thread)
289 {
290 gint i;
291 struct processtop *tmp;
292
293 if (!parent)
294 return;
295
296 for (i = 0; i < parent->threads->len; i++) {
297 tmp = g_ptr_array_index(parent->threads, i);
298 if (tmp == thread)
299 return;
300 }
301 g_ptr_array_add(parent->threads, thread);
302 }
303
304 struct cputime* add_cpu(int cpu)
305 {
306 struct cputime *newcpu;
307
308 newcpu = g_new0(struct cputime, 1);
309 newcpu->id = cpu;
310 newcpu->current_task = NULL;
311 newcpu->perf = g_hash_table_new(g_str_hash, g_str_equal);
312
313 g_ptr_array_add(lttngtop.cpu_table, newcpu);
314
315 return newcpu;
316 }
317 struct cputime* get_cpu(int cpu)
318 {
319 gint i;
320 struct cputime *tmp;
321
322 for (i = 0; i < lttngtop.cpu_table->len; i++) {
323 tmp = g_ptr_array_index(lttngtop.cpu_table, i);
324 if (tmp->id == cpu)
325 return tmp;
326 }
327
328 return add_cpu(cpu);
329 }
330
331 /*
332 * At the end of a sampling period, we need to display the cpu time for each
333 * process and to reset it to zero for the next period
334 */
335 void rotate_cputime(unsigned long end)
336 {
337 gint i;
338 struct cputime *tmp;
339 unsigned long elapsed;
340
341 for (i = 0; i < lttngtop.cpu_table->len; i++) {
342 tmp = g_ptr_array_index(lttngtop.cpu_table, i);
343 elapsed = end - tmp->task_start;
344 if (tmp->current_task) {
345 tmp->current_task->totalcpunsec += elapsed;
346 tmp->current_task->threadstotalcpunsec += elapsed;
347 if (tmp->current_task->pid != tmp->current_task->tid &&
348 tmp->current_task->threadparent) {
349 tmp->current_task->threadparent->threadstotalcpunsec += elapsed;
350 }
351 }
352 tmp->task_start = end;
353 }
354 }
355
356 void reset_perf_counter(gpointer key, gpointer value, gpointer user_data)
357 {
358 ((struct perfcounter*) value)->count = 0;
359 }
360
361 void copy_perf_counter(gpointer key, gpointer value, gpointer new_table)
362 {
363 struct perfcounter *newperf;
364
365 newperf = g_new0(struct perfcounter, 1);
366 newperf->count = ((struct perfcounter *) value)->count;
367 newperf->visible = ((struct perfcounter *) value)->visible;
368 newperf->sort = ((struct perfcounter *) value)->sort;
369 g_hash_table_insert((GHashTable *) new_table, strdup(key), newperf);
370 }
371
372 void copy_process_table(gpointer key, gpointer value, gpointer new_table)
373 {
374 g_hash_table_insert((GHashTable *) new_table, key, value);
375 }
376
377 void rotate_perfcounter() {
378 int i;
379 struct processtop *tmp;
380 for (i = 0; i < lttngtop.process_table->len; i++) {
381 tmp = g_ptr_array_index(lttngtop.process_table, i);
382 g_hash_table_foreach(tmp->perf, reset_perf_counter, NULL);
383 }
384 }
385
386 void cleanup_processtop()
387 {
388 gint i, j;
389 struct processtop *tmp;
390 struct files *tmpf; /* a temporary file */
391
392 for (i = 0; i < lttngtop.process_table->len; i++) {
393 tmp = g_ptr_array_index(lttngtop.process_table, i);
394 tmp->totalcpunsec = 0;
395 tmp->threadstotalcpunsec = 0;
396 tmp->fileread = 0;
397 tmp->filewrite = 0;
398
399 for (j = 0; j < tmp->process_files_table->len; j++) {
400 tmpf = g_ptr_array_index(tmp->process_files_table, j);
401 if (tmpf != NULL) {
402 tmpf->read = 0;
403 tmpf->write = 0;
404
405 if (tmpf->flag == __NR_close)
406 g_ptr_array_index(
407 tmp->process_files_table, j
408 ) = NULL;
409 }
410 }
411 }
412 }
413
414 void reset_global_counters()
415 {
416 lttngtop.nbnewproc = 0;
417 lttngtop.nbdeadproc = 0;
418 lttngtop.nbnewthreads = 0;
419 lttngtop.nbdeadthreads = 0;
420 lttngtop.nbnewfiles = 0;
421 lttngtop.nbclosedfiles = 0;
422 }
423
424 void copy_global_counters(struct lttngtop *dst)
425 {
426 dst->nbproc = lttngtop.nbproc;
427 dst->nbnewproc = lttngtop.nbnewproc;
428 dst->nbdeadproc = lttngtop.nbdeadproc;
429 dst->nbthreads = lttngtop.nbthreads;
430 dst->nbnewthreads = lttngtop.nbnewthreads;
431 dst->nbdeadthreads = lttngtop.nbdeadthreads;
432 dst->nbfiles = lttngtop.nbfiles;
433 dst->nbnewfiles = lttngtop.nbnewfiles;
434 dst->nbclosedfiles = lttngtop.nbclosedfiles;
435 reset_global_counters();
436 }
437
438 struct lttngtop* get_copy_lttngtop(unsigned long start, unsigned long end)
439 {
440 gint i, j;
441 unsigned long time;
442 struct lttngtop *dst;
443 struct processtop *tmp, *tmp2, *new;
444 struct cputime *tmpcpu, *newcpu;
445 struct files *tmpfile, *newfile;
446 struct kprobes *tmpprobe, *newprobe;
447
448 dst = g_new0(struct lttngtop, 1);
449 dst->start = start;
450 dst->end = end;
451 copy_global_counters(dst);
452 dst->process_table = g_ptr_array_new();
453 dst->files_table = g_ptr_array_new();
454 dst->cpu_table = g_ptr_array_new();
455 dst->kprobes_table = g_ptr_array_new();
456 dst->process_hash_table = g_hash_table_new(g_direct_hash, g_direct_equal);
457 g_hash_table_foreach(lttngtop.process_hash_table, copy_process_table,
458 dst->process_hash_table);
459
460 rotate_cputime(end);
461
462 for (i = 0; i < lttngtop.process_table->len; i++) {
463 tmp = g_ptr_array_index(lttngtop.process_table, i);
464 new = g_new0(struct processtop, 1);
465
466 memcpy(new, tmp, sizeof(struct processtop));
467 new->threads = g_ptr_array_new();
468 new->comm = strdup(tmp->comm);
469 new->process_files_table = g_ptr_array_new();
470 new->files_history = tmp->files_history;
471 new->perf = g_hash_table_new(g_str_hash, g_str_equal);
472 g_hash_table_foreach(tmp->perf, copy_perf_counter, new->perf);
473
474 /* compute the stream speed */
475 if (end - start != 0) {
476 time = (end - start) / NSEC_PER_SEC;
477 new->fileread = new->fileread/(time);
478 new->filewrite = new->filewrite/(time);
479 }
480
481 for (j = 0; j < tmp->process_files_table->len; j++) {
482 tmpfile = g_ptr_array_index(tmp->process_files_table, j);
483
484 newfile = malloc(sizeof(struct files));
485
486 if (tmpfile != NULL) {
487 memcpy(newfile, tmpfile, sizeof(struct files));
488 newfile->name = strdup(tmpfile->name);
489 newfile->ref = new;
490 g_ptr_array_add(new->process_files_table,
491 newfile);
492 g_ptr_array_add(dst->files_table, newfile);
493 } else {
494 g_ptr_array_add(new->process_files_table, NULL);
495 g_ptr_array_add(dst->files_table, NULL);
496 }
497 /*
498 * if the process died during the last period, we remove all
499 * files associated with if after the copy
500 */
501 if (tmp->death > 0 && tmp->death < end) {
502 /* FIXME : close the files before */
503 g_ptr_array_remove(tmp->process_files_table, tmpfile);
504 g_free(tmpfile);
505 }
506 }
507 g_ptr_array_add(dst->process_table, new);
508
509 /*
510 * if the process died during the last period, we remove it from
511 * the current process list after the copy
512 */
513 if (tmp->death > 0 && tmp->death < end) {
514 g_ptr_array_remove(lttngtop.process_table, tmp);
515 /* FIXME : TRUE does not mean clears the object in it */
516 g_ptr_array_free(tmp->threads, TRUE);
517 free(tmp->comm);
518 g_ptr_array_free(tmp->process_files_table, TRUE);
519 /* FIXME : clear elements */
520 g_hash_table_destroy(tmp->perf);
521 g_free(tmp);
522 }
523 }
524 rotate_perfcounter();
525
526 for (i = 0; i < lttngtop.cpu_table->len; i++) {
527 tmpcpu = g_ptr_array_index(lttngtop.cpu_table, i);
528 newcpu = g_new0(struct cputime, 1);
529 memcpy(newcpu, tmpcpu, sizeof(struct cputime));
530 newcpu->perf = g_hash_table_new(g_str_hash, g_str_equal);
531 g_hash_table_foreach(tmpcpu->perf, copy_perf_counter, newcpu->perf);
532 /*
533 * note : we don't care about the current process pointer in the copy
534 * so the reference is invalid after the memcpy
535 */
536 g_ptr_array_add(dst->cpu_table, newcpu);
537 }
538 if (lttngtop.kprobes_table) {
539 for (i = 0; i < lttngtop.kprobes_table->len; i++) {
540 tmpprobe = g_ptr_array_index(lttngtop.kprobes_table, i);
541 newprobe = g_new0(struct kprobes, 1);
542 memcpy(newprobe, tmpprobe, sizeof(struct kprobes));
543 tmpprobe->count = 0;
544 g_ptr_array_add(dst->kprobes_table, newprobe);
545 }
546 }
547 /* FIXME : better algo */
548 /* create the threads index if required */
549 for (i = 0; i < dst->process_table->len; i++) {
550 tmp = g_ptr_array_index(dst->process_table, i);
551 if (tmp->pid == tmp->tid) {
552 for (j = 0; j < dst->process_table->len; j++) {
553 tmp2 = g_ptr_array_index(dst->process_table, j);
554 if (tmp2->pid == tmp->pid) {
555 tmp2->threadparent = tmp;
556 g_ptr_array_add(tmp->threads, tmp2);
557 }
558 }
559 }
560 }
561
562 // update_global_stats(dst);
563 cleanup_processtop();
564
565 return dst;
566 }
567
568
569 enum bt_cb_ret handle_statedump_process_state(struct bt_ctf_event *call_data,
570 void *private_data)
571 {
572 const struct bt_definition *scope;
573 struct processtop *proc;
574 unsigned long timestamp;
575 int64_t pid, tid, ppid, vtid, vpid, vppid;
576 char *procname, *hostname = NULL;
577
578 timestamp = bt_ctf_get_timestamp(call_data);
579 if (timestamp == -1ULL)
580 goto error;
581
582 scope = bt_ctf_get_top_level_scope(call_data,
583 BT_EVENT_FIELDS);
584 pid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
585 scope, "_pid"));
586 if (bt_ctf_field_get_error()) {
587 fprintf(stderr, "Missing pid context info\n");
588 goto error;
589 }
590 ppid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
591 scope, "_ppid"));
592 if (bt_ctf_field_get_error()) {
593 fprintf(stderr, "Missing ppid context info\n");
594 goto error;
595 }
596 tid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
597 scope, "_tid"));
598 if (bt_ctf_field_get_error()) {
599 fprintf(stderr, "Missing tid context info\n");
600 goto error;
601 }
602 vtid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
603 scope, "_vtid"));
604 if (bt_ctf_field_get_error()) {
605 fprintf(stderr, "Missing vtid context info\n");
606 goto error;
607 }
608 vpid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
609 scope, "_vpid"));
610 if (bt_ctf_field_get_error()) {
611 fprintf(stderr, "Missing vpid context info\n");
612 goto error;
613 }
614 vppid = bt_ctf_get_int64(bt_ctf_get_field(call_data,
615 scope, "_vppid"));
616 if (bt_ctf_field_get_error()) {
617 fprintf(stderr, "Missing vppid context info\n");
618 goto error;
619 }
620
621 scope = bt_ctf_get_top_level_scope(call_data,
622 BT_EVENT_FIELDS);
623 procname = bt_ctf_get_char_array(bt_ctf_get_field(call_data,
624 scope, "_name"));
625 if (bt_ctf_field_get_error()) {
626 fprintf(stderr, "Missing process name context info\n");
627 goto error;
628 }
629 /*
630 hostname = bt_ctf_get_char_array(bt_ctf_get_field(call_data,
631 scope, "_hostname"));
632 if (bt_ctf_field_get_error()) {
633 }
634 */
635
636 proc = find_process_tid(&lttngtop, tid, procname);
637 if (proc == NULL)
638 proc = add_proc(&lttngtop, tid, procname, timestamp, hostname);
639 update_proc(proc, pid, tid, ppid, vpid, vtid, vppid, procname, hostname);
640
641 if (proc) {
642 free(proc->comm);
643 proc->comm = strdup(procname);
644 proc->pid = pid;
645 }
646
647 return BT_CB_OK;
648
649 error:
650 return BT_CB_ERROR_STOP;
651 }
652
653 struct tm format_timestamp(uint64_t timestamp)
654 {
655 struct tm tm;
656 uint64_t ts_sec = 0, ts_nsec;
657 time_t time_s;
658
659 ts_nsec = timestamp;
660 ts_sec += ts_nsec / NSEC_PER_SEC;
661 ts_nsec = ts_nsec % NSEC_PER_SEC;
662
663 time_s = (time_t) ts_sec;
664
665 localtime_r(&time_s, &tm);
666
667 return tm;
668 }
669
670 int *lookup_tid_list(int tid)
671 {
672 if (!tid_filter_list)
673 return NULL;
674
675 return g_hash_table_lookup(tid_filter_list, (gpointer) &tid);
676 }
677
678 struct host *lookup_hostname_list(const char *hostname)
679 {
680 if (!hostname || !global_host_list)
681 return NULL;
682
683 return g_hash_table_lookup(global_host_list, (gpointer) hostname);
684 }
685
686 int is_hostname_filtered(const char *hostname)
687 {
688 struct host *host;
689
690 host = lookup_hostname_list(hostname);
691 if (host)
692 return host->filter;
693 return 0;
694 }
695
696 int *lookup_filter_tid_list(int tid)
697 {
698 return g_hash_table_lookup(global_filter_list, (gpointer) &tid);
699 }
700
701 void add_filter_tid_list(int tid, struct processtop *newproc)
702 {
703 unsigned long *hash_tid;
704
705 hash_tid = malloc(sizeof(unsigned long));
706 *hash_tid = tid;
707 g_hash_table_insert(global_filter_list,
708 (gpointer) (unsigned long) hash_tid, newproc);
709 }
710
711 void remove_filter_tid_list(int tid)
712 {
713 g_hash_table_remove(global_filter_list,
714 (gpointer) (unsigned long) &tid);
715 }
This page took 0.041817 seconds and 3 git commands to generate.