Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
profiling.h File Reference

Go to the source code of this file.

Macros

#define GFX_PROFILING
 Toggle this define to enable verbose graphics profiling.
 
#define OS_GET_COUNT_INLINE(x)   asm volatile("mfc0 %0, $9" : "=r"(x): )
 
#define PROFILING_BUFFER_SIZE   64
 
#define AUDIO_SUBSET_ENTRIES
 
#define GFX_SUBSET_ENTRIES
 
#define PROFILER_TIME_PUPPYPRINT1   0
 
#define PROFILER_TIME_PUPPYPRINT2   0
 
#define PROFILER_DELTA_PUPPYPRINT1   0
 
#define PROFILER_DELTA_PUPPYPRINT2   0
 
#define PROFILER_GET_SNAPSHOT()
 
#define PROFILER_GET_SNAPSHOT_TYPE(type)
 
#define profiler_update(which, delta)
 
#define profiler_print_times()
 
#define profiler_frame_setup()
 
#define profiler_rsp_started(which)
 
#define profiler_rsp_completed(which)
 
#define profiler_rsp_resumed()
 
#define profiler_audio_started()
 
#define profiler_audio_completed()
 
#define profiler_rsp_yielded()
 
#define profiler_collision_reset()
 
#define profiler_collision_completed()
 
#define profiler_collision_update(time)
 
#define profiler_get_delta(which)   0
 
#define profiler_get_cpu_microseconds()   0
 
#define profiler_get_rsp_microseconds()   0
 
#define profiler_get_rdp_microseconds()   0
 
#define GFX_SUBSET_SIZE   PROFILER_TIME_SUB_GFX_END - PROFILER_TIME_SUB_GFX_START
 
#define GFX_PROFILER_SWITCH(complete, begin)   profiler_gfx_subset_switch_func(complete - PROFILER_TIME_SUB_GFX_START, begin - PROFILER_TIME_SUB_GFX_START)
 
#define GFX_PROFILER_COMPLETE_AND_SWITCH(complete1, complete2, begin)
 
#define GFX_PROFILER_START_SHARED(first, new)   profiler_gfx_subset_start_shared_func(first - PROFILER_TIME_SUB_GFX_START, new - PROFILER_TIME_SUB_GFX_START)
 
#define GFX_PROFILER_START(which)   profiler_gfx_subset_start_func(which - PROFILER_TIME_SUB_GFX_START)
 
#define GFX_PROFILER_COMPLETE(which)   profiler_gfx_subset_complete_func(which - PROFILER_TIME_SUB_GFX_START)
 
#define AUDIO_PROFILER_SWITCH(complete, begin)
 
#define AUDIO_PROFILER_COMPLETE_AND_SWITCH(complete1, complete2, begin)
 
#define AUDIO_PROFILER_START_SHARED(first, new)
 
#define AUDIO_PROFILER_START(which)
 
#define AUDIO_PROFILER_COMPLETE(which)
 

Enumerations

enum  ProfilerTime {
  PROFILER_TIME_FPS , PROFILER_TIME_CONTROLLERS , PROFILER_TIME_WORKERS , PROFILER_TIME_TRIGGERS ,
  PROFILER_TIME_EVT , PROFILER_TIME_MESSAGES , PROFILER_TIME_HUD_ELEMENTS , PROFILER_TIME_STEP_GAME_MODE ,
  PROFILER_TIME_ENTITIES , PROFILER_TIME_SUB_GFX_START , PROFILER_TIME_SUB_GFX_UPDATE , PROFILER_TIME_SUB_GFX__DUMMY ,
  PROFILER_TIME_SUB_GFX_ENTITIES , PROFILER_TIME_SUB_GFX_MODELS , PROFILER_TIME_SUB_GFX_PLAYER , PROFILER_TIME_SUB_GFX_NPCS ,
  PROFILER_TIME_SUB_GFX_WORKERS , PROFILER_TIME_SUB_GFX_EFFECTS , PROFILER_TIME_SUB_GFX_RENDER_TASKS , PROFILER_TIME_SUB_GFX_HUD_ELEMENTS ,
  PROFILER_TIME_SUB_GFX_BACK_UI , PROFILER_TIME_SUB_GFX_FRONT_UI , PROFILER_TIME_SUB_GFX_END , PROFILER_TIME_GFX = PROFILER_TIME_SUB_GFX_END ,
  PROFILER_TIME_AUDIO , PROFILER_TIME_TOTAL , PROFILER_TIME_RSP_GFX , PROFILER_TIME_RSP_AUDIO ,
  PROFILER_TIME_TMEM , PROFILER_TIME_PIPE , PROFILER_TIME_CMD , PROFILE_TIME_WORLD_ENCOUNTERS ,
  PROFILE_TIME_WORLD_NPCS , PROFILE_TIME_WORLD_PLAYER , PROFILE_TIME_WORLD_ITEM_ENTITIES , PROFILE_TIME_WORLD_EFFECTS ,
  PROFILE_TIME_WORLD_CAMERAS , PROFILER_TIME_COUNT
}
 
