mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-21 21:17:19 +00:00
[profiler] client: updated to use new lgmp API and path
This commit is contained in:
parent
007122df43
commit
aff19e13c7
@ -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})
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user