blob: f02405e0c662dd707b5d03abf3716b178a70834e [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2010, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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/*
15perf.h
16
17DESCRIPTION: Reads and writes the performance monitoring registers in the ARM
18by using the MRC and MCR instructions.
19*/
20#ifndef PERF_H
21#define PERF_H
22extern unsigned long perf_get_cycles(void);
23extern void perf_set_count1(unsigned long val);
24extern void perf_set_count0(unsigned long val);
25extern unsigned long perf_get_count1(void);
26extern unsigned long perf_get_count0(void);
27extern unsigned long perf_get_ctrl(void);
28extern void perf_set_ctrl(void);
29extern void perf_set_ctrl_with(unsigned long v);
30extern void perf_enable_counting(void);
31extern void perf_disable_counting(void);
32extern void perf_set_divider(int d);
33extern unsigned long perf_get_overflow(void);
34extern void perf_clear_overflow(unsigned long bit);
35extern void perf_export_event(unsigned long bit);
36extern void perf_reset_counts(void);
37extern int perf_set_event(unsigned long index, unsigned long val);
38extern unsigned long perf_get_count(unsigned long index);
39extern void perf_set_cycles(unsigned long c);
40
41extern void pm_stop_all(void);
42extern void l2_pm_stop_all(void);
43extern void pm_start_all(void);
44extern void l2_pm_start_all(void);
45extern void pm_reset_all(void);
46extern void l2_pm_reset_all(void);
47extern void pm_set_event(unsigned long monitorIndex, unsigned long eventIndex);
48extern void l2_pm_set_event(unsigned long monitorIndex,
49 unsigned long eventIndex);
50extern unsigned long pm_get_count(unsigned long monitorIndex);
51extern unsigned long l2_pm_get_count(unsigned long monitorIndex);
52extern unsigned long pm_get_cycle_count(void);
53extern unsigned long l2_pm_get_cycle_count(void);
54extern char *pm_find_event_name(unsigned long index);
55extern void pm_set_local_iu(unsigned long events);
56extern void pm_set_local_xu(unsigned long events);
57extern void pm_set_local_su(unsigned long events);
58extern void pm_set_local_l2(unsigned long events);
59extern void pm_set_local_vu(unsigned long events);
60extern void pm_set_local_bu(unsigned long events);
61extern void pm_set_local_cb(unsigned long events);
62extern void pm_set_local_mp(unsigned long events);
63extern void pm_set_local_sp(unsigned long events);
64extern void pm_set_local_scu(unsigned long events);
65extern void pm_initialize(void);
66extern void pm_deinitialize(void);
67extern void l2_pm_initialize(void);
68extern void l2_pm_deinitialize(void);
69extern void pm_free_irq(void);
70extern void l2_pm_free_irq(void);
71
72extern int per_process_perf_init(void);
73extern void per_process_perf_exit(void);
74int per_process_read(char *page, char **start, off_t off, int count,
75 int *eof, void *data);
76int per_process_write_hex(struct file *file, const char *buff,
77 unsigned long cnt, void *data);
78int per_process_read_decimal(char *page, char **start, off_t off, int count,
79 int *eof, void *data);
80int per_process_write_dec(struct file *file, const char *buff,
81 unsigned long cnt, void *data);
82void perfmon_register_callback(void);
83void _per_process_switch(unsigned long oldPid, unsigned long newPid);
84extern unsigned int pp_loaded;
85extern atomic_t pm_op_lock;
86#endif /*PERF_H*/