Skip to content

Commit

Permalink
Perf events (intel#148)
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Ermilov <[email protected]>
  • Loading branch information
dmitryermilov authored Jul 21, 2021
1 parent 632c50a commit 870871c
Show file tree
Hide file tree
Showing 18 changed files with 333 additions and 95 deletions.
1 change: 1 addition & 0 deletions _studio/mfx_lib/decode/vp8/src/mfx_vp8_dec_decode_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ mfxStatus VideoDECODEVP8_HW::DecodeFrameCheck(mfxBitstream *p_bs, mfxFrameSurfac

{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "VP8 decode DDISubmitTask");
PERF_EVENT(MFX_TRACE_HOTSPOT_DDI_SUBMIT_TASK, 0, make_event_data(this), [&]() { return make_event_data(sts);});

if (m_p_video_accelerator->BeginFrame(memId, 0) == UMC::UMC_OK)
{
Expand Down
2 changes: 2 additions & 0 deletions _studio/mfx_lib/decode/vp9/src/mfx_vp9_dec_decode_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,8 @@ mfxStatus VideoDECODEVP9_HW::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1
if (!m_frameInfo.show_existing_frame)
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "VP9 decode DDISubmitTask");
PERF_EVENT(MFX_TRACE_HOTSPOT_DDI_SUBMIT_TASK, 0, make_event_data(this), [&]() { return make_event_data(sts);});

UMC::Status umcSts = m_va->BeginFrame(m_frameInfo.currFrame, 0);
MFX_CHECK(UMC::UMC_OK == umcSts, MFX_ERR_DEVICE_FAILED);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ void DDI_VA::SubmitTask(const FeatureBlocks& /*blocks*/, TPushST Push)
auto& task = Task::Common::Get(s_task);

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "H265 encode DDISubmitTask");
PERF_EVENT(MFX_TRACE_HOTSPOT_DDI_SUBMIT_TASK, 0, make_event_data(this), [&]() { return make_event_data(sts);});

m_callVa = Glob::DDI_Execute::Get(global);

Expand Down Expand Up @@ -300,7 +301,7 @@ void DDI_VA::SubmitTask(const FeatureBlocks& /*blocks*/, TPushST Push)
, "A|ENCODE|AVC|PACKET_END|", "%d|%d"
, m_vaContextEncode, task.StatusReportId);

return MFX_ERR_NONE;
return sts;
});
}

Expand All @@ -311,14 +312,17 @@ void DDI_VA::QueryTask(const FeatureBlocks& /*blocks*/, TPushQT Push)
{
auto& task = Task::Common::Get(s_task);

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "H265 encode DDIWaitTaskSync");
mfxStatus sts = MFX_ERR_NONE;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "H265 encode DDIWaitTaskSync");
PERF_EVENT(MFX_TRACE_HOTSPOT_DDI_WAIT_TASK_SYNC, 0, make_event_data(this), [&]() { return make_event_data(sts);});

m_callVa = Glob::DDI_Execute::Get(global);

MFX_CHECK((task.SkipCMD & SKIPCMD_NeedDriverCall), MFX_ERR_NONE);

return QueryStatus(Glob::DDI_Feedback::Get(global), task.StatusReportId);
sts = QueryStatus(Glob::DDI_Feedback::Get(global), task.StatusReportId);
return sts;
});
}

