X-Git-Url: https://git.lttng.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Fcommon.h;h=06bb219a29578cb3f36f4e048082347c7f979632;hp=8be30bbb1951afe6e0fefd52fcf80b6a4cc4c845;hb=f16e36fc0e460e58e327de6baaec29e90c3e3c93;hpb=d67167cde319ac9d257f5b59b5a4664e558f4cb4 diff --git a/src/common.h b/src/common.h index 8be30bb..06bb219 100644 --- a/src/common.h +++ b/src/common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Julien Desfossez + * Copyright (C) 2011-2012 Julien Desfossez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as @@ -10,10 +10,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _COMMON_H @@ -30,7 +29,15 @@ sem_t goodtodisplay, goodtoupdate, timer, pause_sem, end_trace_sem, bootstrap; GPtrArray *copies; /* struct lttngtop */ -pthread_mutex_t perf_list_mutex; +GHashTable *global_perf_liszt; + +char *opt_tid; +char *opt_hostname; +char *opt_kprobes; +GHashTable *tid_list; +GHashTable *hostname_list; + +extern int quit; struct lttngtop *data; @@ -38,10 +45,15 @@ struct processtop *find_process_tid(struct lttngtop *ctx, int pid, char *comm); struct processtop* add_proc(struct lttngtop *ctx, int pid, char *comm, unsigned long timestamp); struct processtop* update_proc(struct processtop* proc, int pid, int tid, - int ppid, char *comm); + int ppid, int vpid, int vtid, int vppid, char *comm, + char *hostname); void add_thread(struct processtop *parent, struct processtop *thread); struct processtop* get_proc(struct lttngtop *ctx, int tid, char *comm, unsigned long timestamp); + +struct processtop *get_proc_pid(struct lttngtop *ctx, int tid, int pid, + unsigned long timestamp); + void death_proc(struct lttngtop *ctx, int tid, char *comm, unsigned long timestamp); struct cputime* add_cpu(int cpu); @@ -51,8 +63,25 @@ struct perfcounter *add_perf_counter(GPtrArray *perf, GQuark quark, unsigned long count); struct perfcounter *get_perf_counter(const char *name, struct processtop *proc, struct cputime *cpu); +void reset_global_counters(void); /* common field access functions */ -uint64_t get_cpu_id(struct bt_ctf_event *event); +uint64_t get_cpu_id(const struct bt_ctf_event *event); +uint64_t get_context_tid(const struct bt_ctf_event *event); +uint64_t get_context_pid(const struct bt_ctf_event *event); +uint64_t get_context_ppid(const struct bt_ctf_event *event); +char *get_context_comm(const struct bt_ctf_event *event); +uint64_t get_context_vtid(const struct bt_ctf_event *event); +uint64_t get_context_vpid(const struct bt_ctf_event *event); +uint64_t get_context_vppid(const struct bt_ctf_event *event); +char *get_context_hostname(const struct bt_ctf_event *event); + +enum bt_cb_ret handle_statedump_process_state(struct bt_ctf_event *call_data, + void *private_data); + +struct tm format_timestamp(uint64_t timestamp); + +int *lookup_tid_list(int tid); +char *lookup_hostname_list(const char *hostname); #endif /* _COMMON_H */