예제 #1
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        # Load presets and verify the respective functions get hooked.
        LoadPreset(preset_name='draw_frame_in_hello_ggp_1_68'),
        VerifyFunctionHooked(function_search_string='DrawFrame'),
        LoadPreset(preset_name='ggp_issue_frame_token_in_hello_ggp_1_68'),
        VerifyFunctionHooked(function_search_string='GgpIssueFrameToken'),
        # Verify that the functions from the presets end up in the capture.
        Capture(),
        VerifyFunctionCallCount(function_name='DrawFrame',
                                min_calls=30,
                                max_calls=3000),
        VerifyFunctionCallCount(function_name='GgpIssueFrameToken',
                                min_calls=30,
                                max_calls=3000),
        # Create a new preset. Unhooking and applying this preset results in the function being hooked.
        UnhookAllFunctions(),
        FilterAndHookFunction(function_search_string="ClockNowMicroSeconds"),
        SavePreset(preset_name="clock_now_micro_seconds_in_hello_ggp.opr"),
        UnhookAllFunctions(),
        LoadPreset(preset_name='clock_now_micro_seconds_in_hello_ggp'),
        VerifyFunctionHooked(function_search_string='ClockNowMicroSeconds'),
        # Test the status of different presets.
        UnhookAllFunctions(),
        VerifyPresetStatus(preset_name='clock_now_micro_seconds_in_hello_ggp',
                           expected_status=PresetStatus.LOADABLE),
        VerifyPresetStatus(preset_name='partially_loadable',
                           expected_status=PresetStatus.PARTIALLY_LOADABLE),
        VerifyPresetStatus(preset_name='not_loadable',
                           expected_status=PresetStatus.NOT_LOADABLE),
        # Test proper warnings when applying partially loadable or not loadable presets.
        LoadPreset(preset_name='partially_loadable'),
        VerifyFunctionHooked(function_search_string='__GI___clock_gettime'),
        UnhookAllFunctions(),
        LoadPreset(preset_name='not_loadable'),
        # Test for proper preset status when switching processes.
        EndSession(),
        FilterAndSelectFirstProcess(process_filter="OrbitService"),
        VerifyPresetStatus(preset_name='clock_now_micro_seconds_in_hello_ggp',
                           expected_status=PresetStatus.NOT_LOADABLE),
        VerifyPresetStatus(preset_name='partially_loadable',
                           expected_status=PresetStatus.PARTIALLY_LOADABLE),
        VerifyPresetStatus(preset_name='not_loadable',
                           expected_status=PresetStatus.NOT_LOADABLE),
        # Load a partially loadable preset and check that the symbols for the module get loaded.
        LoadPreset(preset_name='partially_loadable'),
        VerifyFunctionHooked(function_search_string='__GI___clock_gettime'),
        VerifyModuleLoaded(module_search_string="libc-"),
    ]
    suite = E2ETestSuite(test_name="Load Preset", test_cases=test_cases)
    suite.execute()
예제 #2
0
def main(argv):
    tracks = [
        "DynamicName_0", "DynamicName_1", "DynamicName_2", "DynamicName_3", "double_var",
        "float_var", "int64_var", "int_var", "uint64_var", "uint_var", "ORBIT_ASYNC_TASKS",
        "ORBIT_START_ASYNC_TEST"
    ]
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='OrbitTest'),
        LoadSymbols(module_search_string="OrbitTest"),
        # Take a capture without manual instrumentation and assert that no tracks show up.
        Capture(manual_instrumentation=False),
        VerifyTracksDoNotExist(track_names=tracks),
        # Take a capture with manual instrumentation and check for the existence of the tracks and the timers in the thread tracks.
        Capture(manual_instrumentation=True),
        VerifyTracksExist(track_names=tracks),
        FilterTracks(filter_string="OrbitThread_", expected_track_count=3),
        ToggleCollapsedStateOfAllTracks(),
        CheckTimers(track_name_filter="OrbitThread_*"),
        # Take another capture without manual instrumentation and assert that the tracks are gone.
        Capture(manual_instrumentation=False),
        VerifyTracksDoNotExist(track_names=tracks),
    ]
    suite = E2ETestSuite(test_name="Manual Instrumentation", test_cases=test_cases)
    suite.execute()