Expand Down
71 changes: 34 additions & 37 deletions _studio/mfx_lib/scheduler/linux/src/mfx_scheduler_core_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void mfxSchedulerCore::ThreadProc(MFX_SCHEDULER_THREAD_CONTEXT *pContext)
{
std::unique_lock<std::mutex> guard(m_guard);
mfxTaskHandle previousTaskHandle = {};
mfxU64 start, stop;
const uint32_t threadNum = pContext->threadNum;

{
Expand All @@ -63,52 +64,48 @@ void mfxSchedulerCore::ThreadProc(MFX_SCHEDULER_THREAD_CONTEXT *pContext)
// main working cycle for threads
while (false == m_bQuit)
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "thread_proc");

MFX_CALL_INFO call = {};
mfxStatus mfxRes;
{
MFX_CALL_INFO call = {};

pContext->state = MFX_SCHEDULER_THREAD_CONTEXT::Waiting;
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "SchedulerRoutine");
PERF_EVENT(MFX_TRACE_HOTSPOT_SCHED_ROUTINE, 0,
make_event_data(threadNum), [&](){ return make_event_data(call.res);});

pContext->state = MFX_SCHEDULER_THREAD_CONTEXT::Waiting;

mfxRes = GetTask(call, previousTaskHandle, threadNum);
if (MFX_ERR_NONE == mfxRes)
{
pContext->state = MFX_SCHEDULER_THREAD_CONTEXT::Running;
guard.unlock();
if (MFX_ERR_NONE == GetTask(call, previousTaskHandle, threadNum))
{
// perform asynchronous operation
call_pRoutine(call);
pContext->state = MFX_SCHEDULER_THREAD_CONTEXT::Running;
guard.unlock();
{
// perform asynchronous operation
call_pRoutine(call);
}
guard.lock();

pContext->workTime += call.timeSpend;
// save the previous task's handle
previousTaskHandle = call.taskHandle;

// mark the task completed,
// set the sync point into the high state if any.
MarkTaskCompleted(&call, threadNum);
continue;
}
guard.lock();

pContext->workTime += call.timeSpend;
// save the previous task's handle
previousTaskHandle = call.taskHandle;

// mark the task completed,
// set the sync point into the high state if any.
MarkTaskCompleted(&call, threadNum);
//timer1.Stop(0);
}
else
{
mfxU64 start, stop;


// mark beginning of sleep period
start = GetHighPerformanceCounter();
// mark beginning of sleep period
start = GetHighPerformanceCounter();

// there is no any task.
// sleep for a while until the event is signaled.
Wait(threadNum, guard);
// there is no any task.
// sleep for a while until the event is signaled.
Wait(threadNum, guard);

// mark end of sleep period
stop = GetHighPerformanceCounter();
// mark end of sleep period
stop = GetHighPerformanceCounter();

// update thread statistic
pContext->sleepTime += (stop - start);

}
// update thread statistic
pContext->sleepTime += (stop - start);
}
}

Expand Down
42 changes: 28 additions & 14 deletions _studio/mfx_lib/shared/src/libmfxsw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,24 @@ static mfxStatus MFXInit_Internal(mfxInitParam par, mfxSession* session, mfxIMPL

mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
{
mfxStatus mfxRes;
mfxStatus mfxRes = MFX_ERR_NONE;
int adapterNum = 0;
mfxIMPL impl = par.Implementation & (MFX_IMPL_VIA_ANY - 1);
mfxIMPL implInterface = par.Implementation & -MFX_IMPL_VIA_ANY;

MFXTrace_PerfInit();
MFX_TRACE_INIT();
{
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "ThreadName=MSDK app");
}

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXInitEx");
ETW_NEW_EVENT(MFX_TRACE_API_MFX_INIT_EX_TASK, 0, make_event_data((mfxU32) par.Implementation, par.GPUCopy), [&](){ return make_event_data(mfxRes, session ? *session : nullptr);});
PERF_EVENT(MFX_TRACE_API_MFX_INIT_EX_TASK, 0, make_event_data((mfxU32) par.Implementation, par.GPUCopy), [&](){ return make_event_data(mfxRes, session ? *session : nullptr);});

// check the library version
if (MakeVersion(par.Version.Major, par.Version.Minor) > MFX_VERSION)
{
MFX_RETURN(MFX_ERR_UNSUPPORTED);
mfxRes = MFX_ERR_UNSUPPORTED;
MFX_RETURN(mfxRes);
}

// check error(s)
Expand All @@ -94,7 +95,8 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
(MFX_IMPL_HARDWARE3 != impl) &&
(MFX_IMPL_HARDWARE4 != impl))
{
MFX_RETURN(MFX_ERR_UNSUPPORTED);
mfxRes = MFX_ERR_UNSUPPORTED;
MFX_RETURN(mfxRes);
}

// if user did not specify MFX_IMPL_VIA_* treat it as MFX_IMPL_VIA_ANY
Expand All @@ -105,7 +107,8 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
(MFX_IMPL_VIA_VAAPI != implInterface) &&
(MFX_IMPL_VIA_ANY != implInterface))
{
MFX_RETURN(MFX_ERR_UNSUPPORTED);
mfxRes = MFX_ERR_UNSUPPORTED;
MFX_RETURN(mfxRes);
}

