Пример #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 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
    }