예제 #3
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period='030'),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period=''),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period='ab'),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period='0'),
        Capture(collect_system_memory_usage=True),
        VerifyTracksExist(track_names="Page Faults*"),
        ExpandTrack(expected_name="Page Faults"),
        CollapseTrack(expected_name="Page Faults"),
        VerifyTracksExist(track_names="Memory Usage: System*"),
        ExpandTrack(expected_name="Memory Usage: System (MB)"),
        CollapseTrack(expected_name="Memory Usage: System (MB)"),
        VerifyTracksExist(track_names="Memory Usage: CGroup*"),
        ExpandTrack(expected_name="Memory Usage: CGroup (MB)"),
        CollapseTrack(expected_name="Memory Usage: CGroup (MB)"),
        Capture(),
        VerifyTracksDoNotExist(track_names="Page Faults*"),
        VerifyTracksDoNotExist(track_names="*Memory Usage*")
    ]
    suite = E2ETestSuite(
        test_name="Collect Memory Usage & Page Faults Information",
        test_cases=test_cases)
    suite.execute()
예제 #4
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        Capture(),
        # "sdma0" is not present on the DevKits, instead there is "vce0", so this tests for "sdma0 or vce0"
        MatchTracks(expected_names=[
            "Scheduler", ("*sdma0*", "*vce0*"), "gfx", "All Threads",
            "hello_ggp_stand"
        ],
                    allow_additional_tracks=True),
        SelectTrack(track_index=4),
        DeselectTrack(),
        SelectTrack(track_index=0,
                    expect_failure=True),  # Scheduler track cannot be selected
        MoveTrack(track_index=4, new_index=0),
        MoveTrack(track_index=0, new_index=3),
        MoveTrack(track_index=3, new_index=4),
        # TODO: The numbers below are very pessimistic, but it's not assured additional tracks like
        # GgpSwapChain, GgpVideoIpcRead etc are present - GgpSwapChain is missing on the DevKit, others
        # depend on the samples that have been taken
        FilterTracks(filter_string="hello", expected_count=2),
        FilterTracks(filter_string="Hello", expected_count=2),
        FilterTracks(filter_string="ggp",
                     expected_count=2,
                     allow_additional_tracks=True),
        FilterTracks(filter_string="",
                     expected_count=4,
                     allow_additional_tracks=True)
    ]
    suite = E2ETestSuite(test_name="Track Interaction", test_cases=test_cases)
    suite.execute()
예제 #5
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        LoadAndVerifyHelloGgpPreset()
    ]
    suite = E2ETestSuite(test_name="Load Preset", test_cases=test_cases)
    suite.execute()
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_'),
        Capture()
    ]
    suite = E2ETestSuite(test_name="Connect & Capture", test_cases=test_cases)
    suite.execute()
예제 #7
0
def main(argv):
    # During the tests, we want to verify that captures get automatically saved. We will do so by filtering the recent
    # captures list with the current date (in addition to also deleting old captures before this script runs). However,
    # if it is around midnight when this code gets executed and we store the date string, it can be that the capture
    # actually gets taken on the next day. Therefore, we will also check for the next day.
    today = date.today()
    tomorrow = today + timedelta(days=1)
    today_string = today.strftime("%Y_%m_%d")
    tomorrow_string = tomorrow.strftime("%Y_%m_%d")
    test_cases = [
        LoadCapture(capture_file_path="testdata\\OrbitTest_1-64.orbit",
                    expect_fail=True),
        LoadCapture(capture_file_path="testdata\\OrbitTest_1-72.orbit"),
        FilterTracks(filter_string="Scheduler", expected_track_count=1),
        CheckTimers(track_name_filter='Scheduler*'),
        FilterTracks(filter_string="Frame", expected_track_count=1),
        CheckTimers(track_name_filter='Frame track*'
                    ),  # Verify the frame track has timers
        FilterTracks(filter_string="DynamicName_", expected_track_count=5),
        FilterTracks(filter_string="_var", expected_track_count=6),
        FilterTracks(filter_string="OrbitThread_", expected_track_count=1),
        ToggleCollapsedStateOfAllTracks(),
        CheckTimers(track_name_filter="OrbitThread_*"),
        CheckThreadStates(track_name_filter='OrbitThread_*'),
        FilterTracks(filter_string="ORBIT_ASYNC_TASKS",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_ASYNC_TASKS"),
        FilterTracks(filter_string="ORBIT_START_ASYNC_TEST",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_START_ASYNC_TEST"),
        FilterTracks(filter_string=""),
        VerifyTracksExist(track_names=["Page*", "*System*", "*CGroup*"],
                          allow_duplicates=True),
        AddIterator(function_name="TestFunc2"),
        VerifyFunctionCallCount(function_name="TestFunc2",
                                min_calls=1257,
                                max_calls=1257),

        # Let's take a capture with the current version and verify this can be loaded
        EndSession(),
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        Capture(),
        VerifyTracksExist(track_names="hello_ggp_stand*",
                          allow_duplicates=True),
        EndSession(),
        # If we took the capture around midnight, we need to ensure to also look for the next day. Remember, the strings
        # get created before the tests run. Thus the `today_string` might be actually from the day before the capture
        # gets auto-saved.
        LoadLatestCapture(filter_strings=[
            f"hello_ggp_stand_{today_string}",
            f"hello_ggp_stand_{tomorrow_string}"
        ]),
        VerifyTracksExist(track_names="hello_ggp_stand*",
                          allow_duplicates=True)
    ]
    suite = E2ETestSuite(test_name="Capture Loading", test_cases=test_cases)
    suite.execute()
예제 #8
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        Capture(),
        VerifyHelloGgpTopDownContents()
    ]
    suite = E2ETestSuite(test_name="Top-Down View", test_cases=test_cases)
    suite.execute()
예제 #9
0
def main(argv):
    tab_title = "Symbols" if flags.FLAGS.enable_ui_beta else "Functions"
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        MoveTab(tab_title=tab_title, tab_name="FunctionsTab")
    ]
    suite = E2ETestSuite(test_name="Move tabs", test_cases=test_cases)
    suite.execute()