// set the adapter number
Expand All @@ -132,19 +135,20 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
// app. must use MFXInitialize for 2.x features
if (par.Version.Major > 1)
{
MFX_RETURN(MFX_ERR_UNSUPPORTED);
mfxRes = MFX_ERR_UNSUPPORTED;
MFX_RETURN(mfxRes);
}

mfxStatus sts = MFXInit_Internal(par, session, implInterface, adapterNum);
mfxRes = MFXInit_Internal(par, session, implInterface, adapterNum);

// oneVPL should report 1.255 API version when it was initialized through MFXInit / MFXInitEx
if (session && *session && sts >= MFX_ERR_NONE)
if (session && *session && mfxRes >= MFX_ERR_NONE)
{
(*session)->m_versionToReport.Major = 1;
(*session)->m_versionToReport.Minor = 255;
}

return sts;
return mfxRes;

} // mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)

Expand Down Expand Up @@ -192,8 +196,9 @@ static mfxStatus MFXInit_Internal(mfxInitParam par, mfxSession *session, mfxIMPL
mfxStatus MFXDoWork(mfxSession session)
{
mfxStatus res;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXDoWork");
ETW_NEW_EVENT(MFX_TRACE_API_DO_WORK_TASK, 0, make_event_data(session), [&](){ return make_event_data(res);});
PERF_EVENT(MFX_TRACE_API_DO_WORK_TASK, 0, make_event_data(session), [&](){ return make_event_data(res);});

// check error(s)
if (0 == session)
Expand All @@ -216,9 +221,18 @@ mfxStatus MFXDoWork(mfxSession session)
return res;
} // mfxStatus MFXDoWork(mfxSession *session)

struct MFXTrace_PerfCloseOnExit
{
~MFXTrace_PerfCloseOnExit()
{
MFXTrace_PerfClose();
}
};

mfxStatus MFXClose(mfxSession session)
{
mfxStatus mfxRes = MFX_ERR_NONE;
MFXTrace_PerfCloseOnExit MFXTrace_PerfClose;

// check error(s)
if (0 == session)
Expand All @@ -233,7 +247,7 @@ mfxStatus MFXClose(mfxSession session)
// since it inserts class variable on stack which calls to trace library in the
// destructor.
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXClose");
ETW_NEW_EVENT(MFX_TRACE_API_MFX_CLOSE_TASK, 0, make_event_data(session), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_MFX_CLOSE_TASK, 0, make_event_data(session), [&](){ return make_event_data(mfxRes);});

// parent session can't be closed,
// because there is no way to let children know about parent's death.
Expand Down Expand Up @@ -275,7 +289,7 @@ mfxStatus MFX_CDECL MFXInitialize(mfxInitializationParam param, mfxSession* sess
mfxStatus mfxRes = MFX_ERR_NONE;

MFX_TRACE_INIT();
ETW_NEW_EVENT(MFX_TRACE_API_MFXINITIALIZE_TASK_ETW, 0, make_event_data((mfxU32)param.AccelerationMode, param.VendorImplID),
PERF_EVENT(MFX_TRACE_API_MFXINITIALIZE_TASK, 0, make_event_data((mfxU32)param.AccelerationMode, param.VendorImplID),
[&](){ return make_event_data(mfxRes, session ? *session : nullptr); }
);

Expand Down Expand Up @@ -451,7 +465,7 @@ mfxHDL* MFX_CDECL MFXQueryImplsDescription(mfxImplCapsDeliveryFormat format, mfx

MFX_TRACE_INIT();

ETW_NEW_EVENT(MFX_TRACE_API_MFXQUERYIMPLSDESCRIPTION_TASK_ETW, 0, make_event_data((mfxU32)format),
PERF_EVENT(MFX_TRACE_API_MFXQUERYIMPLSDESCRIPTION_TASK, 0, make_event_data((mfxU32)format),
[&]() { return make_event_data(*num_impls); }
);

Expand Down
3 changes: 1 addition & 2 deletions _studio/mfx_lib/shared/src/libmfxsw_async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ mfxStatus MFXVideoCORE_SyncOperation(mfxSession session, mfxSyncPoint syncp, mfx
{
mfxStatus mfxRes = MFX_ERR_NONE;


MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoCORE_SyncOperation");
ETW_NEW_EVENT(MFX_TRACE_API_SYNC_OPERATION_TASK, 0, make_event_data(session, syncp, wait), [&](){ return make_event_data(mfxRes, syncp);});
PERF_EVENT(MFX_TRACE_API_SYNC_OPERATION_TASK, 0, make_event_data(session, syncp, wait), [&](){ return make_event_data(mfxRes, syncp);});
MFX_CHECK(session, MFX_ERR_INVALID_HANDLE);
MFX_CHECK(syncp, MFX_ERR_NULL_PTR);

Expand Down
12 changes: 6 additions & 6 deletions _studio/mfx_lib/shared/src/libmfxsw_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ mfxStatus MFXVideoDECODE_Query(mfxSession session, mfxVideoParam *in, mfxVideoPa
mfxStatus mfxRes;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoDECODE_Query");
ETW_NEW_EVENT(MFX_TRACE_API_DECODE_QUERY_TASK, 0, make_event_data(session, in ? in->mfx.FrameInfo.Width : 0, in ? in->mfx.FrameInfo.Height : 0, in ? in->mfx.CodecId : 0), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_DECODE_QUERY_TASK, 0, make_event_data(session, in ? in->mfx.FrameInfo.Width : 0, in ? in->mfx.FrameInfo.Height : 0, in ? in->mfx.CodecId : 0), [&](){ return make_event_data(mfxRes);});
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, in);

try
Expand Down Expand Up @@ -235,7 +235,7 @@ mfxStatus MFXVideoDECODE_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfx
mfxStatus mfxRes;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoDECODE_QueryIOSurf");
ETW_NEW_EVENT(MFX_TRACE_API_DECODE_QUERY_IOSURF_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_DECODE_QUERY_IOSURF_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId), [&](){ return make_event_data(mfxRes);});
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, par);

try
Expand Down Expand Up @@ -314,7 +314,7 @@ mfxStatus MFXVideoDECODE_DecodeHeader(mfxSession session, mfxBitstream *bs, mfxV
mfxStatus mfxRes;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoDECODE_DecodeHeader");
ETW_NEW_EVENT(MFX_TRACE_API_DECODE_HEADER_TASK, 0, make_event_data(session, bs, bs ? bs->DataLength : 0), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_DECODE_HEADER_TASK, 0, make_event_data(session, bs, bs ? bs->DataLength : 0), [&](){ return make_event_data(mfxRes);});
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, bs);
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, par);

Expand Down Expand Up @@ -394,7 +394,7 @@ mfxStatus MFXVideoDECODE_Init(mfxSession session, mfxVideoParam *par)
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoDECODE_Init");
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, par);

ETW_NEW_EVENT(MFX_TRACE_API_DECODE_INIT_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_DECODE_INIT_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId), [&](){ return make_event_data(mfxRes);});

try
{
Expand Down Expand Up @@ -426,7 +426,7 @@ mfxStatus MFXVideoDECODE_Close(mfxSession session)
MFX_CHECK(session->m_pScheduler, MFX_ERR_NOT_INITIALIZED);

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoDECODE_Close");
ETW_NEW_EVENT(MFX_TRACE_API_DECODE_CLOSE_TASK, 0, make_event_data(session), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_DECODE_CLOSE_TASK, 0, make_event_data(session), [&](){ return make_event_data(mfxRes);});

try
{
Expand Down Expand Up @@ -458,7 +458,7 @@ mfxStatus MFXVideoDECODE_DecodeFrameAsync(mfxSession session, mfxBitstream *bs,
mfxStatus mfxRes;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoDECODE_DecodeFrameAsync");
ETW_NEW_EVENT(MFX_TRACE_API_DECODE_FRAME_ASYNC_TASK, 0, make_event_data(session, surface_work, bs ? bs->DataLength : 0), [&](){ return make_event_data(mfxRes, syncp ? *syncp : nullptr);});
PERF_EVENT(MFX_TRACE_API_DECODE_FRAME_ASYNC_TASK, 0, make_event_data(session, surface_work, bs ? bs->DataLength : 0), [&](){ return make_event_data(mfxRes, syncp ? *syncp : nullptr);});
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, bs);
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, surface_work);

Expand Down
11 changes: 6 additions & 5 deletions _studio/mfx_lib/shared/src/libmfxsw_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ mfxStatus MFXVideoENCODE_Query(mfxSession session, mfxVideoParam *in, mfxVideoPa

mfxStatus mfxRes = MFX_ERR_NONE;
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoENCODE_Query");
ETW_NEW_EVENT(MFX_TRACE_API_ENCODE_QUERY_TASK, 0, make_event_data(session, in ? in->mfx.FrameInfo.Width : 0, in ? in->mfx.FrameInfo.Height : 0, in ? in->mfx.CodecId : 0, in ? in->mfx.TargetUsage : 0, in ? in->mfx.LowPower : 0), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_ENCODE_QUERY_TASK, 0, make_event_data(session, in ? in->mfx.FrameInfo.Width : 0, in ? in->mfx.FrameInfo.Height : 0, in ? in->mfx.CodecId : 0, in ? in->mfx.TargetUsage : 0, in ? in->mfx.LowPower : 0), [&](){ return make_event_data(mfxRes);});
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, in);

bool bIsHWENCSupport = false;
Expand Down Expand Up @@ -406,8 +406,9 @@ mfxStatus MFXVideoENCODE_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfx
MFX_CHECK(request, MFX_ERR_NULL_PTR);

mfxStatus mfxRes = MFX_ERR_NONE;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoENCODE_QueryIOSurf");
ETW_NEW_EVENT(MFX_TRACE_API_ENCODE_QUERY_IOSURF_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId, par->mfx.TargetUsage, par->mfx.LowPower), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_ENCODE_QUERY_IOSURF_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId, par->mfx.TargetUsage, par->mfx.LowPower), [&](){ return make_event_data(mfxRes);});
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, par);

bool bIsHWENCSupport = false;
Expand Down Expand Up @@ -464,7 +465,7 @@ mfxStatus MFXVideoENCODE_Init(mfxSession session, mfxVideoParam *par)
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoENCODE_Init");
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, par);