enum  ProfilerRSPTime { PROFILER_RSP_GFX , PROFILER_RSP_AUDIO , PROFILER_RSP_COUNT }
 
enum  ProfilerDeltaTime { PROFILER_DELTA_COLLISION }
 
enum  ProfilerTimeAudioUnused {
  PROFILER_TIME_SUB_AUDIO_START , PROFILER_TIME_SUB_AUDIO_SEQUENCES = PROFILER_TIME_SUB_AUDIO_START , PROFILER_TIME_SUB_AUDIO_SEQUENCES_SCRIPT , PROFILER_TIME_SUB_AUDIO_SEQUENCES_RECLAIM ,
  PROFILER_TIME_SUB_AUDIO_SEQUENCES_PROCESSING , PROFILER_TIME_SUB_AUDIO_SYNTHESIS , PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING , PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB ,
  PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA , PROFILER_TIME_SUB_AUDIO_UPDATE , PROFILER_TIME_SUB_AUDIO_END
}
 

Variables

u32 gfx_subset_starts [PROFILER_TIME_SUB_GFX_END - PROFILER_TIME_SUB_GFX_START]
 
u32 gfx_subset_tallies [PROFILER_TIME_SUB_GFX_END - PROFILER_TIME_SUB_GFX_START]
 

Macro Definition Documentation

◆ GFX_PROFILING

#define GFX_PROFILING

Toggle this define to enable verbose graphics profiling.

Definition at line 17 of file profiling.h.

◆ OS_GET_COUNT_INLINE

#define OS_GET_COUNT_INLINE ( x)    asm volatile("mfc0 %0, $9" : "=r"(x): )

Definition at line 19 of file profiling.h.

◆ PROFILING_BUFFER_SIZE

#define PROFILING_BUFFER_SIZE   64

Definition at line 21 of file profiling.h.

◆ AUDIO_SUBSET_ENTRIES

#define AUDIO_SUBSET_ENTRIES
Value:
@ PROFILER_TIME_SUB_AUDIO_START
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_UPDATE
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SEQUENCES
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_END
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SEQUENCES_SCRIPT
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SYNTHESIS
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SEQUENCES_RECLAIM
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING
Definition profiling.h:276
@ PROFILER_TIME_SUB_AUDIO_SEQUENCES_PROCESSING
Definition profiling.h:276

Definition at line 23 of file profiling.h.

23#define AUDIO_SUBSET_ENTRIES \
24 PROFILER_TIME_SUB_AUDIO_START, \
25 PROFILER_TIME_SUB_AUDIO_SEQUENCES = PROFILER_TIME_SUB_AUDIO_START, \
26 PROFILER_TIME_SUB_AUDIO_SEQUENCES_SCRIPT, \
27 PROFILER_TIME_SUB_AUDIO_SEQUENCES_RECLAIM, \
28 PROFILER_TIME_SUB_AUDIO_SEQUENCES_PROCESSING, \
29 PROFILER_TIME_SUB_AUDIO_SYNTHESIS, \
30 PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING, \
31 PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB, \
32 PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA, \
33 PROFILER_TIME_SUB_AUDIO_UPDATE, \
34 PROFILER_TIME_SUB_AUDIO_END

◆ GFX_SUBSET_ENTRIES

#define GFX_SUBSET_ENTRIES
Value:
PROFILER_TIME_SUB_GFX__DUMMY, /* fixes entities for some reason */ \
@ PROFILER_TIME_SUB_GFX_HUD_ELEMENTS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_BACK_UI
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_START
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_ENTITIES
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_FRONT_UI
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_WORKERS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_PLAYER
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_EFFECTS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_END
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_MODELS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_RENDER_TASKS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX__DUMMY
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_NPCS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_UPDATE
Definition profiling.h:67

Definition at line 36 of file profiling.h.

