예제 #1
0
    void Counter(const CTraceEventFormat::SRegularFields& rf, const __itt_domain *pDomain, const __itt_string_handle *pName, double value) override
    {
        WriteRecord(ERecordType::Counter, SRecord{rf, *pDomain, __itt_null, __itt_null, pName, &value});
#ifdef __ANDROID_API__
        CTraceEventFormat::CArgs args;
        args.Add(pName->strA, value);
        m_oTraceEventFormat.WriteEvent(CTraceEventFormat::Counter, pDomain->nameA, args, &rf);
#endif
    }
예제 #2
0
    void TaskEnd(STaskDescriptor& oTask, const CTraceEventFormat::SRegularFields& rf, bool bOverlapped) override
    {
#ifdef TURBO_MODE
        double duration = double(rf.nanoseconds - oTask.rf.nanoseconds);
        WriteRecord(bOverlapped ? ERecordType::EndOverlappedTask : ERecordType::EndTask, SRecord{oTask.rf, *oTask.pDomain, oTask.id, oTask.parent, oTask.pName, &duration, nullptr, 0, oTask.fn});
#else
        WriteRecord(bOverlapped ? ERecordType::EndOverlappedTask : ERecordType::EndTask, SRecord{rf, *oTask.pDomain, oTask.id, __itt_null});
#endif

#ifdef __ANDROID_API__
        if (!bOverlapped && oTask.pName)
        {
            m_oTraceEventFormat.WriteEvent(CTraceEventFormat::End, oTask.pName->strA, Cookie<CTraceEventFormat::CArgs>(oTask), &oTask.rf, oTask.pDomain->nameA);
        }
#endif
    }
예제 #3
0
    void TaskEnd(STaskDescriptor& oTask, const CTraceEventFormat::SRegularFields& rf, bool bOverlapped) override
    {
        if (bOverlapped)
        {
            WriteRecord(ERecordType::EndOverlappedTask, SRecord{rf, *oTask.pDomain, oTask.id, __itt_null});
        }
        else
        {
            WriteRecord(ERecordType::EndTask, SRecord{rf, *oTask.pDomain, __itt_null, __itt_null});
#ifdef __ANDROID_API__
            if (oTask.pName)
            {
                m_oTraceEventFormat.WriteEvent(CTraceEventFormat::End, oTask.pName->strA, Cookie<CTraceEventFormat::CArgs>(oTask), &oTask.rf, oTask.pDomain->nameA);
            }
#endif
        }
    }
예제 #4
0
    void TaskBegin(STaskDescriptor& oTask, bool bOverlapped) override
    {
        if (bOverlapped)
        {
            WriteRecord(ERecordType::BeginOverlappedTask, SRecord{oTask.rf, *oTask.pDomain, oTask.id, oTask.parent, oTask.pName, nullptr, nullptr, 0, oTask.fn});
        }
        else
        {
            WriteRecord(ERecordType::BeginTask, SRecord{ oTask.rf, *oTask.pDomain, oTask.id, oTask.parent, oTask.pName, nullptr, nullptr, 0, oTask.fn });
#ifdef __ANDROID_API__
            if (oTask.pName)
            {
                m_oTraceEventFormat.WriteEvent(CTraceEventFormat::Begin, oTask.pName->strA, CTraceEventFormat::CArgs(), &oTask.rf, oTask.pDomain->nameA);
            }
#endif
        }
    }
예제 #5
0
    void Counter(const CTraceEventFormat::SRegularFields& rf, const __itt_domain *pDomain, const __itt_string_handle *pName, double value) override
    {
        const char *pData = nullptr;
        size_t length = 0;
        if (g_bWithStacks)
        {
            static thread_local TStack* pStack = nullptr;
            if (!pStack)
                pStack = (TStack*)malloc(sizeof(TStack));
            length = (GetStack(*pStack) - 3) * sizeof(void*);
            pData = reinterpret_cast<const char *>(&(*pStack)[3]);
        }
        WriteRecord(ERecordType::Counter, SRecord{rf, *pDomain, __itt_null, __itt_null, pName, &value, pData, length});
#ifdef __ANDROID_API__
        CTraceEventFormat::CArgs args;
        args.Add(pName->strA, value);
        m_oTraceEventFormat.WriteEvent(CTraceEventFormat::Counter, pDomain->nameA, args, &rf);
#endif
    }
예제 #6
0
    void TaskBegin(STaskDescriptor& oTask, bool bOverlapped) override
    {
#ifndef TURBO_MODE
        const char *pData = nullptr;
        size_t length = 0;
        if (g_bWithStacks)
        {
            static thread_local TStack* pStack = nullptr;
            if (!pStack)
                pStack = (TStack*)malloc(sizeof(TStack));
            length = (GetStack(*pStack) - 2) * sizeof(void*);
            pData = reinterpret_cast<const char *>(&(*pStack)[2]);
        }
        WriteRecord(bOverlapped ? ERecordType::BeginOverlappedTask : ERecordType::BeginTask, SRecord{oTask.rf, *oTask.pDomain, oTask.id, oTask.parent, oTask.pName, nullptr, pData, length, oTask.fn});
#endif
#ifdef __ANDROID_API__
        if (!bOverlapped && oTask.pName)
        {
            m_oTraceEventFormat.WriteEvent(CTraceEventFormat::Begin, oTask.pName->strA, CTraceEventFormat::CArgs(), &oTask.rf, oTask.pDomain->nameA);
        }
#endif
    }