Skip to content
Vadim Slyusarev edited this page Jul 7, 2015 · 16 revisions

Step 1: Download

Download and unzip archive with precompiled libraries:

  • Brofiler.exe (GUI for visualizing results)
  • Brofiler.h (Header to include)
  • ProfilerCore64.lib (Library to link)
  • ProfilerCore64.dll (DLL with implementation)
  • EasyHook64.dll (EasyHook)
  • ProfilerTest64.exe (Small console application to test profiler)

Step 2: Integration

  • Add recently unpacked directory to Project Properties -> C/C++ -> Additional Include Directories
  • Add ProfilerCore.lib to Project Properties -> Linker -> Input -> Additional Dependencies
  • Find Main Loop of your Game and insert BROFILER_FRAME macros:
#include "Brofiler.h"

while(true)
{ BROFILER_FRAME("YourThreadName")
  ...
}
  • Copy ProfilerCore64.dll and EasyHook64.dll to your working directory

Step 3: First Launch

Launch your Game.
Launch Brofiler.exe.
Click Start Button .

When you are ready click Stop Button .
If your see a picture similar to this one - everything is OK, move to the next step.

Step 4: Instrumentation Mode

Add some profiling counters to your code.

#include "Brofiler.h"

//Just add BROFILE macros at the beginning of a function
void Engine::UpdateInput()
{ BROFILE

}

Add some profiling categories to your code (colorized counters).

#include "Brofiler.h"

//There is a lot of predefined standard colors
void Engine::UpdateLogic()
{ BROFILER_CATEGORY( "UpdateLogic", Profiler::Color::Orchid )
  
}

Step 5: Sampling Mode

Check suspect functions in the table.

From now these functions are marked for sampling.
All the code inside the scope of these functions will be sampled during next run.
Click Start Button to start new profiling run, press Stop Button to get results.
Click to clear all sampling scopes.

Step 6: Hooking Mode

Open any Sampling Frame. Click a checkbox in the table with sampling results to inject profiler counter inside this function.

Get another profining run.
Click to remove all injected counters.

Step 7: Source View

Double click on any row in the table will open Source View window.

Step 8: Save and Load

Click to save *.prof file with active session.
Drag and Drop any *.prof file on the timeline to load it.

Clone this wiki locally