예제 #10
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp_c"),
        LoadSymbols(module_search_string="hello_ggp_c"),
        ShowSourceCode(function_search_string="DrawFrame"),
    ]
    suite = E2ETestSuite(test_name="Show Source Code", test_cases=test_cases)
    suite.execute()
예제 #11
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="call_foo_repeat"),
        LoadSymbols(module_search_string="call_foo_repeatedly"),
        FilterAndHookFunction(function_search_string="foo{(}{)}"),
        CaptureAndWaitForInterruptedWarning(user_space_instrumentation=True)
    ]
    suite = E2ETestSuite(test_name="Memory watchdog", test_cases=test_cases)
    suite.execute()
예제 #12
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="UE4Game"),
        Capture(),
        MatchTracks(expected_names=["gfx", "gfx_marker"],
                    allow_additional_tracks=True)
    ]
    suite = E2ETestSuite(test_name="Vulkan Layer", test_cases=test_cases)
    suite.execute()
예제 #13
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        LoadSymbols(module_search_string="hello_ggp"),
        FilterAndHookFunction(function_search_string='DrawFrame'),
        Capture(),
        AddIterator(function_name="DrawFrame")
    ]
    suite = E2ETestSuite(test_name="Add Iterator", test_cases=test_cases)
    suite.execute()
예제 #14
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        ClearSymbolCache(),
        LoadAllSymbolsAndVerifyCache(),
        EndSession(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        LoadAllSymbolsAndVerifyCache(expected_duration_difference_ratio=0.99),
        EndSession(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        LoadSymbols(module_search_string="libggp"),
        EndSession(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        ForceAndVerifySymbolUpdate(full_module_path="/user/local/cloudcast/lib/libggp.so",
                                   replace_with_module="/mnt/developer/hello_ggp_standalone")

    ]
    suite = E2ETestSuite(test_name="Symbol loading and caching", test_cases=test_cases)
    suite.execute()
예제 #15
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_'),
        Capture(collect_thread_states=True),
        CheckThreadStates(track_name_filter='hello_ggp_stand'),
        Capture(collect_thread_states=False),
        CheckThreadStates(track_name_filter='hello_ggp_stand', expect_exists=False),
    ]
    suite = E2ETestSuite(test_name="Collect Thread States", test_cases=test_cases)
    suite.execute()
예제 #16
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='triangle'),
        LoadSymbols(module_search_string="triangle.exe"),
        VerifySymbolsLoaded(symbol_search_string="wWinMain"),
        LoadSymbols(module_search_string="d3d11.dll"),
        VerifySymbolsLoaded(symbol_search_string="Present")
    ]
    suite = E2ETestSuite(test_name="Load Symbols PE/COFF",
                         test_cases=test_cases)
    suite.execute()
예제 #17
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        LoadSymbols(module_search_string="hello_ggp"),
        FilterAndHookFunction(function_search_string='DrawFrame'),
        Capture(),
        AddFrameTrack(function_name="DrawFrame"),
        VerifyTracksExist(track_names="Frame track*"),  # Verify there's exactly one frame track
        CheckTimers(track_name_filter='Frame track*')  # Verify the frame track has timers
    ]
    suite = E2ETestSuite(test_name="Add Frame Track", test_cases=test_cases)
    suite.execute()
예제 #18
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="UE4Game"),
        Capture(),
        VerifyTracksExist(track_names=["gfx"]),
        ExpandTrack(expected_name="gfx"),
        CheckTimers(track_name_filter='gfx_submissions', recursive=True),
        CheckTimers(track_name_filter='gfx_marker', recursive=True),
        CollapseTrack(expected_name="gfx")
    ]
    suite = E2ETestSuite(test_name="Vulkan Layer", test_cases=test_cases)
    suite.execute()
