Exemple #1
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()
Exemple #2
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()
Exemple #3
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()
Exemple #4
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()
Exemple #5
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()
Exemple #6
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()