fix perf name (now without underscore prefix)
[lttngtop.git] / src / common.h
CommitLineData
1fc22eb4
JD
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 *
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 */
32pthread_mutex_t perf_list_mutex;
33
34struct lttngtop *data;
35
36struct processtop *find_process_tid(struct lttngtop *ctx, int pid, char *comm);
37struct processtop* add_proc(struct lttngtop *ctx, int pid, char *comm,
38 unsigned long timestamp);
39struct processtop* update_proc(struct processtop* proc, int pid, int tid,
40 int ppid, char *comm);
41void add_thread(struct processtop *parent, struct processtop *thread);
42struct processtop* get_proc(struct lttngtop *ctx, int tid, char *comm,
43 unsigned long timestamp);
44void death_proc(struct lttngtop *ctx, int tid, char *comm,
45 unsigned long timestamp);
46struct cputime* add_cpu(int cpu);
47struct cputime* get_cpu(int cpu);
48struct lttngtop* get_copy_lttngtop(unsigned long start, unsigned long end);
49struct perfcounter *add_perf_counter(GPtrArray *perf, GQuark quark,
50 unsigned long count);
51struct perfcounter *get_perf_counter(const char *name, struct processtop *proc,
52 struct cputime *cpu);
53
d67167cd
JD
54/* common field access functions */
55uint64_t get_cpu_id(struct bt_ctf_event *event);
1dec520a
JD
56uint64_t get_context_tid(struct bt_ctf_event *event);
57uint64_t get_context_pid(struct bt_ctf_event *event);
58uint64_t get_context_ppid(struct bt_ctf_event *event);
59char *get_context_comm(struct bt_ctf_event *event);
d67167cd 60
1fc22eb4 61#endif /* _COMMON_H */
This page took 0.025345 seconds and 4 git commands to generate.