Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2010, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | /* |
| 15 | perf.h |
| 16 | |
| 17 | DESCRIPTION: Reads and writes the performance monitoring registers in the ARM |
| 18 | by using the MRC and MCR instructions. |
| 19 | */ |
| 20 | #ifndef PERF_H |
| 21 | #define PERF_H |
| 22 | extern unsigned long perf_get_cycles(void); |
| 23 | extern void perf_set_count1(unsigned long val); |
| 24 | extern void perf_set_count0(unsigned long val); |
| 25 | extern unsigned long perf_get_count1(void); |
| 26 | extern unsigned long perf_get_count0(void); |
| 27 | extern unsigned long perf_get_ctrl(void); |
| 28 | extern void perf_set_ctrl(void); |
| 29 | extern void perf_set_ctrl_with(unsigned long v); |
| 30 | extern void perf_enable_counting(void); |
| 31 | extern void perf_disable_counting(void); |
| 32 | extern void perf_set_divider(int d); |
| 33 | extern unsigned long perf_get_overflow(void); |
| 34 | extern void perf_clear_overflow(unsigned long bit); |
| 35 | extern void perf_export_event(unsigned long bit); |
| 36 | extern void perf_reset_counts(void); |
| 37 | extern int perf_set_event(unsigned long index, unsigned long val); |
| 38 | extern unsigned long perf_get_count(unsigned long index); |
| 39 | extern void perf_set_cycles(unsigned long c); |
| 40 | |
| 41 | extern void pm_stop_all(void); |
| 42 | extern void l2_pm_stop_all(void); |
| 43 | extern void pm_start_all(void); |
| 44 | extern void l2_pm_start_all(void); |
| 45 | extern void pm_reset_all(void); |
| 46 | extern void l2_pm_reset_all(void); |
| 47 | extern void pm_set_event(unsigned long monitorIndex, unsigned long eventIndex); |
| 48 | extern void l2_pm_set_event(unsigned long monitorIndex, |
| 49 | unsigned long eventIndex); |
| 50 | extern unsigned long pm_get_count(unsigned long monitorIndex); |
| 51 | extern unsigned long l2_pm_get_count(unsigned long monitorIndex); |
| 52 | extern unsigned long pm_get_cycle_count(void); |
| 53 | extern unsigned long l2_pm_get_cycle_count(void); |
| 54 | extern char *pm_find_event_name(unsigned long index); |
| 55 | extern void pm_set_local_iu(unsigned long events); |
| 56 | extern void pm_set_local_xu(unsigned long events); |
| 57 | extern void pm_set_local_su(unsigned long events); |
| 58 | extern void pm_set_local_l2(unsigned long events); |
| 59 | extern void pm_set_local_vu(unsigned long events); |
| 60 | extern void pm_set_local_bu(unsigned long events); |
| 61 | extern void pm_set_local_cb(unsigned long events); |
| 62 | extern void pm_set_local_mp(unsigned long events); |
| 63 | extern void pm_set_local_sp(unsigned long events); |
| 64 | extern void pm_set_local_scu(unsigned long events); |
| 65 | extern void pm_initialize(void); |
| 66 | extern void pm_deinitialize(void); |
| 67 | extern void l2_pm_initialize(void); |
| 68 | extern void l2_pm_deinitialize(void); |
| 69 | extern void pm_free_irq(void); |
| 70 | extern void l2_pm_free_irq(void); |
| 71 | |
| 72 | extern int per_process_perf_init(void); |
| 73 | extern void per_process_perf_exit(void); |
| 74 | int per_process_read(char *page, char **start, off_t off, int count, |
| 75 | int *eof, void *data); |
| 76 | int per_process_write_hex(struct file *file, const char *buff, |
| 77 | unsigned long cnt, void *data); |
| 78 | int per_process_read_decimal(char *page, char **start, off_t off, int count, |
| 79 | int *eof, void *data); |
| 80 | int per_process_write_dec(struct file *file, const char *buff, |
| 81 | unsigned long cnt, void *data); |
| 82 | void perfmon_register_callback(void); |
| 83 | void _per_process_switch(unsigned long oldPid, unsigned long newPid); |
| 84 | extern unsigned int pp_loaded; |
| 85 | extern atomic_t pm_op_lock; |
| 86 | #endif /*PERF_H*/ |