filter on hostname
[lttngtop.git] / src / common.h
CommitLineData
1fc22eb4 1/*
aa15ac1c 2 * Copyright (C) 2011-2012 Julien Desfossez
1fc22eb4
JD
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 *
71bd7ce1
AM
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.
1fc22eb4
JD
16 */
17
18#ifndef _COMMON_H
19#define _COMMON_H
20
21#include <semaphore.h>
22#include <babeltrace/ctf/events.h>
23#include "lttngtoptypes.h"
24#include "cputop.h"
25
26#define NSEC_PER_USEC 1000
27#define NSEC_PER_SEC 1000000000L
28
29sem_t goodtodisplay, goodtoupdate, timer, pause_sem, end_trace_sem, bootstrap;
30
31GPtrArray *copies; /* struct lttngtop */
0d91c12a 32GHashTable *global_perf_liszt;
1fc22eb4 33
57bff788 34char *opt_tid;
c8d75a13 35char *opt_hostname;
57bff788 36GHashTable *tid_list;
c8d75a13 37GHashTable *hostname_list;
96aa77de 38
ae9e85c7
JD
39extern int quit;
40
1fc22eb4
JD
41struct lttngtop *data;
42
43struct processtop *find_process_tid(struct lttngtop *ctx, int pid, char *comm);
44struct processtop* add_proc(struct lttngtop *ctx, int pid, char *comm,
45 unsigned long timestamp);
46struct processtop* update_proc(struct processtop* proc, int pid, int tid,
c8d75a13
JD
47 int ppid, int vpid, int vtid, int vppid, char *comm,
48 char *hostname);
1fc22eb4
JD
49void add_thread(struct processtop *parent, struct processtop *thread);
50struct processtop* get_proc(struct lttngtop *ctx, int tid, char *comm,
51 unsigned long timestamp);
59288610
MB
52
53struct processtop *get_proc_pid(struct lttngtop *ctx, int tid, int pid,
54 unsigned long timestamp);
55
1fc22eb4
JD
56void death_proc(struct lttngtop *ctx, int tid, char *comm,
57 unsigned long timestamp);
58struct cputime* add_cpu(int cpu);
59struct cputime* get_cpu(int cpu);
60struct lttngtop* get_copy_lttngtop(unsigned long start, unsigned long end);
61struct perfcounter *add_perf_counter(GPtrArray *perf, GQuark quark,
62 unsigned long count);
63struct perfcounter *get_perf_counter(const char *name, struct processtop *proc,
64 struct cputime *cpu);
e05a35a6 65void reset_global_counters(void);
1fc22eb4 66
d67167cd 67/* common field access functions */
4adc8274
JD
68uint64_t get_cpu_id(const struct bt_ctf_event *event);
69uint64_t get_context_tid(const struct bt_ctf_event *event);
70uint64_t get_context_pid(const struct bt_ctf_event *event);
71uint64_t get_context_ppid(const struct bt_ctf_event *event);
72char *get_context_comm(const struct bt_ctf_event *event);
1402044a
JD
73uint64_t get_context_vtid(const struct bt_ctf_event *event);
74uint64_t get_context_vpid(const struct bt_ctf_event *event);
75uint64_t get_context_vppid(const struct bt_ctf_event *event);
c8d75a13 76char *get_context_hostname(const struct bt_ctf_event *event);
d67167cd 77
928f18a6
MB
78enum bt_cb_ret handle_statedump_process_state(struct bt_ctf_event *call_data,
79 void *private_data);
80
b520ab45
JD
81struct tm format_timestamp(uint64_t timestamp);
82
57bff788 83int *lookup_tid_list(int tid);
c8d75a13 84char *lookup_hostname_list(const char *hostname);
57bff788 85
1fc22eb4 86#endif /* _COMMON_H */
This page took 0.027291 seconds and 4 git commands to generate.