Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

profile.h

Go to the documentation of this file.
00001 /** ============================================================================
00002  *  @file   profile.h
00003  *
00004  *  @path   $(DSPLINK)/gpp/inc/usr/
00005  *
00006  *  @brief  Defines instrumentation structures for profiling DSP/BIOS LINK.
00007  *
00008  *  @ver    1.65.00.03
00009  *  ============================================================================
00010  *  @copyright Copyright (C) 2002-2009, Texas Instruments Incorporated -
00011  *  http://www.ti.com/
00012  *
00013  *  Redistribution and use in source and binary forms, with or without
00014  *  modification, are permitted provided that the following conditions
00015  *  are met:
00016  *  
00017  *  *  Redistributions of source code must retain the above copyright
00018  *     notice, this list of conditions and the following disclaimer.
00019  *  
00020  *  *  Redistributions in binary form must reproduce the above copyright
00021  *     notice, this list of conditions and the following disclaimer in the
00022  *     documentation and/or other materials provided with the distribution.
00023  *  
00024  *  *  Neither the name of Texas Instruments Incorporated nor the names of
00025  *     its contributors may be used to endorse or promote products derived
00026  *     from this software without specific prior written permission.
00027  *  
00028  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00029  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00030  *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00031  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00032  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00033  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00034  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00035  *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00036  *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00037  *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00038  *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *  ============================================================================
00040  */
00041 
00042 
00043 #if !defined (PROFILE_H)
00044 #define PROFILE_H
00045 
00046 /*  ----------------------------------- DSP/BIOS Link               */
00047 #include <gpptypes.h>
00048 #if defined (CHNL_COMPONENT)
00049 #include <chnldefs.h>
00050 #endif /* #if defined (CHNL_COMPONENT) */
00051 #if defined (POOL_COMPONENT)
00052 #include <pooldefs.h>
00053 #endif /* #if defined (POOL_COMPONENT) */
00054 
00055 
00056 #if defined (__cplusplus)
00057 extern "C" {
00058 #endif /* defined (__cplusplus) */
00059 
00060 
00061 #if defined (DDSP_PROFILE)
00062 
00063 
00064 /** ============================================================================
00065  *  @const  DATA_SIZE
00066  *
00067  *  @brief  Number of bytes stored per buffer for recording the history of
00068  *          data transfer on a channel.
00069  *  ============================================================================
00070  */
00071 #define DATA_LENGTH   8u
00072 
00073 /** ============================================================================
00074  *  @name   HIST_LENGTH
00075  *
00076  *  @brief  Number of buffers to be recorded as history.
00077  *  ============================================================================
00078  */
00079 #define HIST_LENGTH   8u
00080 
00081 /** ============================================================================
00082  *  @name   HistoryData
00083  *
00084  *  @brief  Array to hold history data for a channel.
00085  *  ============================================================================
00086  */
00087 typedef Char8    HistoryData [DATA_LENGTH] ;
00088 
00089 /** ============================================================================
00090  *  @name   NumberOfBytes
00091  *
00092  *  @brief  Number of bytes transferred.
00093  *  ============================================================================
00094  */
00095 typedef Uint32   NumberOfBytes ;
00096 
00097 /** ============================================================================
00098  *  @name   NumberOfInterrupts
00099  *
00100  *  @brief  Number of interrupts sent to/received from DSP.
00101  *  ============================================================================
00102  */
00103 typedef Uint32   NumberOfInterrupts ;
00104 
00105 
00106 #if defined (PROC_COMPONENT)
00107 /** ============================================================================
00108  *  @name   PROC_Instrument
00109  *
00110  *  @brief  Instrumentation data for a DSP processor.
00111  *
00112  *  @param  procId
00113  *              Processor identifier.
00114  *  @param  active
00115  *              Indicates if the DSP is in use.
00116  *  @param  dataToDsp
00117  *              Number of bytes sent to DSP.
00118  *  @param  dataFromDsp
00119  *              Number of bytes received from DSP.
00120  *  @param  intsToDsp
00121  *              Number of interrupts sent to DSP.
00122  *  @param  intsFromDsp
00123  *              Number of interrupts received from DSP.
00124  *  @param  activeLinks
00125  *              Number of links currently active.
00126  *  ============================================================================
00127  */
00128 typedef struct PROC_Instrument_tag {
00129     ProcessorId        procId      ;
00130     Bool               active      ;
00131     NumberOfBytes      dataToDsp   ;
00132     NumberOfBytes      dataFromDsp ;
00133     NumberOfInterrupts intsToDsp   ;
00134     NumberOfInterrupts intsFromDsp ;
00135     Uint32             activeLinks ;
00136 } PROC_Instrument ;
00137 
00138 
00139 /** ============================================================================
00140  *  @name   PROC_Stats
00141  *
00142  *  @brief  Instrumentation data for the DSPs.
00143  *
00144  *  @param  procData
00145  *              Instrumentation data per dsp processor.
00146  *  ============================================================================
00147  */
00148 typedef struct PROC_Stats_tag {
00149     PROC_Instrument  procData [MAX_DSPS] ;
00150 } PROC_Stats ;
00151 #endif  /* if defined (PROC_COMPONENT) */
00152 
00153 
00154 #if defined (CHNL_COMPONENT)
00155 /** ============================================================================
00156  *  @name   CHNL_Shared
00157  *
00158  *  @brief  Place holder for instrumentation data common to multiple channels.
00159  *
00160  *  @param  nameLinkDriver
00161  *              Name of the link driver.
00162  *  ============================================================================
00163  */
00164 typedef struct CHNL_Shared_tag {
00165     Pstr    nameLinkDriver ;
00166 } CHNL_Shared ;
00167 
00168 
00169 /** ============================================================================
00170  *  @name   CHNL_Instrument
00171  *
00172  *  @brief  Instrumentation data for a channel.
00173  *
00174  *  @param  procId
00175  *              Processor identifier.
00176  *  @param  chnlId
00177  *              Channel identifier.
00178  *  @param  active
00179  *              Indicates if the channel is in use.
00180  *  @param  mode
00181  *              Indicates if the channel is input or output.
00182  *  @param  chnlShared
00183  *              Pointer to the shared information across multiple channels.
00184  *  @param  transferred
00185  *              Number of bytes transferred on channel.
00186  *  @param  numBufsQueued
00187  *              Number of currently queued buffers.
00188  *  @param  archive
00189  *              History of data sent on channel.
00190  *  ============================================================================
00191  */
00192 typedef struct CHNL_Instrument_tag {
00193     ProcessorId      procId        ;
00194     ChannelId        chnlId        ;
00195     Bool             active        ;
00196     ChannelMode      mode          ;
00197     CHNL_Shared *    chnlShared    ;
00198     NumberOfBytes    transferred   ;
00199     Uint32           numBufsQueued ;
00200 #if defined (DDSP_PROFILE_DETAILED)
00201     Uint32           archIndex     ;
00202     HistoryData      archive [HIST_LENGTH] ;
00203 #endif /* defined (DDSP_PROFILE_DETAILED) */
00204 } CHNL_Instrument ;
00205 
00206 
00207 /** ============================================================================
00208  *  @name   CHNL_Stats
00209  *
00210  *  @brief  Instrumentation data for channels.
00211  *
00212  *  @param  chnlData
00213  *              Instrumentation data per channel.
00214  *  ============================================================================
00215  */
00216 typedef struct CHNL_Stats_tag {
00217     CHNL_Instrument  chnlData ;
00218 } CHNL_Stats ;
00219 #endif  /* if defined (CHNL_COMPONENT) */
00220 
00221 
00222 /** ============================================================================
00223  *  @name   DSP_Stats_tag
00224  *
00225  *  @brief  Instrumentation data per DSP.
00226  *
00227  *  @param  dataGppToDsp
00228  *              Number of bytes transferred to DSP.
00229  *  @param  dataDspToGpp
00230  *              Number of bytes transferred from DSP.
00231  *  @param  intsGppToDsp
00232  *              Number of interrupts to DSP.
00233  *  @param  intsDspToGpp
00234  *              Number of interrupts from DSP.
00235  *  ============================================================================
00236  */
00237 struct DSP_Stats_tag {
00238     NumberOfBytes       dataGppToDsp ;
00239     NumberOfBytes       dataDspToGpp ;
00240     NumberOfInterrupts  intsGppToDsp ;
00241     NumberOfInterrupts  intsDspToGpp ;
00242 } ;
00243 
00244 
00245 #if defined (MSGQ_COMPONENT)
00246 /** ============================================================================
00247  *  @name   MSGQ_Instrument
00248  *
00249  *  @brief  This structure defines the instrumentation data for a message queue.
00250  *
00251  *  @param  transferred
00252  *              Number of messages transferred on this MSGQ.
00253  *  @param  queued
00254  *              Number of messages currently queued on this MSGQ, pending calls
00255  *              to get them.
00256  *  ============================================================================
00257  */
00258 typedef struct MSGQ_Instrument_tag {
00259     Uint32      transferred ;
00260     Uint32      queued ;
00261 } MSGQ_Instrument ;
00262 
00263 /** ============================================================================
00264  *  @name   MSGQ_Stats
00265  *
00266  *  @brief  This structure defines the instrumentation data for MSGQs on the
00267  *          local processor.
00268  *
00269  *  @param  msgqData
00270  *              Instrumentation data for the Message Queue.
00271  *  ============================================================================
00272  */
00273 typedef struct MSGQ_Stats_tag {
00274     MSGQ_Instrument msgqData ;
00275 } MSGQ_Stats ;
00276 
00277 #endif /* defined (MSGQ_COMPONENT) */
00278 
00279 
00280 #if defined (POOL_COMPONENT)
00281 /** ============================================================================
00282  *  @name   MPBUF_Stats
00283  *
00284  *  @brief  This structure defines instrumentation data for the buffer pools.
00285  *
00286  *  @param  size
00287  *              Size of the buffers in this pool.
00288  *  @param  totalBuffers
00289  *              Total number of buffers in pool.
00290  *  @param  freeBuffers
00291  *              Number of free buffers in pool.
00292  *  @param  maxUsed
00293  *              Maximum number of buffers that have been used at least once
00294  *              since creation of the buffer pool, this helps in case of
00295  *              multiple runs.
00296  *  ============================================================================
00297  */
00298 typedef struct MPBUF_Stats_tag {
00299     Uint16        size         ;
00300     Uint16        totalBuffers ;
00301     Uint16        freeBuffers  ;
00302     Uint16        maxUsed      ;
00303 } MPBUF_Stats ;
00304 
00305 /** ============================================================================
00306  *  @name   SMAPOOL_Stats
00307  *
00308  *  @brief  This structure defines instrumentation data for SMA.
00309  *
00310  *  @param  mpBufStats
00311  *              Location to store SMA instrument data.
00312  *  @param  bufHandleCount
00313  *              Total number of buffer pools.
00314  *  @param  conflicts
00315  *              Total number of conflicts.
00316  *  @param  numCalls
00317  *              Total number of calls made to MPCS entry and leave functions.
00318  *  ============================================================================
00319  */
00320 typedef struct SMAPOOL_Stats_tag {
00321     MPBUF_Stats mpBufStats [MAX_SMABUFENTRIES] ;
00322     Uint16      bufHandleCount ;
00323     Uint32      conflicts ;
00324     Uint32      numCalls ;
00325 } SMAPOOL_Stats ;
00326 #endif /* if defined (POOL_COMPONENT) */
00327 
00328 /** ============================================================================
00329  *  @name   IPS_Instrument
00330  *
00331  *  @brief  This structure defines the instrumentation data for an IPS object.
00332  *
00333  *  @param  registerCount
00334  *              Number of listeners registered.
00335  *  @param  unregisterCount
00336  *              Number of listeners unregistered.
00337  *  @param  eventSentCount
00338  *              Number of events sent.
00339  *  @param  eventOccurredCount
00340  *              Number of events occurred.
00341  *  ============================================================================
00342  */
00343 typedef struct IPS_Instrument_tag {
00344     Uint32 registerCount ;
00345     Uint32 unregisterCount ;
00346     Uint32 eventSentCount ;
00347     Uint32 eventOccurredCount ;
00348 } IPS_Instrument ;
00349 
00350 
00351 #if defined (PROC_COMPONENT)
00352 /** ============================================================================
00353  *  @deprecated The deprecated data structure ProcInstrument has been replaced
00354  *              with PROC_Instrument
00355  *
00356  *  ============================================================================
00357  */
00358 #define ProcInstrument             PROC_Instrument
00359 
00360 /** ============================================================================
00361  *  @deprecated The deprecated data structure ProcStats has been replaced with
00362  *              PROC_Stats
00363  *
00364  *  ============================================================================
00365  */
00366 #define ProcStats                  PROC_Stats
00367 #endif  /* if defined (PROC_COMPONENT) */
00368 #if defined (CHNL_COMPONENT)
00369 /** ============================================================================
00370  *  @deprecated The deprecated data structure ChnlShared has been replaced with
00371  *              CHNL_Shared
00372  *
00373  *  ============================================================================
00374  */
00375 #define ChnlShared                 CHNL_Shared
00376 
00377 /** ============================================================================
00378  *  @deprecated The deprecated data structure ChnlInstrument has been replaced
00379  *              with CHNL_Instrument
00380  *
00381  *  ============================================================================
00382  */
00383 #define ChnlInstrument             CHNL_Instrument
00384 
00385 /** ============================================================================
00386  *  @deprecated The deprecated data structure ChnlStats has been replaced with
00387  *              CHNL_Stats
00388  *
00389  *  ============================================================================
00390  */
00391 #define ChnlStats                  CHNL_Stats
00392 #endif  /* if defined (CHNL_COMPONENT) */
00393 
00394 /** ============================================================================
00395  *  @deprecated The deprecated data structure DspStats has been replaced with
00396  *              DSP_Stats
00397  *
00398  *  ============================================================================
00399  */
00400 #define DspStats                   DSP_Stats
00401 
00402 #if defined (MSGQ_COMPONENT)
00403 /** ============================================================================
00404  *  @deprecated The deprecated data structure MsgqInstrument has been replaced
00405  *              with MSGQ_Instrument
00406  *
00407  *  ============================================================================
00408  */
00409 #define MsgqInstrument             MSGQ_Instrument
00410 
00411 /** ============================================================================
00412  *  @deprecated The deprecated data structure MsgqStats has been replaced
00413  *              with MSGQ_Stats
00414  *
00415  *  ============================================================================
00416  */
00417 #define MsgqStats                  MSGQ_Stats
00418 #endif  /* if defined (MSGQ_COMPONENT) */
00419 
00420 #if defined (POOL_COMPONENT)
00421 /** ============================================================================
00422  *  @deprecated The deprecated data structure MPBUF_Stats has been replaced
00423  *              with MPBUF_Stats
00424  *
00425  *  ============================================================================
00426  */
00427 #define MpBufStats                 MPBUF_Stats
00428 /** ============================================================================
00429  *  @deprecated The deprecated data structure SmaPoolStats has been replaced
00430  *              with SMAPOOL_Stats.
00431  *
00432  *  ============================================================================
00433  */
00434 #define SmaPoolStats               SMAPOOL_Stats
00435 #endif  /* if defined (POOL_COMPONENT) */
00436 
00437 /** ============================================================================
00438  *  @deprecated The deprecated data structure IpsInstrument has been replaced
00439  *              with IPS_Instrument
00440  *
00441  *  ============================================================================
00442  */
00443 #define IpsInstrument              IPS_Instrument
00444 
00445 
00446 #endif  /* if defined (DDSP_PROFILE) */
00447 
00448 
00449 #if defined (__cplusplus)
00450 }
00451 #endif /* defined (__cplusplus) */
00452 
00453 
00454 #endif /* defined (PROFILE_H) */

Generated on Fri Jul 16 14:34:03 2010 for DSP/BIOSLink by  doxygen 1.4.4