2009-12-11 21:24:02 -02:00
|
|
|
#ifndef __PERF_SESSION_H
|
|
|
|
|
#define __PERF_SESSION_H
|
|
|
|
|
|
2009-12-13 19:50:25 -02:00
|
|
|
#include "event.h"
|
2009-12-11 21:24:02 -02:00
|
|
|
#include "header.h"
|
2009-12-13 19:50:29 -02:00
|
|
|
#include "thread.h"
|
2009-12-13 19:50:28 -02:00
|
|
|
#include <linux/rbtree.h>
|
2009-12-14 15:06:01 -02:00
|
|
|
#include "../../../include/linux/perf_event.h"
|
2009-12-13 19:50:28 -02:00
|
|
|
|
2009-12-14 14:22:59 -02:00
|
|
|
struct ip_callchain;
|
2009-12-13 19:50:28 -02:00
|
|
|
struct thread;
|
2009-12-14 14:22:59 -02:00
|
|
|
struct symbol;
|
2009-12-11 21:24:02 -02:00
|
|
|
|
|
|
|
|
struct perf_session {
|
|
|
|
|
struct perf_header header;
|
|
|
|
|
unsigned long size;
|
2009-12-13 19:50:27 -02:00
|
|
|
unsigned long mmap_window;
|
2009-12-13 19:50:29 -02:00
|
|
|
struct map_groups kmaps;
|
2009-12-13 19:50:28 -02:00
|
|
|
struct rb_root threads;
|
|
|
|
|
struct thread *last_match;
|
2010-01-04 16:19:29 -02:00
|
|
|
struct map *vmlinux_maps[MAP__NR_TYPES];
|
2009-12-14 15:06:01 -02:00
|
|
|
struct events_stats events_stats;
|
|
|
|
|
unsigned long event_total[PERF_RECORD_MAX];
|
2009-12-27 21:37:03 -02:00
|
|
|
unsigned long unknown_events;
|
2009-12-14 13:10:39 -02:00
|
|
|
struct rb_root hists;
|
2009-12-14 14:23:00 -02:00
|
|
|
u64 sample_type;
|
2010-01-05 16:50:31 -02:00
|
|
|
struct {
|
|
|
|
|
const char *name;
|
|
|
|
|
u64 addr;
|
|
|
|
|
} ref_reloc_sym;
|
2009-12-11 21:24:02 -02:00
|
|
|
int fd;
|
2009-12-13 19:50:27 -02:00
|
|
|
int cwdlen;
|
|
|
|
|
char *cwd;
|
2009-12-11 21:24:02 -02:00
|
|
|
char filename[0];
|
|
|
|
|
};
|
|
|
|
|
|
2009-12-13 19:50:25 -02:00
|
|
|
typedef int (*event_op)(event_t *self, struct perf_session *session);
|
|
|
|
|
|
|
|
|
|
struct perf_event_ops {
|
2009-12-27 21:37:05 -02:00
|
|
|
event_op sample,
|
|
|
|
|
mmap,
|
|
|
|
|
comm,
|
|
|
|
|
fork,
|
|
|
|
|
exit,
|
|
|
|
|
lost,
|
|
|
|
|
read,
|
|
|
|
|
throttle,
|
|
|
|
|
unthrottle;
|
2009-12-13 19:50:25 -02:00
|
|
|
};
|
|
|
|
|
|
2009-12-15 20:04:39 -02:00
|
|
|
struct perf_session *perf_session__new(const char *filename, int mode, bool force);
|
2009-12-11 21:24:02 -02:00
|
|
|
void perf_session__delete(struct perf_session *self);
|
|
|
|
|
|
2010-01-14 12:23:10 -02:00
|
|
|
void perf_event_header__bswap(struct perf_event_header *self);
|
|
|
|
|
|
2009-12-13 19:50:25 -02:00
|
|
|
int perf_session__process_events(struct perf_session *self,
|
2009-12-13 19:50:27 -02:00
|
|
|
struct perf_event_ops *event_ops);
|
2009-12-13 19:50:25 -02:00
|
|
|
|
2009-12-14 14:22:59 -02:00
|
|
|
struct symbol **perf_session__resolve_callchain(struct perf_session *self,
|
|
|
|
|
struct thread *thread,
|
|
|
|
|
struct ip_callchain *chain,
|
|
|
|
|
struct symbol **parent);
|
|
|
|
|
|
2009-12-27 21:37:02 -02:00
|
|
|
bool perf_session__has_traces(struct perf_session *self, const char *msg);
|
2009-12-27 21:37:01 -02:00
|
|
|
|
2010-01-14 12:23:10 -02:00
|
|
|
int perf_header__read_build_ids(struct perf_header *self, int input,
|
|
|
|
|
u64 offset, u64 file_size);
|
2009-12-13 19:50:25 -02:00
|
|
|
|
2010-01-05 16:50:31 -02:00
|
|
|
int perf_session__set_kallsyms_ref_reloc_sym(struct perf_session *self,
|
|
|
|
|
const char *symbol_name,
|
|
|
|
|
u64 addr);
|
|
|
|
|
void perf_session__reloc_vmlinux_maps(struct perf_session *self,
|
|
|
|
|
u64 unrelocated_addr);
|
|
|
|
|
|
2010-01-14 12:23:10 -02:00
|
|
|
void mem_bswap_64(void *src, int byte_size);
|
|
|
|
|
|
2009-12-11 21:24:02 -02:00
|
|
|
#endif /* __PERF_SESSION_H */
|