Skip to content

Commit

Permalink
Debugger: Profiler - Show [irq]/[nmi] markers on functions
Browse files Browse the repository at this point in the history
  • Loading branch information
SourMesen committed Dec 17, 2024
1 parent d1aa957 commit 1e3422b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Core/Debugger/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void Profiler::StackFunction(AddressInfo &addr, StackFrameFlags stackFlag)

ProfiledFunction& func = _functions[key];
func.CallCount++;
func.Flags = stackFlag;

_currentFunction = key;
_currentCycleCount = 0;
Expand Down
1 change: 1 addition & 0 deletions Core/Debugger/Profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct ProfiledFunction
uint64_t MinCycles = UINT64_MAX;
uint64_t MaxCycles = 0;
AddressInfo Address = {};
StackFrameFlags Flags = {};
};

class Profiler
Expand Down
6 changes: 6 additions & 0 deletions UI/Debugger/ViewModels/ProfilerWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ public static string GetFunctionName(this ProfiledFunction func, CpuType cpuType
}
}

if(func.Flags.HasFlag(StackFrameFlags.Irq)) {
functionName = "[irq] " + functionName;
} else if(func.Flags.HasFlag(StackFrameFlags.Nmi)) {
functionName = "[nmi] " + functionName;
}

return functionName;
}
}
Expand Down
1 change: 1 addition & 0 deletions UI/Interop/DebugApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,7 @@ public struct ProfiledFunction
public UInt64 MinCycles;
public UInt64 MaxCycles;
public AddressInfo Address;
public StackFrameFlags Flags;

public UInt64 GetAvgCycles()
{
Expand Down

0 comments on commit 1e3422b

Please sign in to comment.