ETW_NEW_EVENT(MFX_TRACE_API_ENCODE_INIT_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId, par->mfx.TargetUsage, par->mfx.LowPower), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_ENCODE_INIT_TASK, 0, make_event_data(session, par->mfx.FrameInfo.Width, par->mfx.FrameInfo.Height, par->mfx.CodecId, par->mfx.TargetUsage, par->mfx.LowPower), [&](){ return make_event_data(mfxRes);});

try
{
Expand Down Expand Up @@ -511,7 +512,7 @@ mfxStatus MFXVideoENCODE_Close(mfxSession session)
mfxStatus mfxRes = MFX_ERR_NONE;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoENCODE_Close");
ETW_NEW_EVENT(MFX_TRACE_API_ENCODE_CLOSE_TASK, 0, make_event_data(session), [&](){ return make_event_data(mfxRes);});
PERF_EVENT(MFX_TRACE_API_ENCODE_CLOSE_TASK, 0, make_event_data(session), [&](){ return make_event_data(mfxRes);});

MFX_CHECK(session, MFX_ERR_INVALID_HANDLE);
MFX_CHECK(session->m_pScheduler, MFX_ERR_NOT_INITIALIZED);
Expand Down Expand Up @@ -576,7 +577,7 @@ mfxStatus MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxEncodeCtrl *ctr
mfxStatus mfxRes;

MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_API, "MFXVideoENCODE_EncodeFrameAsync");
ETW_NEW_EVENT(MFX_TRACE_API_ENCODE_FRAME_ASYNC_TASK, 0, make_event_data(session, surface), [&](){ return make_event_data(mfxRes, syncp ? *syncp : nullptr);});
PERF_EVENT(MFX_TRACE_API_ENCODE_FRAME_ASYNC_TASK, 0, make_event_data(session, surface), [&](){ return make_event_data(mfxRes, syncp ? *syncp : nullptr);});
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, ctrl);
MFX_LTRACE_BUFFER(MFX_TRACE_LEVEL_API, surface);

Expand Down
Loading

0 comments on commit 870871c

Please sign in to comment.