36#define GFX_SUBSET_ENTRIES \
37 PROFILER_TIME_SUB_GFX_START, \
38 PROFILER_TIME_SUB_GFX_UPDATE, \
39 PROFILER_TIME_SUB_GFX__DUMMY, /* fixes entities for some reason */ \
40 PROFILER_TIME_SUB_GFX_ENTITIES, \
41 PROFILER_TIME_SUB_GFX_MODELS, \
42 PROFILER_TIME_SUB_GFX_PLAYER, \
43 PROFILER_TIME_SUB_GFX_NPCS, \
44 PROFILER_TIME_SUB_GFX_WORKERS, \
45 PROFILER_TIME_SUB_GFX_EFFECTS, \
46 PROFILER_TIME_SUB_GFX_RENDER_TASKS, \
47 PROFILER_TIME_SUB_GFX_HUD_ELEMENTS, \
48 PROFILER_TIME_SUB_GFX_BACK_UI, \
49 PROFILER_TIME_SUB_GFX_FRONT_UI, \
50 PROFILER_TIME_SUB_GFX_END

◆ PROFILER_TIME_PUPPYPRINT1

#define PROFILER_TIME_PUPPYPRINT1   0

Definition at line 112 of file profiling.h.

◆ PROFILER_TIME_PUPPYPRINT2

#define PROFILER_TIME_PUPPYPRINT2   0

Definition at line 113 of file profiling.h.

◆ PROFILER_DELTA_PUPPYPRINT1

#define PROFILER_DELTA_PUPPYPRINT1   0

Definition at line 114 of file profiling.h.

◆ PROFILER_DELTA_PUPPYPRINT2

#define PROFILER_DELTA_PUPPYPRINT2   0

Definition at line 115 of file profiling.h.

◆ PROFILER_GET_SNAPSHOT

#define PROFILER_GET_SNAPSHOT ( )

Definition at line 155 of file profiling.h.

◆ PROFILER_GET_SNAPSHOT_TYPE

#define PROFILER_GET_SNAPSHOT_TYPE ( type)

Definition at line 156 of file profiling.h.

◆ profiler_update

#define profiler_update ( which,
delta )

Definition at line 157 of file profiling.h.

Referenced by state_step_world(), and step_game_loop().

◆ profiler_print_times

#define profiler_print_times ( )

Definition at line 158 of file profiling.h.

Referenced by gfx_draw_frame().

◆ profiler_frame_setup

#define profiler_frame_setup ( )

Definition at line 159 of file profiling.h.

Referenced by step_game_loop().

◆ profiler_rsp_started

#define profiler_rsp_started ( which)

Definition at line 160 of file profiling.h.

Referenced by gfxRetrace_Callback(), and nuAuMgr().

◆ profiler_rsp_completed

#define profiler_rsp_completed ( which)

Definition at line 161 of file profiling.h.

Referenced by gfx_task_end_callback(), and nuAuMgr().

◆ profiler_rsp_resumed

#define profiler_rsp_resumed ( )

Definition at line 162 of file profiling.h.

◆ profiler_audio_started

#define profiler_audio_started ( )

Definition at line 163 of file profiling.h.

Referenced by nuAuMgr().

◆ profiler_audio_completed

#define profiler_audio_completed ( )

Definition at line 164 of file profiling.h.

Referenced by nuAuMgr().

◆ profiler_rsp_yielded

#define profiler_rsp_yielded ( )

Definition at line 165 of file profiling.h.

◆ profiler_collision_reset

#define profiler_collision_reset ( )

Definition at line 166 of file profiling.h.

◆ profiler_collision_completed

#define profiler_collision_completed ( )

Definition at line 167 of file profiling.h.

◆ profiler_collision_update

#define profiler_collision_update ( time)

Definition at line 168 of file profiling.h.

◆ profiler_get_delta

#define profiler_get_delta ( which)    0

Definition at line 169 of file profiling.h.

◆ profiler_get_cpu_microseconds

#define profiler_get_cpu_microseconds ( )    0

Definition at line 170 of file profiling.h.

◆ profiler_get_rsp_microseconds

#define profiler_get_rsp_microseconds ( )    0

Definition at line 171 of file profiling.h.

◆ profiler_get_rdp_microseconds

#define profiler_get_rdp_microseconds ( )    0

Definition at line 172 of file profiling.h.

◆ GFX_SUBSET_SIZE

Definition at line 176 of file profiling.h.

◆ GFX_PROFILER_SWITCH

#define GFX_PROFILER_SWITCH ( complete,
begin )   profiler_gfx_subset_switch_func(complete - PROFILER_TIME_SUB_GFX_START, begin - PROFILER_TIME_SUB_GFX_START)

Definition at line 212 of file profiling.h.

Referenced by gfx_draw_frame(), and render_frame().

◆ GFX_PROFILER_COMPLETE_AND_SWITCH

