2 * Copyright (C) 2011-2012 Julien Desfossez
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;
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.
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.
21 #include <semaphore.h>
22 #include <babeltrace/ctf/events.h>
23 #include "lttngtoptypes.h"
26 #define NSEC_PER_USEC 1000
27 #define NSEC_PER_SEC 1000000000L
29 sem_t goodtodisplay
, goodtoupdate
, timer
, pause_sem
, end_trace_sem
, bootstrap
;
31 GPtrArray
*copies
; /* struct lttngtop */
32 GHashTable
*global_perf_liszt
;
33 GHashTable
*global_filter_list
;
34 GHashTable
*global_host_list
;
35 GHashTable
*global_procname_list
;
39 char *opt_relay_hostname
;
47 GHashTable
*tid_filter_list
;
55 struct lttngtop
*data
;
57 struct processtop
*find_process_tid(struct lttngtop
*ctx
, int pid
, const char *comm
);
58 struct processtop
* add_proc(struct lttngtop
*ctx
, int pid
, char *comm
,
59 unsigned long timestamp
, char *hostname
);
60 struct processtop
* update_proc(struct processtop
* proc
, int pid
, int tid
,
61 int ppid
, int vpid
, int vtid
, int vppid
, char *comm
,
63 void add_thread(struct processtop
*parent
, struct processtop
*thread
);
64 struct processtop
* get_proc(struct lttngtop
*ctx
, int tid
, char *comm
,
65 unsigned long timestamp
, char *hostname
);
67 struct processtop
*get_proc_pid(struct lttngtop
*ctx
, int tid
, int pid
,
68 unsigned long timestamp
, char *hostname
);
70 void death_proc(struct lttngtop
*ctx
, int tid
, char *comm
,
71 unsigned long timestamp
);
72 struct cputime
* add_cpu(int cpu
);
73 struct cputime
* get_cpu(int cpu
);
74 struct lttngtop
* get_copy_lttngtop(unsigned long start
, unsigned long end
);
75 struct perfcounter
*add_perf_counter(GPtrArray
*perf
, GQuark quark
,
77 struct perfcounter
*get_perf_counter(const char *name
, struct processtop
*proc
,
79 void reset_global_counters(void);
81 /* common field access functions */
82 uint64_t get_cpu_id(const struct bt_ctf_event
*event
);
83 uint64_t get_context_tid(const struct bt_ctf_event
*event
);
84 uint64_t get_context_pid(const struct bt_ctf_event
*event
);
85 uint64_t get_context_ppid(const struct bt_ctf_event
*event
);
86 char *get_context_comm(const struct bt_ctf_event
*event
);
87 uint64_t get_context_vtid(const struct bt_ctf_event
*event
);
88 uint64_t get_context_vpid(const struct bt_ctf_event
*event
);
89 uint64_t get_context_vppid(const struct bt_ctf_event
*event
);
90 char *get_context_hostname(const struct bt_ctf_event
*event
);
92 enum bt_cb_ret
handle_statedump_process_state(struct bt_ctf_event
*call_data
,
95 struct tm
format_timestamp(uint64_t timestamp
);
97 int *lookup_filter_tid_list(int tid
);
98 int *lookup_tid_list(int tid
);
99 void remove_hostname_list(const char *hostname
);
100 void add_filter_tid_list(struct processtop
*proc
);
101 void remove_filter_tid_list(int tid
);
102 struct host
*lookup_hostname_list(const char *hostname
);
103 int is_hostname_filtered(const char *hostname
);
104 struct host
*add_hostname_list(char *hostname
, int filter
);
105 void update_hostname_filter(struct host
*host
);
106 char *lookup_procname(const char *procname
);
107 char *add_procname_list(char *procname
, int filter
);
109 #endif /* _COMMON_H */
This page took 0.031818 seconds and 4 git commands to generate.