Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.1 KiB

  1. //================ Copyright (c) Valve Corporation. All Rights Reserved. ===========================
  2. //
  3. // SPU Profiling
  4. //
  5. //==================================================================================================
  6. #ifndef INCLUDED_CELLMGR_SPU_PROFILE_H
  7. #define INCLUDED_CELLMGR_SPU_PROFILE_H
  8. //--------------------------------------------------------------------------------------------------
  9. // Headers
  10. //--------------------------------------------------------------------------------------------------
  11. #include <stdint.h>
  12. //--------------------------------------------------------------------------------------------------
  13. // Defines
  14. //--------------------------------------------------------------------------------------------------
  15. // Uncomment to enabled profiling
  16. //#define ENABLE_SPU_PROFILE
  17. //--------------------------------------------------------------------------------------------------
  18. // Constants
  19. //--------------------------------------------------------------------------------------------------
  20. const int NUM_BOOKMARKS_IN_EVENT = 6;
  21. //--------------------------------------------------------------------------------------------------
  22. // Functions
  23. //--------------------------------------------------------------------------------------------------
  24. /*
  25. * Insert a marker that is displayed in Tuner
  26. */
  27. void insert_bookmark( uint32_t bookmark );
  28. /*
  29. * 400 cycles delay per bookmark when emitting bookmarks on multiple SPUs
  30. */
  31. void bookmark_delay( int NumBookmarks );
  32. /*
  33. * Inserting 6 SPU bookmarks, which will
  34. * be identified by Tuner as a start event
  35. */
  36. void raw_spu_prof_start( int iLevel, uint16_t lsa );
  37. /*
  38. * Inserting 6 SPU bookmarks, which will
  39. * be identified by Tuner as a stop event
  40. */
  41. void raw_spu_prof_stop( uint16_t lsa );
  42. /*
  43. *Profiling macros
  44. */
  45. #ifdef ENABLE_SPU_PROFILE
  46. #define BEGIN_PROFILE(level) raw_spu_prof_start(level, 0)
  47. #define END_PROFILE(level) raw_spu_prof_stop(level)
  48. #define BEGIN_BOOKMARK(colour) insert_bookmark( colour )
  49. #define END_BOOKMARK(colour)
  50. #else
  51. #define BEGIN_PROFILE(level)
  52. #define END_PROFILE(level)
  53. #define BEGIN_BOOKMARK(colour)
  54. #define END_BOOKMARK(colour)
  55. #endif
  56. #endif // INCLUDED_CELLMGR_SPU_PROFILE_H