1 //////////////////////////////////////////////////////////////////////
3 // Copyright (c) 2002-11 Xilinx, Inc. All rights reserved.
6 // XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
7 // COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
8 // ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
9 // STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
10 // IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
11 // FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
12 // XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
13 // THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
14 // ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
15 // FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
16 // AND FITNESS FOR A PARTICULAR PURPOSE.
18 // $Id: profile.h,v 1.1.2.2 2011/05/30 06:46:18 svemula Exp $
20 //////////////////////////////////////////////////////////////////////
26 #include "profile_config.h"
28 #ifdef PROC_MICROBLAZE
29 #include "mblaze_nt_types.h"
36 void _system_init( void ) ;
37 void _system_clean( void ) ;
38 void mcount(unsigned long frompc, unsigned long selfpc);
39 void profile_intr_handler( void ) ;
43 /****************************************************************************
44 * Profiling on hardware - Hash table maintained on hardware and data sent
45 * to xmd for gmon.out generation.
46 ****************************************************************************/
48 * histogram counters are unsigned shorts (according to the kernel).
50 #define HISTCOUNTER unsigned short
60 unsigned long frompc ;
66 * general rounding functions.
68 #define ROUNDDOWN(x,y) (((x)/(y))*(y))
69 #define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y))
72 * The profiling data structures are housed in this structure.
77 // Histogram Information
78 unsigned short *kcount; /* No. of bins in histogram */
79 unsigned long kcountsize; /* Histogram samples */
81 // Call-graph Information
82 struct fromstruct *froms;
83 unsigned long fromssize;
85 unsigned long tossize;
87 // Initialization I/Ps
90 unsigned long textsize;
91 //unsigned long cg_froms;
92 //unsigned long cg_tos;
94 extern struct gmonparam *_gmonparam;
95 extern int n_gmon_sections;
98 * Possible states of profiling.
100 #define GMON_PROF_ON 0
101 #define GMON_PROF_BUSY 1
102 #define GMON_PROF_ERROR 2
103 #define GMON_PROF_OFF 3
106 * Sysctl definitions for extracting profiling information from the kernel.
108 #define GPROF_STATE 0 /* int: profiling enabling variable */
109 #define GPROF_COUNT 1 /* struct: profile tick count buffer */
110 #define GPROF_FROMS 2 /* struct: from location hash bucket */
111 #define GPROF_TOS 3 /* struct: destination/count structure */
112 #define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */
118 #endif /* _PROFILE_H */