diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-27 11:20:43 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-08-27 12:31:13 +0100 |
commit | 1c3fd70357a57f823846010f59ba75f19e5d4af9 (patch) | |
tree | e3ef96d481a5c1d59782dab6c1b38c7e712adcd1 /overlay/gpu-perf.c | |
parent | 6ec1d2c0ae631a3c0af445d4baa53561228be9a5 (diff) |
overlay: Read power from perf_events
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/gpu-perf.c')
-rw-r--r-- | overlay/gpu-perf.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c index 142357cb..fc215634 100644 --- a/overlay/gpu-perf.c +++ b/overlay/gpu-perf.c @@ -24,7 +24,6 @@ #include <stdint.h> #include <stdbool.h> -#include <linux/perf_event.h> #include <sys/types.h> #include <sys/mman.h> #include <sys/ioctl.h> @@ -35,6 +34,7 @@ #include <fcntl.h> #include <errno.h> +#include "perf.h" #include "gpu-perf.h" #include "debugfs.h" @@ -59,27 +59,6 @@ struct sample_event { uint32_t raw[0]; }; -static int -perf_event_open(struct perf_event_attr *attr, - pid_t pid, - int cpu, - int group_fd, - unsigned long flags) -{ -#ifndef __NR_perf_event_open -#if defined(__i386__) -#define __NR_perf_event_open 336 -#elif defined(__x86_64__) -#define __NR_perf_event_open 298 -#else -#define __NR_perf_event_open 0 -#endif -#endif - - attr->size = sizeof(*attr); - return syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags); -} - static uint64_t tracepoint_id(const char *sys, const char *name) { char buf[1024]; |