[development] Consolidated programmatic profiler capture API (#4969)

Merged overlapping profiler EBuses/Interfaces into AzCore
Fixed ambiguous LogLevel type in some unity file scenarios
Added cvar/console access for profiler capture
Added utilities for reflecting AZ::Interfaces through the BehaviorContext
Included profiler system sample python script

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
This commit is contained in:
Scott Romero
2021-11-02 09:00:15 -07:00
committed by GitHub
21 changed files with 536 additions and 267 deletions
@@ -0,0 +1,7 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
@@ -0,0 +1,30 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import azlmbr.debug as debug
import pathlib
def test_profiler_system():
if not debug.g_ProfilerSystem.IsValid():
print('g_ProfilerSystem is INVALID')
return
state = 'ACTIVE' if debug.g_ProfilerSystem.IsActive() else 'INACTIVE'
print(f'Profiler system is currently {state}')
capture_location = pathlib.Path(debug.g_ProfilerSystem.GetCaptureLocation())
print(f'Capture location set to {capture_location}')
print('Capturing single frame...' )
capture_file = str(capture_location / 'script_capture_frame.json')
debug.g_ProfilerSystem.CaptureFrame(capture_file)
# Invoke main function
if __name__ == '__main__':
test_profiler_system()