Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose 2 symbols from android_main #1739

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

panos-lunarg
Copy link
Contributor

MainGetCurrentBlockIndex and MainGetLoadingTrimmedState whould de discoveralbe through dlopen + dlsym from the android replay native .so:

  • MainGetCurrentBlockIndex(): Returns the current block index as calculated from the file processor

  • MainGetLoadingTrimmedState(): Returns wheter file processor is between a FrameStateBegin/FrameStateEnd markers pair

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 255434.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4824 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4824 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 257140.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4834 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4834 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 257347.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4836 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4836 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 257792.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4838 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4838 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 257826.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4840 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4840 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 257885.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4843 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4843 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 259546.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4864 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4864 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 260151.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4875 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4875 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4885 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4885 passed.

framework/util/mark_injected_commands.cpp Outdated Show resolved Hide resolved
framework/util/mark_injected_commands.cpp Outdated Show resolved Hide resolved
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 263769.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4892 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4892 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 263824.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4894 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4894 passed.

static bool injecting_api_calls_g = false;
#endif

using PFN_BeginInjectedCommands = void (*)();
Copy link
Contributor

@dfriederich dfriederich Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, I wonder if those callbacks should have some void* pointers to allow using code not to rely on globals, just to have a bit a cleaner API even if it is not strictly needed for the current uses. Something like

using PFN_BeginInjectedCommands = void (*)(void*);
using PFN_EndInjectedCommands   = void (*)(void*);

static PFN_BeginInjectedCommands BeginInjectCommands_fp = BeginEndInjectedCommandsNoop;
static PFN_EndInjectedCommands   EndInjectCommands_fp   = BeginEndInjectedCommandsNoop;
static void* InjectCommandsData_ptr = nullptr;
extern "C" void SetInjectedCommandCallbacks(PFN_BeginInjectedCommands begin_fp, PFN_EndInjectedCommands end_fp, void* data)
{
    BeginInjectCommands_fp = begin_fp;
    EndInjectCommands_fp   = end_fp;
    InjectCommandsData_ptr = data;
}

void BeginInjectedCommands()
{
....
    BeginInjectCommands_fp(InjectCommandsData_ptr);
}

Edit by @panos-lunarg: Fixed markdown formatting

extern "C" void SetInjectedCommandCallbacks(PFN_BeginInjectedCommands begin_fp, PFN_EndInjectedCommands end_fp)
{
BeginInjectCommands_fp = begin_fp;
EndInjectCommands_fp = end_fp;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To allow a client to clear the callbacks, this should check if begin_fp / end_fp is nullptr, and if so assign BeginEndInjectedCommandsNoop.
Otherwise when for example unloading the sokatoa vulkan layer, it cannot cleanup after itself and keep this code in a working state.
(just a note, I don't think we run into this, but would be better if the API supports cleanup)

Copy link
Contributor

@dfriederich dfriederich Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, I wonder if we should have some header/place where all exported api's are declared with some docu.
Right now the exported functions are defined in different cpp files, and if I don't know what to look out for I would not find any connection. (well maybe there is no connection :-) ).

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 265998.

@panos-lunarg
Copy link
Contributor Author

@dfriederich All your comments have good points. I hoped I addressed all of them

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4914 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4914 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 266385.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4915 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4915 passed.

@bradgrantham-lunarg bradgrantham-lunarg added the P1 Prevents an important capture from being replayed label Oct 7, 2024
MainGetCurrentBlockIndex and MainGetLoadingTrimmedState whould de
discoveralbe through dlopen + dlsym from the android replay native .so:

- MainGetCurrentBlockIndex():
Returns the current block index as calculated from the file processor

- MainGetLoadingTrimmedState():
Returns wheter file processor is between a FrameStateBegin/FrameStateEnd
markers pair
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 284987.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5158 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5158 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Prevents an important capture from being replayed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants