diff options
author | Anders Roxell <anders.roxell@linaro.org> | 2015-02-26 08:27:18 +0100 |
---|---|---|
committer | Yogesh Tillu <yogesh.tillu@linaro.org> | 2015-02-26 13:03:05 +0530 |
commit | e85e07de27de42e779b8035d539beffd77f98686 (patch) | |
tree | 08d57579d68c08f6792b87af8613567a1e6ddafb | |
parent | e15e88cc9109e5eed3ab5a2bb638e988e9a4ea30 (diff) |
cleanup tabs and fix add newlines
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Yogesh Tillu <yogesh.tillu@linaro.org>
-rw-r--r-- | perf_ev_open.c | 8 | ||||
-rw-r--r-- | perf_rc_mmap.c | 13 |
2 files changed, 11 insertions, 10 deletions
diff --git a/perf_ev_open.c b/perf_ev_open.c index 8413422..3550bfd 100644 --- a/perf_ev_open.c +++ b/perf_ev_open.c @@ -33,8 +33,7 @@ fini(void) close(fddev); } - static inline long long -cpucycles(void) +static inline long long cpucycles(void) { long long result = 0; if (read(fddev, &result, sizeof(result)) < sizeof(result)) @@ -43,7 +42,7 @@ cpucycles(void) } /* Simple loop body to keep things interested. Make sure it gets inlined. */ - static inline int +static inline int loop(int* __restrict__ a, int* __restrict__ b, int n) { unsigned sum = 0; @@ -54,8 +53,7 @@ loop(int* __restrict__ a, int* __restrict__ b, int n) return sum; } - int -main(int ac, char **av) +int main(int ac, char **av) { long long time_start = 0; long long time_end = 0; diff --git a/perf_rc_mmap.c b/perf_rc_mmap.c index ae72775..838c869 100644 --- a/perf_rc_mmap.c +++ b/perf_rc_mmap.c @@ -22,7 +22,7 @@ #include <string.h> #define barrier() asm volatile("" ::: "memory") static int fddev = -1; - __attribute__((constructor)) static void +__attribute__((constructor)) static void init(void) { static struct perf_event_attr attr; @@ -31,7 +31,7 @@ init(void) fddev = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0); } - __attribute__((destructor)) static void +__attribute__((destructor)) static void fini(void) { close(fddev); @@ -44,6 +44,7 @@ static unsigned long rdpmc(unsigned int counter) asm volatile("mrs %0, pmccntr_el0" : "=r" (ret)); return ret; } + static unsigned long mmap_read_self(void *addr) { struct perf_event_mmap_page *pc = addr; @@ -62,8 +63,9 @@ static unsigned long mmap_read_self(void *addr) count = pmc; return count; } + /* Simple loop body to keep things interested. Make sure it gets inlined. */ - static inline int +static inline int loop(int* __restrict__ a, int* __restrict__ b, int n) { unsigned sum = 0; @@ -73,9 +75,10 @@ loop(int* __restrict__ a, int* __restrict__ b, int n) sum += a[i] + 5; return sum; } + static unsigned long page_size; - int -main(int ac, char **av) + +int main(int ac, char **av) { long long time_start = 0; long long time_end = 0; |