void xed_print_decode_stats()
{
//for ILD perf measurements
#if defined(XED_ILD) && defined(XED_ILD_ONLY)
    print_decode_stats_internal(&ild_stats, "ILD");

#else
    xed_int64_t growth;
    print_decode_stats_internal(&xed_stats, "XED2"); 

    printf("#Bad times: " XED_FMT_LU "\n", xed_stats.bad_times);
    printf("#Total input length bytes: " XED_FMT_LU "\n", 
           xed_stats.total_ilen );
    printf("#Total output length bytes: " XED_FMT_LU "\n",
           xed_stats.total_olen );
    printf("#Growth bytes: " XED_FMT_LU "\n", xed_stats.total_longer );
    printf("#Shrinkage bytes: " XED_FMT_LU "\n", xed_stats.total_shorter );
    growth = xed_stats.total_olen - xed_stats.total_ilen;
    printf("#Growth/Shrinkage  bytes: " XED_FMT_LD "\n", growth );
    if (xed_stats.total_ilen)    {
        double pct_growth = \
               100.0 * growth / (double) XCAST(xed_stats.total_ilen);
        printf("#Code size growth percent: %f\n", pct_growth);
    }

#endif //defined(XED_ILD) && defined(XED_ILD_ONLY)
}
Esempio n. 2
0
File: sdtid.c Progetto: zbuc/stoken
static int replace_string(struct sdtid *s, xmlNode *node,
			  const char *name, const char *value)
{
	int ret = __replace_string(s, node, name, value);
	if (ret != ERR_GENERAL) {
		s->error = ret;
		return ret;
	}

	/* not found => create a new string at the end of the section */
	if (xmlNewTextChild(node, NULL, XCAST(name), XCAST(value)) == NULL) {
		s->error = ERR_NO_MEMORY;
		return ERR_NO_MEMORY;
	}

	return ERR_NONE;
}
static void print_decode_stats_internal(xed_decode_stats_t* p, 
    const char* sname) {
    double cpi;
    double cpi_tail;
    printf("%s STATS\n", sname);
    printf("#Total decode cycles:        " XED_FMT_LU "\n", 
           p->total_time);
    printf("#Total instructions decoded: " XED_FMT_LU "\n", 
           p->total_insts);
    printf("#Total tail decode cycles:        " XED_FMT_LU "\n", 
           p->total_time_tail);
    printf("#Total tail instructions decoded: " XED_FMT_LU "\n", 
           p->total_insts_tail);

    cpi  =  1.0 * XCAST(p->total_time) / XCAST(p->total_insts);
    printf("#Total cycles/instructions decoded: %f\n" , cpi);

    cpi_tail  =  1.0 * XCAST(p->total_time_tail) / XCAST(p->total_insts_tail);
    printf("#Total tail cycles/instructions decoded: %f\n" , cpi_tail);

    printf("#Bad times: " XED_FMT_LU "\n", p->bad_times);
}
Esempio n. 4
0
    IDirectInputDevice7AImpl_WriteEffectToFile,
    IDirectInputDevice8AImpl_BuildActionMap,
    IDirectInputDevice8AImpl_SetActionMap,
    IDirectInputDevice8AImpl_GetImageInfo
};

#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun)	(typeof(SysMouseWvt.fun))
#else
# define XCAST(fun)	(void*)
#endif

static const IDirectInputDevice8WVtbl SysMouseWvt =
{
    IDirectInputDevice2WImpl_QueryInterface,
    XCAST(AddRef)IDirectInputDevice2AImpl_AddRef,
    XCAST(Release)IDirectInputDevice2AImpl_Release,
    XCAST(GetCapabilities)SysMouseAImpl_GetCapabilities,
    IDirectInputDevice2WImpl_EnumObjects,
    XCAST(GetProperty)SysMouseAImpl_GetProperty,
    XCAST(SetProperty)IDirectInputDevice2AImpl_SetProperty,
    XCAST(Acquire)SysMouseAImpl_Acquire,
    XCAST(Unacquire)SysMouseAImpl_Unacquire,
    XCAST(GetDeviceState)SysMouseAImpl_GetDeviceState,
    XCAST(GetDeviceData)SysMouseAImpl_GetDeviceData,
    XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat,
    XCAST(SetEventNotification)IDirectInputDevice2AImpl_SetEventNotification,
    XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel,
    SysMouseWImpl_GetObjectInfo,
    SysMouseWImpl_GetDeviceInfo,
    XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel,
Esempio n. 5
0
    FIXME("(%p)->(%p) stub!\n", iface, pFrameTime);

    return E_NOTIMPL;
}

/* Note: Hack so we can reuse the old functions without compiler warnings */
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun)     (typeof(DirectDrawMediaStream_Vtbl.fun))
#else
# define XCAST(fun)     (void*)
#endif

static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStream_Vtbl =
{
    IDirectDrawMediaStreamImpl_QueryInterface,
    XCAST(AddRef)IMediaStreamImpl_AddRef,
    XCAST(Release)IMediaStreamImpl_Release,
    XCAST(GetMultiMediaStream)IMediaStreamImpl_GetMultiMediaStream,
    XCAST(GetInformation)IMediaStreamImpl_GetInformation,
    XCAST(SetSameFormat)IMediaStreamImpl_SetSameFormat,
    XCAST(AllocateSample)IMediaStreamImpl_AllocateSample,
    XCAST(CreateSharedSample)IMediaStreamImpl_CreateSharedSample,
    XCAST(SendEndOfStream)IMediaStreamImpl_SendEndOfStream,
    IDirectDrawMediaStreamImpl_GetFormat,
    IDirectDrawMediaStreamImpl_SetFormat,
    IDirectDrawMediaStreamImpl_GetDirectDraw,
    IDirectDrawMediaStreamImpl_SetDirectDraw,
    IDirectDrawMediaStreamImpl_CreateSample,
    IDirectDrawMediaStreamImpl_GetTimePerFrame
};
#undef XCAST
Esempio n. 6
0
{
    IDirectInputImpl *This = (IDirectInputImpl *)iface;

    FIXME("(this=%p,%p,%p,%04lx,%p): stub\n", This, lpdiCallback, lpdiCDParams,
          dwFlags, pvRefData);
    return 0;
}

#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun)   (typeof(ddi7avt.fun))
#else
# define XCAST(fun)	(void*)
#endif

static const IDirectInput7AVtbl ddi7avt = {
    XCAST(QueryInterface)IDirectInputAImpl_QueryInterface,
    XCAST(AddRef)IDirectInputAImpl_AddRef,
    XCAST(Release)IDirectInputAImpl_Release,
    XCAST(CreateDevice)IDirectInputAImpl_CreateDevice,
    XCAST(EnumDevices)IDirectInputAImpl_EnumDevices,
    XCAST(GetDeviceStatus)IDirectInputAImpl_GetDeviceStatus,
    XCAST(RunControlPanel)IDirectInputAImpl_RunControlPanel,
    XCAST(Initialize)IDirectInputAImpl_Initialize,
    XCAST(FindDevice)IDirectInput2AImpl_FindDevice,
    XCAST(CreateDeviceEx)IDirectInput7AImpl_CreateDeviceEx
};

#undef XCAST
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun)   (typeof(ddi7wvt.fun))
#else