[profiler] client: updated to use new lgmp API and path

This commit is contained in:
Geoffrey McRae 2020-05-19 11:37:44 +10:00
parent 007122df43
commit aff19e13c7
3 changed files with 20 additions and 12 deletions

View File

@ -1 +1 @@
B1-195-g06f8911ee1+1
B1-196-g007122df43+1

View File

@ -52,8 +52,8 @@ set(SOURCES
src/main.c
)
add_subdirectory("${PROJECT_TOP}/common" "${CMAKE_BINARY_DIR}/common")
add_subdirectory("${PROJECT_TOP}/LGMP/lgmp" "${CMAKE_BINARY_DIR}/lgmp" )
add_subdirectory("${PROJECT_TOP}/common" "${CMAKE_BINARY_DIR}/common")
add_subdirectory("${PROJECT_TOP}/repos/LGMP/lgmp" "${CMAKE_BINARY_DIR}/lgmp" )
add_executable(profiler-client ${SOURCES})
target_compile_options(profiler-client PUBLIC ${PKGCONFIG_CFLAGS_OTHER})

View File

@ -104,25 +104,33 @@ static bool config_load(int argc, char * argv[])
return true;
}
static inline uint64_t nanotime()
{
struct timespec time;
clock_gettime(CLOCK_MONOTONIC_RAW, &time);
return ((uint64_t)time.tv_sec * 1e9) + time.tv_nsec;
}
static int run()
{
PLGMPClient lgmp;
PLGMPClientQueue frameQueue;
uint32_t udataSize;
KVMFR *udata;
LGMP_STATUS status;
if ((status = lgmpClientInit(state.shmDev.mem, state.shmDev.size, &lgmp)) != LGMP_OK)
if ((status = lgmpClientInit(state.shmDev.mem, state.shmDev.size, &lgmp,
&udataSize, (uint8_t **)&udata)) != LGMP_OK)
{
DEBUG_ERROR("lgmpClientInit: %s", lgmpStatusString(status));
return -1;
}
if (udataSize != sizeof(KVMFR) ||
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 ||
udata->version != KVMFR_VERSION)
{
DEBUG_BREAK();
DEBUG_ERROR("The host application is not compatible with this client");
DEBUG_ERROR("Expected KVMFR version %d", KVMFR_VERSION);
DEBUG_BREAK();
return -1;
}
if ((status = lgmpClientSubscribe(lgmp, LGMP_Q_FRAME, &frameQueue) != LGMP_OK))
{
DEBUG_ERROR("lgmpClientSubscribe: %s", lgmpStatusString(status));
@ -227,4 +235,4 @@ int main(int argc, char * argv[])
ivshmemClose(&state.shmDev);
option_free();
return ret;
}
}