This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / Documentation / arm / XScale / IOP3XX / pmon.txt
1
2 Intel's XScale Microarchitecture 80312 companion processor provides a
3 Performance Monitoring Unit (PMON) that can be utilized to provide
4 information that can be useful for fine tuning of code.  This text
5 file describes the API that's been developed for use by Linux kernel
6 programmers.  Note that to get the most usage out of the PMON,
7 I highly reccomend getting the XScale reference manual from Intel[1]
8 and looking at chapter 12.
9
10 To use the PMON, you must #include <asm-arm/arch-iop310/pmon.h> in your
11 source file.
12
13 Since there's only one PMON, only one user can currently use the PMON
14 at a given time.  To claim the PMON for usage, call iop310_pmon_claim() which
15 returns an identifier.  When you are done using the PMON, call
16 iop310_pmon_release() with the id you were given earlier.
17
18 The PMON consists of 14 registers that can be used for performance measurements.
19 By combining different statistics, you can derive complex performance metrics.
20
21 To start the PMON, just call iop310_pmon_start(mode).  Mode tells the PMON what
22 statistics to capture and can each be one of:
23
24     IOP310_PMU_MODE0
25     Performance Monitoring Disabled
26
27     IOP310_PMU_MODE1
28     Primary PCI bus and internal agents (bridge, dma Ch0, dam Ch1, patu)
29
30     IOP310_PMU_MODE2
31     Secondary PCI bus and internal agents (bridge, dma Ch0, dam Ch1, patu)
32
33     IOP310_PMU_MODE3
34     Secondary PCI bus and internal agents (external masters 0..2 and Intel
35     80312 I/O companion chip)
36
37     IOP310_PMU_MODE4
38     Secondary PCI bus and internal agents (external masters 3..5 and Intel
39     80312 I/O companion chip)
40
41     IOP310_PMU_MODE5
42     Intel 80312 I/O companion chip internal bus, DMA Channels and Application
43     Accelerator
44
45     IOP310_PMU_MODE6
46     Intel 80312 I/O companion chip internal bus, PATU, SATU and Intel 80200
47     processor
48
49     IOP310_PMU_MODE7
50     Intel 80312 I/O companion chip internal bus, Primary PCI bus, Secondary
51     PCI bus and Secondary PCI agents (external masters 0..5 & Intel 80312 I/O
52     companion chip)
53
54 To get the results back, call iop310_pmon_stop(&results) where results is
55 defined as follows:
56
57 typedef struct _iop310_pmon_result
58 {
59         u32 timestamp;                  /* Global Time Stamp Register */
60         u32 timestamp_overflow;         /* Time Stamp overflow count */
61         u32 event_count[14];            /* Programmable Event Counter
62                                            Registers 1-14 */
63         u32 event_overflow[14];         /* Overflow counter for PECR1-14 */
64 } iop310_pmon_res_t;
65
66
67 --
68 This code is still under development, so please feel free to send patches,
69 questions, comments, etc to me.
70
71 Deepak Saxena <dsaxena@mvista.com>