ntel-gpu-tools/overlay/gpu-perf.h
Chris Wilson 6233cac9c9 overlay: Couple wait begin/end events together to fix accounting
Since the events may be processed out of order (due to per-cpu
ringbuffers) we need to be careful to associated wait pairs in order to
compute the correct elapsed time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-17 22:22:21 +01:00

34 lines
619 B
C

#include <stdint.h>
struct gpu_perf {
int page_size;
int nr_cpus;
int nr_events;
int *fd;
void **map;
struct gpu_perf_sample {
uint64_t id;
int (*func)(struct gpu_perf *, const void *);
} *sample;
int flip_complete;
struct gpu_perf_comm {
struct gpu_perf_comm *next;
struct gpu_perf_wait {
struct gpu_perf_wait *next;
uint32_t seqno;
uint64_t time;
} *wait;
char name[256];
pid_t pid;
int nr_requests[4];
void *user_data;
uint64_t wait_begin;
uint64_t wait_time;
} *comm;
};
void gpu_perf_init(struct gpu_perf *gp, unsigned flags);
int gpu_perf_update(struct gpu_perf *gp);