IxPerfProfAcc.h 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358
  1. /**
  2. * @file IxPerfProfAcc.h
  3. *
  4. * @brief Header file for the IXP400 Perf Prof component (IxPerfProfAcc)
  5. *
  6. *
  7. * @par
  8. * IXP400 SW Release version 2.0
  9. *
  10. * -- Copyright Notice --
  11. *
  12. * @par
  13. * Copyright 2001-2005, Intel Corporation.
  14. * All rights reserved.
  15. *
  16. * @par
  17. * Redistribution and use in source and binary forms, with or without
  18. * modification, are permitted provided that the following conditions
  19. * are met:
  20. * 1. Redistributions of source code must retain the above copyright
  21. * notice, this list of conditions and the following disclaimer.
  22. * 2. Redistributions in binary form must reproduce the above copyright
  23. * notice, this list of conditions and the following disclaimer in the
  24. * documentation and/or other materials provided with the distribution.
  25. * 3. Neither the name of the Intel Corporation nor the names of its contributors
  26. * may be used to endorse or promote products derived from this software
  27. * without specific prior written permission.
  28. *
  29. * @par
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  31. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  32. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  33. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  34. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  38. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  39. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  40. * SUCH DAMAGE.
  41. *
  42. * @par
  43. * -- End of Copyright Notice --
  44. */
  45. /**
  46. * @defgroup IxPerfProfAcc IXP400 Performance Profiling (IxPerfProfAcc) API
  47. *
  48. * @brief IXP400 Performance Profiling Utility component Public API.
  49. * @li NOTE: Xcycle measurement is not supported in Linux.
  50. *
  51. *
  52. * @{
  53. */
  54. #ifndef IXPERFPROFACC_H
  55. #define IXPERFPROFACC_H
  56. #include "IxOsal.h"
  57. #ifdef __linux
  58. #include <linux/proc_fs.h>
  59. #endif
  60. /*
  61. * Section for #define
  62. */
  63. /**
  64. * @ingroup IxPerfProfAcc
  65. *
  66. * @def IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES
  67. *
  68. * @brief This is the maximum number of profiling samples allowed, which can be
  69. * modified according to the user's discretion
  70. */
  71. #define IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES 0xFFFF
  72. /**
  73. * @ingroup IxPerfProfAcc
  74. *
  75. * @def IX_PERFPROF_ACC_BUS_PMU_MAX_PECS
  76. *
  77. * @brief This is the maximum number of Programmable Event Counters available.
  78. * This is a hardware specific and fixed value. Do not change.
  79. *
  80. */
  81. #define IX_PERFPROF_ACC_BUS_PMU_MAX_PECS 7
  82. /**
  83. * @ingroup IxPerfProfAcc
  84. *
  85. * @def IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
  86. *
  87. * @brief Max number of measurement allowed. This constant is used when
  88. * creating storage array for Xcycle. When run in continuous mode,
  89. * Xcycle will wrap around and re-use buffer.
  90. */
  91. #define IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS 600
  92. #ifdef __linux
  93. /**
  94. * @ingroup IxPerfProfAcc
  95. *
  96. * @def IX_PERFPROF_ACC_XSCALE_PMU_SYMBOL_ACCURACY
  97. *
  98. * @brief Level of accuracy required for matching the PC Address to
  99. * symbol address. This is used when the XScale PMU time/event
  100. * sampling functions get the PC address and search for the
  101. * corresponding symbol address.
  102. */
  103. #define IX_PERFPROF_ACC_XSCALE_PMU_SYMBOL_ACCURACY 0xffff
  104. #endif /*__linux*/
  105. /**
  106. * @ingroup IxPerfProfAcc
  107. *
  108. * @def IX_PERFPROF_ACC_LOG
  109. *
  110. * @brief Mechanism for logging a formatted message for the PerfProfAcc component
  111. *
  112. * @param level UINT32 [in] - trace level
  113. * @param device UINT32 [in] - output device
  114. * @param str char* [in] - format string, similar to printf().
  115. * @param a UINT32 [in] - first argument to display
  116. * @param b UINT32 [in] - second argument to display
  117. * @param c UINT32 [in] - third argument to display
  118. * @param d UINT32 [in] - fourth argument to display
  119. * @param e UINT32 [in] - fifth argument to display
  120. * @param f UINT32 [in] - sixth argument to display
  121. *
  122. * @return none
  123. */
  124. #ifndef NDEBUG
  125. #define IX_PERFPROF_ACC_LOG(level, device, str, a, b, c, d, e, f)\
  126. (ixOsalLog (level, device, str, a, b, c, d, e, f))
  127. #else /*do nothing*/
  128. #define IX_PERFPROF_ACC_LOG(level, device, str, a, b, c, d, e, f)
  129. #endif /*ifdef NDEBUG */
  130. /*
  131. * Section for struct
  132. */
  133. /**
  134. * @brief contains summary of samples taken
  135. *
  136. * Structure contains all details of each program counter value - frequency
  137. * that PC occurs
  138. */
  139. typedef struct
  140. {
  141. UINT32 programCounter; /**<the program counter value of the sample*/
  142. UINT32 freq; /**<the frequency of the occurence of the sample*/
  143. } IxPerfProfAccXscalePmuSamplePcProfile;
  144. /**
  145. * @brief contains results of a counter
  146. *
  147. * Structure contains the results of a counter, which are split into the lower
  148. * and upper 32 bits of the final count
  149. */
  150. typedef struct
  151. {
  152. UINT32 lower32BitsEventCount; /**<lower 32bits value of the event counter*/
  153. UINT32 upper32BitsEventCount; /**<upper 32bits value of the event counter*/
  154. } IxPerfProfAccXscalePmuEvtCnt;
  155. /**
  156. * @brief contains results of counters and their overflow
  157. *
  158. * Structure contains all values of counters and associated overflows. The
  159. * specific event and clock counters are determined by the user
  160. */
  161. typedef struct
  162. {
  163. UINT32 clk_value; /**<current value of clock counter*/
  164. UINT32 clk_samples; /**<number of clock counter overflows*/
  165. UINT32 event1_value; /**<current value of event 1 counter*/
  166. UINT32 event1_samples; /**<number of event 1 counter overflows*/
  167. UINT32 event2_value; /**<current value of event 2 counter*/
  168. UINT32 event2_samples; /**<number of event 2 counter overflows*/
  169. UINT32 event3_value; /**<current value of event 3 counter*/
  170. UINT32 event3_samples; /**<number of event 3 counter overflows*/
  171. UINT32 event4_value; /**<current value of event 4 counter*/
  172. UINT32 event4_samples; /**<number of event 4 counter overflows*/
  173. } IxPerfProfAccXscalePmuResults;
  174. /**
  175. *
  176. * @brief Results obtained from Xcycle run
  177. */
  178. typedef struct
  179. {
  180. float maxIdlePercentage; /**<maximum percentage of Idle cycles*/
  181. float minIdlePercentage; /**<minimum percentage of Idle cycles*/
  182. float aveIdlePercentage; /**<average percentage of Idle cycles*/
  183. UINT32 totalMeasurements; /**<total number of measurement made */
  184. } IxPerfProfAccXcycleResults;
  185. /**
  186. *
  187. * @brief Results obtained from running the Bus Pmu component. The results
  188. * are obtained when the get functions is called.
  189. *
  190. */
  191. typedef struct
  192. {
  193. UINT32 statsToGetLower27Bit[IX_PERFPROF_ACC_BUS_PMU_MAX_PECS]; /**<Lower 27 Bit of counter value */
  194. UINT32 statsToGetUpper32Bit[IX_PERFPROF_ACC_BUS_PMU_MAX_PECS]; /**<Upper 32 Bit of counter value */
  195. } IxPerfProfAccBusPmuResults;
  196. /*
  197. * Section for enum
  198. */
  199. /**
  200. * @ingroup IxPerfProfAcc
  201. *
  202. * @enum IxPerfProfAccBusPmuEventCounters1
  203. *
  204. * @brief Type of bus pmu events supported on PEC 1.
  205. *
  206. * Lists all bus pmu events.
  207. */
  208. typedef enum
  209. {
  210. IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEA_GRANT_SELECT = 1, /**< Select North NPEA grant on PEC1*/
  211. IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEB_GRANT_SELECT, /**< Select North NPEB grant on PEC1*/
  212. IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEC_GRANT_SELECT, /**< Select North NPEC grant on PEC1*/
  213. IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_BUS_IDLE_SELECT, /**< Select North bus idle on PEC1*/
  214. IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEA_REQ_SELECT, /**< Select North NPEA req on PEC1*/
  215. IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEB_REQ_SELECT, /**< Select North NPEB req on PEC1*/
  216. IX_PERFPROF_ACC_BUS_PMU_PEC1_NORTH_NPEC_REQ_SELECT, /**< Select North NPEC req on PEC1*/
  217. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_GSKT_GRANT_SELECT, /**< Select south gasket grant on PEC1*/
  218. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_ABB_GRANT_SELECT, /**< Select south abb grant on PEC1*/
  219. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_PCI_GRANT_SELECT, /**< Select south pci grant on PEC1*/
  220. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_APB_GRANT_SELECT, /**< Select south apb grant on PEC1*/
  221. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_GSKT_REQ_SELECT, /**< Select south gasket request on PEC1*/
  222. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_ABB_REQ_SELECT, /**< Select south abb request on PEC1*/
  223. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_PCI_REQ_SELECT, /**< Select south pci request on PEC1*/
  224. IX_PERFPROF_ACC_BUS_PMU_PEC1_SOUTH_APB_REQ_SELECT, /**< Select south apb request on PEC1*/
  225. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_0_HIT_SELECT, /**< Select sdram0 hit on PEC1*/
  226. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_1_HIT_SELECT, /**< Select sdram1 hit on PEC1*/
  227. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC1*/
  228. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC1*/
  229. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_4_MISS_SELECT, /**< Select sdram4 miss on PEC1*/
  230. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_5_MISS_SELECT, /**< Select sdram5 miss on PEC1*/
  231. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC1*/
  232. IX_PERFPROF_ACC_BUS_PMU_PEC1_SDR_7_MISS_SELECT /**< Select sdram7 miss on PEC1*/
  233. } IxPerfProfAccBusPmuEventCounters1;
  234. /**
  235. * @ingroup IxPerfProfAcc
  236. *
  237. * @enum IxPerfProfAccBusPmuEventCounters2
  238. *
  239. * @brief Type of bus pmu events supported on PEC 2.
  240. *
  241. * Lists all bus pmu events.
  242. */
  243. typedef enum
  244. {
  245. IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEA_XFER_SELECT = 24, /**< Select North NPEA transfer on PEC2*/
  246. IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEB_XFER_SELECT, /**< Select North NPEB transfer on PEC2*/
  247. IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEC_XFER_SELECT, /**< Select North NPEC transfer on PEC2*/
  248. IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_BUS_WRITE_SELECT, /**< Select North bus write on PEC2*/
  249. IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEA_OWN_SELECT, /**< Select North NPEA own on PEC2*/
  250. IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEB_OWN_SELECT, /**< Select North NPEB own on PEC2*/
  251. IX_PERFPROF_ACC_BUS_PMU_PEC2_NORTH_NPEC_OWN_SELECT, /**< Select North NPEC own on PEC2*/
  252. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_GSKT_XFER_SELECT, /**< Select South gasket transfer on PEC2*/
  253. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_ABB_XFER_SELECT, /**< Select South abb transfer on PEC2*/
  254. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_PCI_XFER_SELECT, /**< Select South pci transfer on PEC2*/
  255. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_APB_XFER_SELECT, /**< Select South apb transfer on PEC2*/
  256. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_GSKT_OWN_SELECT, /**< Select South gasket own on PEC2*/
  257. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_ABB_OWN_SELECT, /**< Select South abb own on PEC2*/
  258. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_PCI_OWN_SELECT, /**< Select South pci own on PEC2*/
  259. IX_PERFPROF_ACC_BUS_PMU_PEC2_SOUTH_APB_OWN_SELECT, /**< Select South apb own transfer on PEC2*/
  260. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_1_HIT_SELECT, /**< Select sdram1 hit on PEC2*/
  261. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC2*/
  262. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC2*/
  263. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC2*/
  264. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_5_MISS_SELECT, /**< Select sdram5 miss on PEC2*/
  265. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC2*/
  266. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC2*/
  267. IX_PERFPROF_ACC_BUS_PMU_PEC2_SDR_0_MISS_SELECT /**< Select sdram0 miss on PEC2*/
  268. } IxPerfProfAccBusPmuEventCounters2;
  269. /**
  270. * @ingroup IxPerfProfAcc
  271. *
  272. * @enum IxPerfProfAccBusPmuEventCounters3
  273. *
  274. * @brief Type of bus pmu events supported on PEC 3.
  275. *
  276. * Lists all bus pmu events.
  277. */
  278. typedef enum
  279. {
  280. IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEA_RETRY_SELECT = 47, /**< Select north NPEA retry on PEC3*/
  281. IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEB_RETRY_SELECT, /**< Select north NPEB retry on PEC3*/
  282. IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEC_RETRY_SELECT, /**< Select north NPEC retry on PEC3*/
  283. IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_BUS_READ_SELECT, /**< Select north bus read on PEC3*/
  284. IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEA_WRITE_SELECT, /**< Select north NPEA write on PEC3*/
  285. IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC3*/
  286. IX_PERFPROF_ACC_BUS_PMU_PEC3_NORTH_NPEC_WRITE_SELECT, /**< Select north NPEC wirte on PEC3*/
  287. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_GSKT_RETRY_SELECT, /**< Select south gasket retry on PEC3*/
  288. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_ABB_RETRY_SELECT, /**< Select south abb retry on PEC3*/
  289. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_PCI_RETRY_SELECT, /**< Select south pci retry on PEC3*/
  290. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_APB_RETRY_SELECT, /**< Select south apb retry on PEC3*/
  291. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_GSKT_WRITE_SELECT, /**< Select south gasket write on PEC3*/
  292. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_ABB_WRITE_SELECT, /**< Select south abb write on PEC3*/
  293. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_PCI_WRITE_SELECT, /**< Select south pci write on PEC3*/
  294. IX_PERFPROF_ACC_BUS_PMU_PEC3_SOUTH_APB_WRITE_SELECT, /**< Select south apb write on PEC3*/
  295. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_2_HIT_SELECT, /**< Select sdram2 hit on PEC3*/
  296. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC3*/
  297. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC3*/
  298. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC3*/
  299. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_6_MISS_SELECT, /**< Select sdram6 miss on PEC3*/
  300. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC3*/
  301. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_0_MISS_SELECT, /**< Select sdram0 miss on PEC3*/
  302. IX_PERFPROF_ACC_BUS_PMU_PEC3_SDR_1_MISS_SELECT /**< Select sdram1 miss on PEC3*/
  303. } IxPerfProfAccBusPmuEventCounters3;
  304. /**
  305. * @ingroup IxPerfProfAcc
  306. *
  307. * @enum IxPerfProfAccBusPmuEventCounters4
  308. *
  309. * @brief Type of bus pmu events supported on PEC 4.
  310. *
  311. * Lists all bus pmu events.
  312. */
  313. typedef enum
  314. {
  315. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_PCI_SPLIT_SELECT = 70, /**< Select south pci split on PEC4*/
  316. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_EXP_SPLIT_SELECT, /**< Select south expansion split on PEC4*/
  317. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_GRANT_SELECT, /**< Select south apb grant on PEC4*/
  318. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_XFER_SELECT, /**< Select south apb transfer on PEC4*/
  319. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_GSKT_READ_SELECT, /**< Select south gasket read on PEC4*/
  320. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_ABB_READ_SELECT, /**< Select south abb read on PEC4*/
  321. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_PCI_READ_SELECT, /**< Select south pci read on PEC4*/
  322. IX_PERFPROF_ACC_BUS_PMU_PEC4_SOUTH_APB_READ_SELECT, /**< Select south apb read on PEC4*/
  323. IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_ABB_SPLIT_SELECT, /**< Select north abb split on PEC4*/
  324. IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEA_REQ_SELECT, /**< Select north NPEA req on PEC4*/
  325. IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEA_READ_SELECT, /**< Select north NPEA read on PEC4*/
  326. IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEB_READ_SELECT, /**< Select north NPEB read on PEC4*/
  327. IX_PERFPROF_ACC_BUS_PMU_PEC4_NORTH_NPEC_READ_SELECT, /**< Select north NPEC read on PEC4*/
  328. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_3_HIT_SELECT, /**< Select sdram3 hit on PEC4*/
  329. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_4_HIT_SELECT, /**< Select sdram4 hit on PEC4*/
  330. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC4*/
  331. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_6_HIT_SELECT, /**< Select sdram6 hit on PEC4*/
  332. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_7_MISS_SELECT, /**< Select sdram7 miss on PEC4*/
  333. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_0_MISS_SELECT, /**< Select sdram0 miss on PEC4*/
  334. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_1_MISS_SELECT, /**< Select sdram1 miss on PEC4*/
  335. IX_PERFPROF_ACC_BUS_PMU_PEC4_SDR_2_MISS_SELECT /**< Select sdram2 miss on PEC4*/
  336. } IxPerfProfAccBusPmuEventCounters4;
  337. /**
  338. * @ingroup IxPerfProfAcc
  339. *
  340. * @enum IxPerfProfAccBusPmuEventCounters5
  341. *
  342. * @brief Type of bus pmu events supported on PEC 5.
  343. *
  344. * Lists all bus pmu events.
  345. */
  346. typedef enum
  347. {
  348. IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_GRANT_SELECT = 91, /**< Select south abb grant on PEC5*/
  349. IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_XFER_SELECT, /**< Select south abb transfer on PEC5*/
  350. IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_RETRY_SELECT, /**< Select south abb retry on PEC5*/
  351. IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_EXP_SPLIT_SELECT, /**< Select south expansion split on PEC5*/
  352. IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_REQ_SELECT, /**< Select south abb request on PEC5*/
  353. IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_ABB_OWN_SELECT, /**< Select south abb own on PEC5*/
  354. IX_PERFPROF_ACC_BUS_PMU_PEC5_SOUTH_BUS_IDLE_SELECT, /**< Select south bus idle on PEC5*/
  355. IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_GRANT_SELECT, /**< Select north NPEB grant on PEC5*/
  356. IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_XFER_SELECT, /**< Select north NPEB transfer on PEC5*/
  357. IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_RETRY_SELECT, /**< Select north NPEB retry on PEC5*/
  358. IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_REQ_SELECT, /**< Select north NPEB request on PEC5*/
  359. IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_OWN_SELECT, /**< Select north NPEB own on PEC5*/
  360. IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC5*/
  361. IX_PERFPROF_ACC_BUS_PMU_PEC5_NORTH_NPEB_READ_SELECT, /**< Select north NPEB read on PEC5*/
  362. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_4_HIT_SELECT, /**< Select north sdram4 hit on PEC5*/
  363. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_5_HIT_SELECT, /**< Select north sdram5 hit on PEC5*/
  364. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_6_HIT_SELECT, /**< Select north sdram6 hit on PEC5*/
  365. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_7_HIT_SELECT, /**< Select north sdram7 hit on PEC5*/
  366. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_0_MISS_SELECT, /**< Select north sdram0 miss on PEC5*/
  367. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_1_MISS_SELECT, /**< Select north sdram1 miss on PEC5*/
  368. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_2_MISS_SELECT, /**< Select north sdram2 miss on PEC5*/
  369. IX_PERFPROF_ACC_BUS_PMU_PEC5_SDR_3_MISS_SELECT /**< Select north sdram3 miss on PEC5*/
  370. } IxPerfProfAccBusPmuEventCounters5;
  371. /**
  372. * @ingroup IxPerfProfAcc
  373. *
  374. * @enum IxPerfProfAccBusPmuEventCounters6
  375. *
  376. * @brief Type of bus pmu events supported on PEC 6.
  377. *
  378. * Lists all bus pmu events.
  379. */
  380. typedef enum
  381. {
  382. IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_GRANT_SELECT = 113, /**< Select south pci grant on PEC6*/
  383. IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_XFER_SELECT, /**< Select south pci transfer on PEC6*/
  384. IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_RETRY_SELECT, /**< Select south pci retry on PEC6*/
  385. IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_SPLIT_SELECT, /**< Select south pci split on PEC6*/
  386. IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_REQ_SELECT, /**< Select south pci request on PEC6*/
  387. IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_PCI_OWN_SELECT, /**< Select south pci own on PEC6*/
  388. IX_PERFPROF_ACC_BUS_PMU_PEC6_SOUTH_BUS_WRITE_SELECT, /**< Select south pci write on PEC6*/
  389. IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_GRANT_SELECT, /**< Select north NPEC grant on PEC6*/
  390. IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_XFER_SELECT, /**< Select north NPEC transfer on PEC6*/
  391. IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_RETRY_SELECT, /**< Select north NPEC retry on PEC6*/
  392. IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_REQ_SELECT, /**< Select north NPEC request on PEC6*/
  393. IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_OWN_SELECT, /**< Select north NPEC own on PEC6*/
  394. IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEB_WRITE_SELECT, /**< Select north NPEB write on PEC6*/
  395. IX_PERFPROF_ACC_BUS_PMU_PEC6_NORTH_NPEC_READ_SELECT, /**< Select north NPEC read on PEC6*/
  396. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_5_HIT_SELECT, /**< Select sdram5 hit on PEC6*/
  397. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_6_HIT_SELECT, /**< Select sdram6 hit on PEC6*/
  398. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_7_HIT_SELECT, /**< Select sdram7 hit on PEC6*/
  399. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_0_HIT_SELECT, /**< Select sdram0 hit on PEC6*/
  400. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_1_MISS_SELECT, /**< Select sdram1 miss on PEC6*/
  401. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_2_MISS_SELECT, /**< Select sdram2 miss on PEC6*/
  402. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_3_MISS_SELECT, /**< Select sdram3 miss on PEC6*/
  403. IX_PERFPROF_ACC_BUS_PMU_PEC6_SDR_4_MISS_SELECT /**< Select sdram4 miss on PEC6*/
  404. } IxPerfProfAccBusPmuEventCounters6;
  405. /**
  406. * @ingroup IxPerfProfAcc
  407. *
  408. * @enum IxPerfProfAccBusPmuEventCounters7
  409. *
  410. * @brief Type of bus pmu events supported on PEC 7.
  411. *
  412. * Lists all bus pmu events.
  413. */
  414. typedef enum
  415. {
  416. IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_RETRY_SELECT = 135, /**< Select south apb retry on PEC7*/
  417. IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_REQ_SELECT, /**< Select south apb request on PEC7*/
  418. IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_APB_OWN_SELECT, /**< Select south apb own on PEC7*/
  419. IX_PERFPROF_ACC_BUS_PMU_PEC7_SOUTH_BUS_READ_SELECT, /**< Select south bus read on PEC7*/
  420. IX_PERFPROF_ACC_BUS_PMU_PEC7_CYCLE_COUNT_SELECT /**< Select cycle count on PEC7*/
  421. } IxPerfProfAccBusPmuEventCounters7;
  422. /**
  423. * @ingroup IxPerfProfAcc
  424. *
  425. * @enum IxPerfProfAccXscalePmuEvent
  426. *
  427. * @brief Type of xscale pmu events supported
  428. *
  429. * Lists all xscale pmu events. The maximum is a default value that the user
  430. * should not exceed.
  431. */
  432. typedef enum
  433. {
  434. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_CACHE_MISS=0, /**< cache miss*/
  435. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_CACHE_INSTRUCTION,/**< cache instruction*/
  436. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_STALL, /**< event stall*/
  437. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_INST_TLB_MISS, /**< instruction tlb miss*/
  438. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_TLB_MISS, /**< data tlb miss*/
  439. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_BRANCH_EXEC, /**< branch executed*/
  440. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_BRANCH_MISPREDICT, /**<branch mispredict*/
  441. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_INST_EXEC, /**< instruction executed*/
  442. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_FULL_EVERYCYCLE, /**<
  443. *Stall - data cache
  444. *buffers are full.
  445. *This event occurs
  446. *every cycle where
  447. *condition present
  448. */
  449. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_ONCE, /**<
  450. *Stall - data cache buffers are
  451. *full.This event occurs once
  452. *for each contiguous sequence
  453. */
  454. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_ACCESS, /**< data cache access*/
  455. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_MISS, /**< data cache miss*/
  456. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_DATA_CACHE_WRITEBACK, /**<data cache
  457. *writeback
  458. */
  459. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_SW_CHANGE_PC, /**< sw change pc*/
  460. IX_PERFPROF_ACC_XSCALE_PMU_EVENT_MAX /**< max value*/
  461. } IxPerfProfAccXscalePmuEvent;
  462. /**
  463. * @ingroup IxPerfProfAcc
  464. *
  465. * @enum IxPerfProfAccStatus
  466. *
  467. * @brief Invalid Status Definitions
  468. *
  469. * These status will be used by the APIs to return to the user.
  470. */
  471. typedef enum
  472. {
  473. IX_PERFPROF_ACC_STATUS_SUCCESS = IX_SUCCESS, /**< success*/
  474. IX_PERFPROF_ACC_STATUS_FAIL = IX_FAIL, /**< fail*/
  475. IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS,/**<another utility in
  476. *progress
  477. */
  478. IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS, /**<measurement in
  479. *progress
  480. */
  481. IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE, /**<no baseline yet*/
  482. IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_REQUEST_OUT_OF_RANGE, /**<
  483. * Measurement chosen
  484. * is out of range
  485. */
  486. IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL, /**<
  487. * Cannot set
  488. * task priority
  489. */
  490. IX_PERFPROF_ACC_STATUS_XCYCLE_THREAD_CREATE_FAIL, /**<
  491. * Fail create thread
  492. */
  493. IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_RESTORE_FAIL, /**<
  494. *cannot restore
  495. *priority
  496. */
  497. IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING, /**< xcycle not running*/
  498. IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID, /**< invalid number
  499. *entered
  500. */
  501. IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID, /**< invalid pmu event*/
  502. IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED, /**<a start process
  503. *was not called
  504. *before attempting
  505. *a stop or results
  506. *get
  507. */
  508. IX_PERFPROF_ACC_STATUS_BUS_PMU_MODE_ERROR, /**< invalid mode*/
  509. IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC1_ERROR, /**< invalid pec1 entered*/
  510. IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC2_ERROR, /**< invalid pec2 entered*/
  511. IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC3_ERROR, /**< invalid pec3 entered*/
  512. IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC4_ERROR, /**< invalid pec4 entered*/
  513. IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC5_ERROR, /**< invalid pec5 entered*/
  514. IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC6_ERROR, /**< invalid pec6 entered*/
  515. IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC7_ERROR, /**< invalid pec7 entered*/
  516. IX_PERFPROF_ACC_STATUS_BUS_PMU_START_NOT_CALLED, /**<a start process
  517. *was not called
  518. *before attempting
  519. *a stop
  520. */
  521. IX_PERFPROF_ACC_STATUS_COMPONENT_NOT_SUPPORTED /**<Device or OS does not support component*/
  522. } IxPerfProfAccStatus;
  523. /**
  524. * @ingroup IxPerfProfAcc
  525. *
  526. * @enum IxPerfProfAccBusPmuMode
  527. *
  528. * @brief State selection of counters.
  529. *
  530. * These states will be used to determine the counters whose values are to be
  531. * read.
  532. */
  533. typedef enum
  534. {
  535. IX_PERFPROF_ACC_BUS_PMU_MODE_HALT=0, /**< halt state*/
  536. IX_PERFPROF_ACC_BUS_PMU_MODE_SOUTH, /**< south state*/
  537. IX_PERFPROF_ACC_BUS_PMU_MODE_NORTH, /**< north state*/
  538. IX_PERFPROF_ACC_BUS_PMU_MODE_SDRAM /**< SDRAM state*/
  539. } IxPerfProfAccBusPmuMode;
  540. /*
  541. * Section for prototypes interface functions
  542. */
  543. /**
  544. * @ingroup IxPerfProfAcc
  545. *
  546. * @fn ixPerfProfAccXscalePmuEventCountStart(
  547. BOOL clkCntDiv,
  548. UINT32 numEvents,
  549. IxPerfProfAccXscalePmuEvent pmuEvent1,
  550. IxPerfProfAccXscalePmuEvent pmuEvent2,
  551. IxPerfProfAccXscalePmuEvent pmuEvent3,
  552. IxPerfProfAccXscalePmuEvent pmuEvent4 )
  553. *
  554. * @brief This API will start the clock and event counting
  555. *
  556. * @param clkCntDiv BOOL [in] - enables/disables the clock divider. When
  557. * true, the divider is enabled and the clock count will be incremented
  558. * by one at each 64th processor clock cycle. When false, the divider
  559. * is disabled and the clock count will be incremented at every
  560. * processor clock cycle.
  561. * @param numEvents UINT32 [in] - the number of PMU events that are to be
  562. * monitored as specified by the user. For clock counting only, this
  563. * is set to zero.
  564. * @param pmuEvent1 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  565. * event to be monitored by counter 1
  566. * @param pmuEvent2 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  567. * event to be monitored by counter 2
  568. * @param pmuEvent3 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  569. * event to be monitored by counter 3
  570. * @param pmuEvent4 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  571. * event to be monitored by counter 4
  572. *
  573. * This API will start the clock and xscale PMU event counting. Up to
  574. * 4 events can be monitored simultaneously. This API has to be called before
  575. * ixPerfProfAccXscalePmuEventCountStop can be called.
  576. *
  577. * @return
  578. * - IX_PERFPROF_ACC_STATUS_SUCCESS if clock and events counting are
  579. * started successfully
  580. * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the counting
  581. * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID if the number of events
  582. * specified is out of the valid range
  583. * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID if the value of the PMU
  584. * event specified does not exist
  585. * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
  586. * running
  587. *
  588. * @li Reentrant : no
  589. * @li ISR Callable : no
  590. *
  591. */
  592. PUBLIC IxPerfProfAccStatus
  593. ixPerfProfAccXscalePmuEventCountStart(
  594. BOOL clkCntDiv,
  595. UINT32 numEvents,
  596. IxPerfProfAccXscalePmuEvent pmuEvent1,
  597. IxPerfProfAccXscalePmuEvent pmuEvent2,
  598. IxPerfProfAccXscalePmuEvent pmuEvent3,
  599. IxPerfProfAccXscalePmuEvent pmuEvent4 );
  600. /**
  601. * @ingroup IxPerfProfAcc
  602. *
  603. * @fn ixPerfProfAccXscalePmuEventCountStop (
  604. IxPerfProfAccXscalePmuResults *eventCountStopResults)
  605. *
  606. * @brief This API will stop the clock and event counting
  607. *
  608. * @param *eventCountStopResults @ref IxPerfProfAccXscalePmuResults [out] - pointer
  609. * to struct containing results of counters and their overflow. It is the
  610. * users's responsibility to allocate the memory for this pointer.
  611. *
  612. * This API will stop the clock and xscale PMU events that are being counted.
  613. * The results of the clock and events count will be stored in the pointer
  614. * allocated by the user. It can only be called once
  615. * IxPerfProfAccEventCountStart has been called.
  616. *
  617. * @return
  618. * - IX_PERFPROF_ACC_STATUS_SUCCESS if clock and events counting are
  619. * stopped successfully
  620. * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
  621. * ixPerfProfAccXscalePmuEventCountStart is not called first.
  622. *
  623. * @li Reentrant : no
  624. * @li ISR Callable : no
  625. *
  626. */
  627. PUBLIC IxPerfProfAccStatus
  628. ixPerfProfAccXscalePmuEventCountStop(
  629. IxPerfProfAccXscalePmuResults *eventCountStopResults);
  630. /**
  631. * @ingroup IxPerfProfAcc
  632. *
  633. * @fn ixPerfProfAccXscalePmuTimeSampStart(
  634. UINT32 samplingRate,
  635. BOOL clkCntDiv)
  636. *
  637. * @brief Starts the time based sampling
  638. *
  639. * @param samplingRate UINT32 [in] - sampling rate is the number of
  640. * clock counts before a counter overflow interrupt is generated,
  641. * at which, a sample is taken; the rate specified cannot be greater
  642. * than the counter size of 32bits or set to zero.
  643. * @param clkCntDiv BOOL [in] - enables/disables the clock divider. When
  644. * true, the divider is enabled and the clock count will be incremented
  645. * by one at each 64th processor clock cycle. When false, the divider
  646. * is disabled and the clock count will be incremented at every
  647. * processor clock cycle.
  648. *
  649. * This API starts the time based sampling to determine the frequency with
  650. * which lines of code are being executed. Sampling is done at the rate
  651. * specified by the user. At each sample,the value of the program counter
  652. * is determined. Each of these occurrences are recorded to determine the
  653. * frequency with which the Xscale code is being executed. This API has to be
  654. * called before ixPerfProfAccXscalePmuTimeSampStop can be called.
  655. *
  656. * @return
  657. * - IX_PERFPROF_ACC_STATUS_SUCCESS if time based sampling is started
  658. * successfully
  659. * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the sampling
  660. * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
  661. * running
  662. *
  663. * @li Reentrant : no
  664. * @li ISR Callable : no
  665. *
  666. */
  667. PUBLIC IxPerfProfAccStatus
  668. ixPerfProfAccXscalePmuTimeSampStart(
  669. UINT32 samplingRate,
  670. BOOL clkCntDiv);
  671. /**
  672. * @ingroup IxPerfProfAcc
  673. *
  674. * @fn ixPerfProfAccXscalePmuTimeSampStop(
  675. IxPerfProfAccXscalePmuEvtCnt *clkCount,
  676. IxPerfProfAccXscalePmuSamplePcProfile *timeProfile)
  677. *
  678. * @brief Stops the time based sampling
  679. *
  680. * @param *clkCount @ref IxPerfProfAccXscalePmuEvtCnt [out] - pointer to the
  681. * struct containing the final clock count and its overflow. It is the
  682. * user's responsibility to allocate the memory for this pointer.
  683. * @param *timeProfile @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
  684. * pointer to the array of profiles for each program counter value;
  685. * the user should set the size of the array to
  686. * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the user's
  687. * responsibility to allocate the memory for this pointer.
  688. *
  689. * This API stops the time based sampling. The results are stored in the
  690. * pointers allocated by the user. It can only be called once
  691. * ixPerfProfAccXscalePmuTimeSampStart has been called.
  692. *
  693. * @return
  694. * - IX_PERFPROF_ACC_STATUS_SUCCESS if time based sampling is stopped
  695. * successfully
  696. * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
  697. * ixPerfProfAccXscalePmuTimeSampStart not called first
  698. *
  699. * @li Reentrant : no
  700. * @li ISR Callable : no
  701. *
  702. */
  703. PUBLIC IxPerfProfAccStatus
  704. ixPerfProfAccXscalePmuTimeSampStop(
  705. IxPerfProfAccXscalePmuEvtCnt *clkCount,
  706. IxPerfProfAccXscalePmuSamplePcProfile *timeProfile);
  707. /**
  708. * @ingroup IxPerfProfAcc
  709. *
  710. * @fn ixPerfProfAccXscalePmuEventSampStart(
  711. UINT32 numEvents,
  712. IxPerfProfAccXscalePmuEvent pmuEvent1,
  713. UINT32 eventRate1,
  714. IxPerfProfAccXscalePmuEvent pmuEvent2,
  715. UINT32 eventRate2,
  716. IxPerfProfAccXscalePmuEvent pmuEvent3,
  717. UINT32 eventRate3,
  718. IxPerfProfAccXscalePmuEvent pmuEvent4,
  719. UINT32 eventRate4)
  720. *
  721. * @brief Starts the event based sampling
  722. *
  723. * @param numEvents UINT32 [in] - the number of PMU events that are
  724. * to be monitored as specified by the user. The value should be
  725. * between 1-4 events at a time.
  726. * @param pmuEvent1 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  727. * event to be monitored by counter 1
  728. * @param eventRate1 UINT32 [in] - sampling rate of counter 1. The rate is
  729. * the number of events before a sample taken. If 0 is specified, the
  730. * the full counter value (0xFFFFFFFF) is used. The rate must not be
  731. * greater than the full counter value.
  732. * @param pmuEvent2 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  733. * event to be monitored by counter 2
  734. * @param eventRate2 UINT32 [in] - sampling rate of counter 2. The rate is
  735. * the number of events before a sample taken. If 0 is specified, the
  736. * full counter value (0xFFFFFFFF) is used. The rate must not be
  737. * greater than the full counter value.
  738. * @param pmuEvent3 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  739. * event to be monitored by counter 3
  740. * @param eventRate3 UINT32 [in] - sampling rate of counter 3. The rate is
  741. * the number of events before a sample taken. If 0 is specified, the
  742. * full counter value (0xFFFFFFFF) is used. The rate must not be
  743. * greater than the full counter value.
  744. * @param pmuEvent4 @ref IxPerfProfAccXscalePmuEvent [in] - the specific PMU
  745. * event to be monitored by counter 4
  746. * @param eventRate4 UINT32 [in] - sampling rate of counter 4. The rate is
  747. * the number of events before a sample taken. If 0 is specified, the
  748. * full counter value (0xFFFFFFFF) is used. The rate must not be
  749. * greater than the full counter value.
  750. *
  751. * Starts the event based sampling to determine the frequency with
  752. * which events are being executed. The sampling rate is the number of events,
  753. * as specified by the user, before a counter overflow interrupt is
  754. * generated. A sample is taken at each counter overflow interrupt. At each
  755. * sample,the value of the program counter determines the corresponding
  756. * location in the code. Each of these occurrences are recorded to determine
  757. * the frequency with which the Xscale code in each event is executed. This API
  758. * has to be called before ixPerfProfAccXscalePmuEventSampStop can be called.
  759. *
  760. * @return
  761. * - IX_PERFPROF_ACC_STATUS_SUCCESS if event based sampling is started
  762. * successfully
  763. * - IX_PERFPROF_ACC_STATUS_FAIL if unable to start the sampling
  764. * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_NUM_INVALID if the number of events
  765. * specified is out of the valid range
  766. * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_EVENT_INVALID if the value of the
  767. * PMU event specified does not exist
  768. * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
  769. * running
  770. *
  771. * @li Reentrant : no
  772. * @li ISR Callable : no
  773. *
  774. */
  775. PUBLIC IxPerfProfAccStatus
  776. ixPerfProfAccXscalePmuEventSampStart(
  777. UINT32 numEvents,
  778. IxPerfProfAccXscalePmuEvent pmuEvent1,
  779. UINT32 eventRate1,
  780. IxPerfProfAccXscalePmuEvent pmuEvent2,
  781. UINT32 eventRate2,
  782. IxPerfProfAccXscalePmuEvent pmuEvent3,
  783. UINT32 eventRate3,
  784. IxPerfProfAccXscalePmuEvent pmuEvent4,
  785. UINT32 eventRate4);
  786. /**
  787. * @ingroup IxPerfProfAcc
  788. *
  789. * @fn ixPerfProfAccXscalePmuEventSampStop(
  790. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile1,
  791. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile2,
  792. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile3,
  793. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile4)
  794. *
  795. * @brief Stops the event based sampling
  796. *
  797. * @param *eventProfile1 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
  798. * pointer to the array of profiles for each program counter value;
  799. * the user should set the size of the array to
  800. * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
  801. * users's responsibility to allocate memory for this pointer.
  802. * @param *eventProfile2 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
  803. * pointer to the array of profiles for each program counter value;
  804. * the user should set the size of the array to
  805. * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
  806. * users's responsibility to allocate memory for this pointer.
  807. * @param *eventProfile3 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
  808. * pointer to the array of profiles for each program counter value;
  809. * the user should set the size of the array to
  810. * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
  811. * users's responsibility to allocate memory for this pointer.
  812. * @param *eventProfile4 @ref IxPerfProfAccXscalePmuSamplePcProfile [out] -
  813. * pointer to the array of profiles for each program counter value;
  814. * the user should set the size of the array to
  815. * IX_PERFPROF_ACC_XSCALE_PMU_MAX_PROFILE_SAMPLES. It is the
  816. * users's responsibility to allocate memory for this pointer.
  817. *
  818. * This API stops the event based sampling. The results are stored in the
  819. * pointers allocated by the user. It can only be called once
  820. * ixPerfProfAccEventSampStart has been called.
  821. *
  822. * @return
  823. * - IX_PERFPROF_ACC_STATUS_SUCCESS if event based sampling is stopped
  824. * successfully
  825. * - IX_PERFPROF_ACC_STATUS_XSCALE_PMU_START_NOT_CALLED if
  826. * ixPerfProfAccEventSampStart not called first.
  827. *
  828. * @li Reentrant : no
  829. * @li ISR Callable : no
  830. *
  831. */
  832. PUBLIC IxPerfProfAccStatus
  833. ixPerfProfAccXscalePmuEventSampStop(
  834. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile1,
  835. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile2,
  836. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile3,
  837. IxPerfProfAccXscalePmuSamplePcProfile *eventProfile4);
  838. /**
  839. * @ingroup IxPerfProfAcc
  840. *
  841. * @fn ixPerfProfAccXscalePmuResultsGet(IxPerfProfAccXscalePmuResults *results)
  842. *
  843. * @brief Reads the current value of the counters and their overflow
  844. *
  845. * @param *results @ref IxPerfProfAccXscalePmuResults [out] - pointer to the
  846. results struct. It is the user's responsibility to allocate memory
  847. for this pointer
  848. *
  849. * This API reads the value of all four event counters and the clock counter,
  850. * and the associated overflows. It does not give results associated with
  851. * sampling, i.e. PC and their frequencies. This API can be called at any time
  852. * once a process has been started. If it is called before a process has started
  853. * the user should be aware that the values it contains are default values and
  854. * might be meaningless. The values of the counters are stored in the pointer
  855. * allocated by the client.
  856. *
  857. * @return - none
  858. *
  859. * @li Reentrant : no
  860. * @li ISR Callable : no
  861. *
  862. */
  863. PUBLIC void
  864. ixPerfProfAccXscalePmuResultsGet(IxPerfProfAccXscalePmuResults *results);
  865. /**
  866. * @ingroup IxPerfProfAcc
  867. *
  868. * @fn ixPerfProfAccBusPmuStart(
  869. IxPerfProfAccBusPmuMode mode,
  870. IxPerfProfAccBusPmuEventCounters1 pecEvent1,
  871. IxPerfProfAccBusPmuEventCounters2 pecEvent2,
  872. IxPerfProfAccBusPmuEventCounters3 pecEvent3,
  873. IxPerfProfAccBusPmuEventCounters4 pecEvent4,
  874. IxPerfProfAccBusPmuEventCounters5 pecEvent5,
  875. IxPerfProfAccBusPmuEventCounters6 pecEvent6,
  876. IxPerfProfAccBusPmuEventCounters7 pecEvent7)
  877. * @brief Initializes all the counters and selects events to be monitored.
  878. *
  879. * Function initializes all the counters and assigns the events associated
  880. * with the counters. Users send in the mode and events they want to count.
  881. * This API verifies if the combination chosen is appropriate
  882. * and sets all the registers accordingly. Selecting HALT mode will result
  883. * in an error. User should use ixPerfProfAccBusPmuStop() to HALT.
  884. *
  885. *
  886. * @param mode @ref IxPerfProfAccStateBusPmuMode [in] - Mode selection.
  887. * @param pecEvent1 @ref IxPerfProfAccBusPmuEventCounters1 [in] - Event for PEC1.
  888. * @param pecEvent2 @ref IxPerfProfAccBusPmuEventCounters2 [in] - Event for PEC2.
  889. * @param pecEvent3 @ref IxPerfProfAccBusPmuEventCounters3 [in] - Event for PEC3.
  890. * @param pecEvent4 @ref IxPerfProfAccBusPmuEventCounters4 [in] - Event for PEC4.
  891. * @param pecEvent5 @ref IxPerfProfAccBusPmuEventCounters5 [in] - Event for PEC5.
  892. * @param pecEvent6 @ref IxPerfProfAccBusPmuEventCounters6 [in] - Event for PEC6.
  893. * @param pecEvent7 @ref IxPerfProfAccBusPmuEventCounters7 [in] - Event for PEC7.
  894. *
  895. * @return
  896. * - IX_PERFPROF_ACC_STATUS_SUCCESS - Initialization executed
  897. * successfully.
  898. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_MODE_ERROR - Error in selection of
  899. * mode. Only NORTH, SOUTH and SDRAM modes are allowed.
  900. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC1_ERROR - Error in selection of
  901. * event for PEC1
  902. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC2_ERROR - Error in selection of
  903. * event for PEC2
  904. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC3_ERROR - Error in selection of
  905. * event for PEC3
  906. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC4_ERROR - Error in selection of
  907. * event for PEC4
  908. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC5_ERROR - Error in selection of
  909. * event for PEC5
  910. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC6_ERROR - Error in selection of
  911. * event for PEC6
  912. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_PEC7_ERROR - Error in selection of
  913. * event for PEC7
  914. * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility
  915. * is running
  916. * - IX_PERFPROF_ACC_STATUS_FAIL - Failed to start because interrupt
  917. * service routine fails to bind.
  918. *
  919. * @li Reentrant : no
  920. * @li ISR Callable : no
  921. *
  922. **/
  923. PUBLIC
  924. IxPerfProfAccStatus ixPerfProfAccBusPmuStart (
  925. IxPerfProfAccBusPmuMode mode,
  926. IxPerfProfAccBusPmuEventCounters1 pecEvent1,
  927. IxPerfProfAccBusPmuEventCounters2 pecEvent2,
  928. IxPerfProfAccBusPmuEventCounters3 pecEvent3,
  929. IxPerfProfAccBusPmuEventCounters4 pecEvent4,
  930. IxPerfProfAccBusPmuEventCounters5 pecEvent5,
  931. IxPerfProfAccBusPmuEventCounters6 pecEvent6,
  932. IxPerfProfAccBusPmuEventCounters7 pecEvent7);
  933. /**
  934. * @ingroup IxPerfProfAcc
  935. *
  936. * @fn ixPerfProfAccBusPmuStop(void)
  937. * @brief Stops all counters.
  938. *
  939. * This function stops all the PECs by setting the halt bit in the ESR.
  940. *
  941. *
  942. * @return
  943. * - IX_PERFPROF_ACC_STATUS_SUCCESS - Counters successfully halted.
  944. * - IX_PERFPROF_ACC_STATUS_FAIL - Counters could'nt be halted.
  945. * - IX_PERFPROF_ACC_STATUS_BUS_PMU_START_NOT_CALLED - the
  946. * ixPerfProfAccBusPmuStart() function is not called.
  947. *
  948. * @li Reentrant : no
  949. * @li ISR Callable : no
  950. *
  951. **/
  952. PUBLIC IxPerfProfAccStatus
  953. ixPerfProfAccBusPmuStop (void);
  954. /**
  955. * @ingroup IxPerfProfAcc
  956. *
  957. * @fn ixPerfProfAccBusPmuResultsGet (
  958. IxPerfProfAccBusPmuResults *busPmuResults)
  959. * @brief Gets values of all counters
  960. *
  961. * This function is responsible for getting all the counter values from the
  962. * lower API and putting it into an array for the user.
  963. *
  964. * @param *busPmuResults @ref IxPerfProfAccBusPmuResults [out]
  965. * - Pointer to a structure of arrays to store all counter values.
  966. *
  967. * @return none
  968. *
  969. * @li Reentrant : no
  970. * @li ISR Callable : no
  971. *
  972. **/
  973. PUBLIC void
  974. ixPerfProfAccBusPmuResultsGet (IxPerfProfAccBusPmuResults *BusPmuResults);
  975. /**
  976. * @ingroup IxPerfProfAcc
  977. *
  978. * @fn ixPerfProfAccBusPmuPMSRGet (
  979. UINT32 *pmsrValue)
  980. * @brief Get values of PMSR
  981. *
  982. * This API gets the Previous Master Slave Register
  983. * value and returns it to the calling function. This value indicates
  984. * which master or slave accessed the north, south bus or sdram last.
  985. * The value returned by this function is a 32 bit value and is read
  986. * from location of an offset 0x0024 of the base value.
  987. *
  988. * The PMSR value returned indicate the following:
  989. * <pre>
  990. *
  991. * *************************************************************************************
  992. * * Bit * Name * Description *
  993. * * *
  994. * *************************************************************************************
  995. * * [31:18] *Reserved* *
  996. * *************************************************************************************
  997. * * [17:12] * PSS * Indicates which of the slaves on *
  998. * * * * ARBS was previously *
  999. * * * * accessed by the AHBS. *
  1000. * * * * [000001] Expansion Bus *
  1001. * * * * [000010] SDRAM Controller *
  1002. * * * * [000100] PCI *
  1003. * * * * [001000] Queue Manager *
  1004. * * * * [010000] AHB-APB Bridge *
  1005. * * * * [100000] Reserved *
  1006. * *************************************************************************************
  1007. * * [11:8] * PSN * Indicates which of the Slaves on *
  1008. * * * * ARBN was previously *
  1009. * * * * accessed the AHBN. *
  1010. * * * * [0001] SDRAM Controller *
  1011. * * * * [0010] AHB-AHB Bridge *
  1012. * * * * [0100] Reserved *
  1013. * * * * [1000] Reserved *
  1014. * *************************************************************************************
  1015. * * [7:4] * PMS * Indicates which of the Masters on *
  1016. * * * * ARBS was previously *
  1017. * * * * accessing the AHBS. *
  1018. * * * * [0001] Gasket *
  1019. * * * * [0010] AHB-AHB Bridge *
  1020. * * * * [0100] PCI *
  1021. * * * * [1000] APB *
  1022. * *************************************************************************************
  1023. * * [3:0] * PMN * Indicates which of the Masters on *
  1024. * * * * ARBN was previously *
  1025. * * * * accessing the AHBN. *
  1026. * * * * [0001] NPEA *
  1027. * * * * [0010] NPEB *
  1028. * * * * [0100] NPEC *
  1029. * * * * [1000] Reserved *
  1030. * *************************************************************************************
  1031. * </pre>
  1032. *
  1033. * @param *pmsrValue UINT32 [out] - Pointer to return PMSR value. Users need to
  1034. * allocate storage for psmrValue.
  1035. *
  1036. * @return none
  1037. *
  1038. * @li Reentrant : no
  1039. * @li ISR Callable : no
  1040. *
  1041. **/
  1042. PUBLIC void
  1043. ixPerfProfAccBusPmuPMSRGet (
  1044. UINT32 *pmsrValue);
  1045. /**
  1046. * The APIs below are specifically used for Xcycle module.
  1047. **/
  1048. /**
  1049. * @ingroup IxPerfProfAcc
  1050. *
  1051. * @fn ixPerfProfAccXcycleBaselineRun (
  1052. UINT32 *numBaselineCycle)
  1053. *
  1054. * @brief Perform baseline for Xcycle
  1055. *
  1056. * @param *numBaselineCycle UINT32 [out] - pointer to baseline value after
  1057. * calibration. Calling function are responsible for
  1058. * allocating memory space for this pointer.
  1059. *
  1060. * Global Data :
  1061. * - None.
  1062. *
  1063. * This function MUST be run before the Xcycle tool can be used. This
  1064. * function must be run immediately when the OS boots up with no other
  1065. * addition programs running.
  1066. * Addition note : This API will measure the time needed to perform
  1067. * a fix amount of CPU instructions (~ 1 second worth of loops) as a
  1068. * highest priority task and with interrupt disabled. The time measured
  1069. * is known as the baseline - interpreted as the shortest time
  1070. * needed to complete the amount of CPU instructions. The baseline is
  1071. * returned as unit of time in 66Mhz clock tick.
  1072. *
  1073. * @return
  1074. * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful run, result is returned
  1075. * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL - failed to change
  1076. * task priority
  1077. * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_RESTORE_FAIL - failed to
  1078. * restore task priority
  1079. * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility
  1080. * is running
  1081. * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle
  1082. * tool has already started
  1083. *
  1084. * @li Reentrant : no
  1085. * @li ISR Callable : no
  1086. *
  1087. */
  1088. PUBLIC IxPerfProfAccStatus
  1089. ixPerfProfAccXcycleBaselineRun(
  1090. UINT32 *numBaselineCycle);
  1091. /**
  1092. * @ingroup IxPerfProfAcc
  1093. *
  1094. * @fn ixPerfProfAccXcycleStart(
  1095. UINT32 numMeasurementsRequested);
  1096. *
  1097. * @brief Start the measurement
  1098. *
  1099. * @param numMeasurementsRequested UINT32 [in] - number of measurements
  1100. * to perform. Value can be 0 to
  1101. * IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS.
  1102. * 0 indicate continuous measurement.
  1103. *
  1104. * Global Data :
  1105. * - None.
  1106. *
  1107. *
  1108. * Start the measurements immediately.
  1109. * numMeasurementsRequested specifies number of measurements to run.
  1110. * If numMeasurementsRequested is set to 0, the measurement will
  1111. * be performed continuously until IxPerfProfAccXcycleStop()
  1112. * is called.
  1113. * It is estimated that 1 measurement takes approximately 1 second during
  1114. * low CPU utilization, therefore 128 measurement takes approximately 128 sec.
  1115. * When CPU utilization is high, the measurement will take longer.
  1116. * This function spawn a task the perform the measurement and returns.
  1117. * The measurement may continue even if this function returns.
  1118. *
  1119. * IMPORTANT: Under heavy CPU utilization, the task spawn by this
  1120. * function may starve and fail to respond to stop command. User
  1121. * may need to kill the task manually in this case.
  1122. *
  1123. * There are only IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
  1124. * storage available so storing is wrapped around if measurements are
  1125. * more than IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS.
  1126. *
  1127. *
  1128. * @return
  1129. * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful start, a thread is created
  1130. * in the background to perform measurement.
  1131. * - IX_PERFPROF_ACC_STATUS_XCYCLE_PRIORITY_SET_FAIL - failed to set
  1132. * task priority
  1133. * - IX_PERFPROF_ACC_STATUS_XCYCLE_THREAD_CREATE_FAIL - failed to create
  1134. * thread to perform measurement.
  1135. * - IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE - baseline is not available
  1136. * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_REQUEST_OUT_OF_RANGE -
  1137. * value is larger than IX_PERFPROF_ACC_XCYCLE_MAX_NUM_OF_MEASUREMENTS
  1138. * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle tool
  1139. * has already started
  1140. * - IX_PERFPROF_ACC_STATUS_ANOTHER_UTIL_IN_PROGRESS - another utility is
  1141. * running
  1142. *
  1143. * @li Reentrant : no
  1144. * @li ISR Callable : no
  1145. *
  1146. */
  1147. PUBLIC IxPerfProfAccStatus
  1148. ixPerfProfAccXcycleStart (
  1149. UINT32 numMeasurementsRequested);
  1150. /**
  1151. * @ingroup IxPerfProfAcc
  1152. *
  1153. * @fn ixPerfProfAccXcycleStop(void);
  1154. *
  1155. * @brief Stop the Xcycle measurement
  1156. *
  1157. * @param None
  1158. *
  1159. * Global Data :
  1160. * - None.
  1161. *
  1162. * Stop Xcycle measurements immediately. If the measurements have stopped
  1163. * or not started, return IX_PERFPROF_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING.
  1164. * Note: This function does not stop measurement cold. The measurement thread
  1165. * may need a few seconds to complete the last measurement. User needs to use
  1166. * ixPerfProfAccXcycleInProgress() to determine if measurement is indeed
  1167. * completed.
  1168. *
  1169. * @return
  1170. * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful measurement is stopped
  1171. * - IX_PERFPROF_STATUS_XCYCLE_MEASUREMENT_NOT_RUNNING - no measurement running
  1172. *
  1173. * @li Reentrant : no
  1174. * @li ISR Callable : no
  1175. *
  1176. */
  1177. PUBLIC IxPerfProfAccStatus
  1178. ixPerfProfAccXcycleStop(void);
  1179. /**
  1180. * @ingroup IxPerfProfAcc
  1181. *
  1182. * @fn ixPerfProfAccXcycleResultsGet(
  1183. IxPerfProfAccXcycleResults *xcycleResult )
  1184. *
  1185. * @brief Get the results of Xcycle measurement
  1186. *
  1187. * @param *xcycleResult @ref IxPerfProfAccXcycleResults [out] - Pointer to
  1188. * results of last measurements. Calling function are
  1189. * responsible for allocating memory space for this pointer.
  1190. *
  1191. * Global Data :
  1192. * - None.
  1193. *
  1194. * Retrieve the results of last measurement. User should use
  1195. * ixPerfProfAccXcycleInProgress() to check if measurement is completed
  1196. * before getting the results.
  1197. *
  1198. * @return
  1199. * - IX_PERFPROF_ACC_STATUS_SUCCESS - successful
  1200. * - IX_PERFPROF_ACC_STATUS_FAIL - result is not complete.
  1201. * - IX_PERFPROF_ACC_STATUS_XCYCLE_NO_BASELINE - baseline is performed
  1202. * - IX_PERFPROF_ACC_STATUS_XCYCLE_MEASUREMENT_IN_PROGRESS - Xcycle
  1203. * tool is still running
  1204. *
  1205. * @li Reentrant : no
  1206. * @li ISR Callable : no
  1207. *
  1208. */
  1209. PUBLIC IxPerfProfAccStatus
  1210. ixPerfProfAccXcycleResultsGet (
  1211. IxPerfProfAccXcycleResults *xcycleResult);
  1212. /**
  1213. * @ingroup IxPerfProfAcc
  1214. *
  1215. * @fn ixPerfProfAccXcycleInProgress (void)
  1216. *
  1217. * @brief Check if Xcycle is running
  1218. *
  1219. * @param None
  1220. * Global Data :
  1221. * - None.
  1222. *
  1223. * Check if Xcycle measuring task is running.
  1224. *
  1225. * @return
  1226. * - TRUE - Xcycle is running
  1227. * - FALSE - Xcycle is not running
  1228. *
  1229. * @li Reentrant : no
  1230. * @li ISR Callable : no
  1231. *
  1232. */
  1233. PUBLIC BOOL
  1234. ixPerfProfAccXcycleInProgress(void);
  1235. #ifdef __linux
  1236. /**
  1237. * @ingroup IxPerfProfAcc
  1238. *
  1239. * @fn ixPerfProfAccXscalePmuTimeSampCreateProcFile
  1240. *
  1241. * @brief Enables proc file to call module function
  1242. *
  1243. * @param None
  1244. *
  1245. * Global Data :
  1246. * - None.
  1247. *
  1248. * This function is declared globally to enable /proc directory system to call
  1249. * and execute the function when the registered file is called. This function is not meant to
  1250. * be called by the user.
  1251. *
  1252. * @return
  1253. * - Length of data written to file.
  1254. *
  1255. * @li Reentrant : no
  1256. * @li ISR Callable : no
  1257. *
  1258. */
  1259. int
  1260. ixPerfProfAccXscalePmuTimeSampCreateProcFile (char *buf, char **start, off_t offset,
  1261. int count, int *eof, void *data);
  1262. /**
  1263. * @ingroup IxPerfProfAcc
  1264. *
  1265. * @fn ixPerfProfAccXscalePmuEventSampCreateProcFile
  1266. *
  1267. * @brief Enables proc file to call module function
  1268. *
  1269. * @param None
  1270. *
  1271. * Global Data :
  1272. * - None.
  1273. *
  1274. * This function is declared globally to enable /proc directory system to call
  1275. * and execute the function when the registered file is called. This function is not meant to
  1276. * be called by the user.
  1277. *
  1278. * @return
  1279. * - Length of data written to file.
  1280. *
  1281. * @li Reentrant : no
  1282. * @li ISR Callable : no
  1283. *
  1284. */
  1285. int
  1286. ixPerfProfAccXscalePmuEventSampCreateProcFile (char *buf, char **start, off_t offset,
  1287. int count, int *eof, void *data);
  1288. #endif /* ifdef __linux */
  1289. #endif /* ndef IXPERFPROFACC_H */
  1290. /**
  1291. *@} defgroup IxPerfProfAcc
  1292. */