#define GFX_PROFILER_COMPLETE_AND_SWITCH ( complete1,
complete2,
begin )
Value:
profiler_gfx_subset_complete_and_switch_func(complete1 - PROFILER_TIME_SUB_GFX_START, \

Definition at line 213 of file profiling.h.

213#define GFX_PROFILER_COMPLETE_AND_SWITCH(complete1, complete2, begin) profiler_gfx_subset_complete_and_switch_func(complete1 - PROFILER_TIME_SUB_GFX_START, \
214 complete2 - PROFILER_TIME_SUB_GFX_START, begin - PROFILER_TIME_SUB_GFX_START)

◆ GFX_PROFILER_START_SHARED

#define GFX_PROFILER_START_SHARED ( first,
new )   profiler_gfx_subset_start_shared_func(first - PROFILER_TIME_SUB_GFX_START, new - PROFILER_TIME_SUB_GFX_START)

Definition at line 215 of file profiling.h.

◆ GFX_PROFILER_START

#define GFX_PROFILER_START ( which)    profiler_gfx_subset_start_func(which - PROFILER_TIME_SUB_GFX_START)

Definition at line 216 of file profiling.h.

Referenced by render_frame().

◆ GFX_PROFILER_COMPLETE

#define GFX_PROFILER_COMPLETE ( which)    profiler_gfx_subset_complete_func(which - PROFILER_TIME_SUB_GFX_START)

Definition at line 217 of file profiling.h.

Referenced by gfx_draw_frame(), and render_frame().

◆ AUDIO_PROFILER_SWITCH

#define AUDIO_PROFILER_SWITCH ( complete,
begin )

Definition at line 278 of file profiling.h.

◆ AUDIO_PROFILER_COMPLETE_AND_SWITCH

#define AUDIO_PROFILER_COMPLETE_AND_SWITCH ( complete1,
complete2,
begin )

Definition at line 279 of file profiling.h.

◆ AUDIO_PROFILER_START_SHARED

#define AUDIO_PROFILER_START_SHARED ( first,
new )

Definition at line 280 of file profiling.h.

◆ AUDIO_PROFILER_START

#define AUDIO_PROFILER_START ( which)

Definition at line 283 of file profiling.h.

◆ AUDIO_PROFILER_COMPLETE

#define AUDIO_PROFILER_COMPLETE ( which)

Definition at line 284 of file profiling.h.

Enumeration Type Documentation

◆ ProfilerTime

Enumerator
PROFILER_TIME_FPS 
PROFILER_TIME_CONTROLLERS 
PROFILER_TIME_WORKERS 
PROFILER_TIME_TRIGGERS 
PROFILER_TIME_EVT 
PROFILER_TIME_MESSAGES 
PROFILER_TIME_HUD_ELEMENTS 
PROFILER_TIME_STEP_GAME_MODE 
PROFILER_TIME_ENTITIES 
PROFILER_TIME_SUB_GFX_START 
PROFILER_TIME_SUB_GFX_UPDATE 
PROFILER_TIME_SUB_GFX__DUMMY 
PROFILER_TIME_SUB_GFX_ENTITIES 
PROFILER_TIME_SUB_GFX_MODELS 
PROFILER_TIME_SUB_GFX_PLAYER 
PROFILER_TIME_SUB_GFX_NPCS 
PROFILER_TIME_SUB_GFX_WORKERS 
PROFILER_TIME_SUB_GFX_EFFECTS 
PROFILER_TIME_SUB_GFX_RENDER_TASKS 
PROFILER_TIME_SUB_GFX_HUD_ELEMENTS 
PROFILER_TIME_SUB_GFX_BACK_UI 
PROFILER_TIME_SUB_GFX_FRONT_UI 
PROFILER_TIME_SUB_GFX_END 
PROFILER_TIME_GFX 
PROFILER_TIME_AUDIO 
PROFILER_TIME_TOTAL 
PROFILER_TIME_RSP_GFX 
PROFILER_TIME_RSP_AUDIO 
PROFILER_TIME_TMEM 
PROFILER_TIME_PIPE 
PROFILER_TIME_CMD 
PROFILE_TIME_WORLD_ENCOUNTERS 
PROFILE_TIME_WORLD_NPCS 
PROFILE_TIME_WORLD_PLAYER 
PROFILE_TIME_WORLD_ITEM_ENTITIES 
PROFILE_TIME_WORLD_EFFECTS 
PROFILE_TIME_WORLD_CAMERAS 
PROFILER_TIME_COUNT 

Definition at line 52 of file profiling.h.

