From 46527648b4799a4cd5eb7519eb7f6ff01fb2e4be Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 16 Mar 2015 08:21:33 -0600 Subject: [PATCH] glave: Use generated code to get pAppInfo struct size --- glave-generate.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/glave-generate.py b/glave-generate.py index 065cc55..3430342 100755 --- a/glave-generate.py +++ b/glave-generate.py @@ -521,7 +521,7 @@ class Subcommand(object): func_body.append(' }') func_body.append(' startTime = glv_get_time();') func_body.append(' %sreal_xgl%s;' % (return_txt, proto.c_call())) - func_body.append(' CREATE_TRACE_PACKET(xgl%s, sizeof(XGL_INSTANCE) + calc_size_XGL_APPLICATION_INFO(pAppInfo) + ((pAllocCb == NULL) ? 0 :sizeof(XGL_ALLOC_CALLBACKS)));' % (proto.name)) + func_body.append(' CREATE_TRACE_PACKET(xgl%s, sizeof(XGL_INSTANCE) + get_struct_chain_size((void*)pAppInfo) + ((pAllocCb == NULL) ? 0 :sizeof(XGL_ALLOC_CALLBACKS)));' % (proto.name)) func_body.append(' pHeader->entrypoint_begin_time = startTime;') func_body.append(' if (isHooked == FALSE) {') func_body.append(' AttachHooks();') @@ -1281,10 +1281,6 @@ class Subcommand(object): def _generate_struct_util_funcs(self): pid_enum = [] pid_enum.append('//=============================================================================') - pid_enum.append('static uint64_t calc_size_XGL_APPLICATION_INFO(const XGL_APPLICATION_INFO* pStruct)') - pid_enum.append('{') - pid_enum.append(' return ((pStruct == NULL) ? 0 : sizeof(XGL_APPLICATION_INFO)) + strlen(pStruct->pAppName) + 1 + strlen(pStruct->pEngineName) + 1;') - pid_enum.append('}\n') pid_enum.append('static void add_XGL_APPLICATION_INFO_to_packet(glv_trace_packet_header* pHeader, XGL_APPLICATION_INFO** ppStruct, const XGL_APPLICATION_INFO *pInStruct)') pid_enum.append('{') pid_enum.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)ppStruct, sizeof(XGL_APPLICATION_INFO), pInStruct);') -- 2.7.4