예제 #19
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_'),
        LoadSymbols(module_search_string="hello_ggp"),
        FilterAndHookFunction(function_search_string='DrawFrame'),
        Capture(),
        VerifyFunctionCallCount(function_name='DrawFrame',
                                min_calls=30,
                                max_calls=3000)
    ]
    suite = E2ETestSuite(test_name="Connect & Capture", test_cases=test_cases)
    suite.execute()
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_'),
        LoadSymbols(module_search_string="hello_ggp"),
        FilterAndEnableFrameTrackForFunction(
            function_search_string='DrawFrame'),
        LoadSymbols(module_search_string="libvulkan.so.1"),
        FilterAndEnableFrameTrackForFunction(
            function_search_string='vkQueuePresentKHR'),
        Capture(length_in_seconds=1),
        CaptureRepeatedly(number_of_f5_presses=200)
    ]
    suite = E2ETestSuite(test_name="Capture repeatedly", test_cases=test_cases)
    suite.execute()
예제 #21
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_'),
        LoadSymbols(module_search_string="libggp"),
        FilterAndHookMultipleFunctions(
            function_search_string='GgpIssueFrameToken_v'),
        Capture(),
        VerifyOneFunctionWasCalled(
            function_name_contains='GgpIssueFrameToken_v',
            min_calls=30,
            max_calls=3000)
    ]
    suite = E2ETestSuite(test_name="Instrument libggp", test_cases=test_cases)
    suite.execute()
예제 #22
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period='030'),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period=''),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period='ab'),
        SetAndCheckMemorySamplingPeriod(memory_sampling_period='0'),
        Capture(collect_system_memory_usage=True),
        FilterTracks(filter_string="Memory", expected_count=2),
        Capture(),
        FilterTracks(filter_string="Memory", expected_count=0)
    ]
    suite = E2ETestSuite(test_name="Collect System Memory Usage", test_cases=test_cases)
    suite.execute()
예제 #23
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='no_symbols_elf'),
        ClearSymbolCache(),
        ClearAllSymbolLocations(),
        LoadSymbols(module_search_string="no_symbols_elf", expect_fail=True),
        AddSymbolLocation(location=stale_path),
        LoadSymbols(module_search_string="no_symbols_elf", expect_fail=True),
        AddSymbolLocation(location=working_path),
        LoadSymbols(module_search_string="no_symbols_elf"),
        ClearAllSymbolLocations()
    ]
    suite = E2ETestSuite(test_name="Custom symbol locations",
                         test_cases=test_cases)
    suite.execute()
예제 #24
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_'),
        LoadSymbols(module_search_string="hello_ggp"),
        Capture(),
        CheckTimers(track_name_filter='Scheduler'),
        CheckTimers(track_name_filter='gfx'),
        CheckTimers(track_name_filter="All Threads", expect_exists=False),
        CheckTimers(track_name_filter="hello_ggp_stand", expect_exists=False),
        FilterAndHookFunction(function_search_string='DrawFrame'),
        Capture(),
        VerifyFunctionCallCount(function_name='DrawFrame', min_calls=30, max_calls=3000),
        CheckTimers(track_name_filter="All Threads", expect_exists=False),
        CheckTimers(track_name_filter="hello_ggp_stand")
    ]
    suite = E2ETestSuite(test_name="Instrument Function", test_cases=test_cases)
    suite.execute()
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_ggp'),
        Capture(),
        ToggleTrackTypeVisibility(track_type="Scheduler"),
        VerifyTracksDoNotExist(track_names="Scheduler"),
        VerifyTracksExist(track_names="hello_ggp_stand*",
                          allow_duplicates=True),
        ToggleTrackTypeVisibility(track_type="Threads"),
        VerifyTracksDoNotExist(track_names="hello_ggp_stand*"),
        ToggleTrackTypeVisibility(track_type="Threads"),
        VerifyTracksExist(track_names="hello_ggp_stand*",
                          allow_duplicates=True)
    ]
    suite = E2ETestSuite(test_name="Toggle track type visibility",
                         test_cases=test_cases)
    suite.execute()
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="triangle.exe"),
        LoadSymbols(module_search_string="triangle.exe"),
        Capture(manual_instrumentation=True),
        VerifyTracksExist(track_names=[
            "Frame time, ms (double)", "Frame time, ms (float)",
            "Frame time, us (int)", "Frame time, us (int64)",
            "Frame time, us (uint)", "Frame time, us (uint64)",
            "Render (async)"
        ]),
        VerifyTracksExist(track_names="triangle.exe", allow_duplicates=True),
        CheckTimers(track_name_filter="Render (async)"),
        # There are multiple tracks with the name of the process, and we can't rename threads on Windows,
        # hence `require_all=False`.
        CheckTimers(track_name_filter="triangle.exe", require_all=False),
    ]
    suite = E2ETestSuite(test_name="Manual Instrumentation on Silenus",
                         test_cases=test_cases)
    suite.execute()