52 {
62#ifdef PUPPYPRINT_DEBUG
65#endif
66#ifdef GFX_PROFILING
69#else
71#endif
72#ifdef AUDIO_PROFILING
74
76#else
78#endif
85
86 // state_world
93
94 PROFILER_TIME_COUNT // Must be last!
95};
#define AUDIO_SUBSET_ENTRIES
Definition profiling.h:23
#define PROFILER_TIME_PUPPYPRINT2
Definition profiling.h:113
@ PROFILER_TIME_CMD
Definition profiling.h:84
@ PROFILER_TIME_TMEM
Definition profiling.h:82
@ PROFILER_TIME_TOTAL
Definition profiling.h:79
@ PROFILE_TIME_WORLD_PLAYER
Definition profiling.h:89
@ PROFILER_TIME_CONTROLLERS
Definition profiling.h:54
@ PROFILER_TIME_PIPE
Definition profiling.h:83
@ PROFILER_TIME_FPS
Definition profiling.h:53
@ PROFILER_TIME_ENTITIES
Definition profiling.h:61
@ PROFILE_TIME_WORLD_EFFECTS
Definition profiling.h:91
@ PROFILER_TIME_GFX
Definition profiling.h:68
@ PROFILER_TIME_RSP_AUDIO
Definition profiling.h:81
@ PROFILER_TIME_MESSAGES
Definition profiling.h:58
@ PROFILE_TIME_WORLD_ENCOUNTERS
Definition profiling.h:87
@ PROFILE_TIME_WORLD_ITEM_ENTITIES
Definition profiling.h:90
@ PROFILER_TIME_HUD_ELEMENTS
Definition profiling.h:59
@ PROFILE_TIME_WORLD_NPCS
Definition profiling.h:88
@ PROFILER_TIME_TRIGGERS
Definition profiling.h:56
@ PROFILER_TIME_COUNT
Definition profiling.h:94
@ PROFILER_TIME_RSP_GFX
Definition profiling.h:80
@ PROFILER_TIME_STEP_GAME_MODE
Definition profiling.h:60
@ PROFILER_TIME_WORKERS
Definition profiling.h:55
@ PROFILER_TIME_EVT
Definition profiling.h:57
@ PROFILE_TIME_WORLD_CAMERAS
Definition profiling.h:92
@ PROFILER_TIME_AUDIO
Definition profiling.h:77
#define GFX_SUBSET_ENTRIES
Definition profiling.h:36
#define PROFILER_TIME_PUPPYPRINT1
Definition profiling.h:112

◆ ProfilerRSPTime

Enumerator
PROFILER_RSP_GFX 
PROFILER_RSP_AUDIO 
PROFILER_RSP_COUNT 

Definition at line 97 of file profiling.h.

97 {
101};
@ PROFILER_RSP_COUNT
Definition profiling.h:100
@ PROFILER_RSP_AUDIO
Definition profiling.h:99
@ PROFILER_RSP_GFX
Definition profiling.h:98

◆ ProfilerDeltaTime

Enumerator
PROFILER_DELTA_COLLISION 

Definition at line 103 of file profiling.h.

103 {
105#ifdef PUPPYPRINT_DEBUG
108#endif
109};
#define PROFILER_DELTA_PUPPYPRINT1
Definition profiling.h:114
@ PROFILER_DELTA_COLLISION
Definition profiling.h:104
#define PROFILER_DELTA_PUPPYPRINT2
Definition profiling.h:115

◆ ProfilerTimeAudioUnused

Enumerator
PROFILER_TIME_SUB_AUDIO_START 
PROFILER_TIME_SUB_AUDIO_SEQUENCES 
PROFILER_TIME_SUB_AUDIO_SEQUENCES_SCRIPT 
PROFILER_TIME_SUB_AUDIO_SEQUENCES_RECLAIM 
PROFILER_TIME_SUB_AUDIO_SEQUENCES_PROCESSING 
PROFILER_TIME_SUB_AUDIO_SYNTHESIS 
PROFILER_TIME_SUB_AUDIO_SYNTHESIS_PROCESSING 
PROFILER_TIME_SUB_AUDIO_SYNTHESIS_ENVELOPE_REVERB 
PROFILER_TIME_SUB_AUDIO_SYNTHESIS_DMA 
PROFILER_TIME_SUB_AUDIO_UPDATE 
PROFILER_TIME_SUB_AUDIO_END 

Definition at line 275 of file profiling.h.

275 {
277};

Variable Documentation

◆ gfx_subset_starts

u32 gfx_subset_starts[PROFILER_TIME_SUB_GFX_END - PROFILER_TIME_SUB_GFX_START]
extern

◆ gfx_subset_tallies

u32 gfx_subset_tallies[PROFILER_TIME_SUB_GFX_END - PROFILER_TIME_SUB_GFX_START]
extern