Beispiel #1
0
void TraceBuffer::addTimer(double time){
	ensureBufferSpace(frame_data->getTimerFrameSize());

	//Flag
	copyFlag(frame_data->TIMERFLAG);

	//Data
	copyToBuffer(&time, sizeof(double));

}
Beispiel #2
0
void TraceBuffer::addFree(long address, float time) {
	ensureBufferSpace(frame_data->getFreeFrameSize());

	//Flag
	copyFlag(frame_data->FREEFLAG);

	//Data
	copyToBuffer(&address, sizeof(long));
	copyToBuffer(&time, sizeof(float));

}
Beispiel #3
0
void TraceBuffer::addRealloc(long addressold, long addressnew, float time,
		long allocationsize) {
	ensureBufferSpace(frame_data->getReallocFrameSize());

	//Flag
	copyFlag(frame_data->REALLOCFLAG);

	//Data
	copyToBuffer(&addressold, sizeof(long));
	copyToBuffer(&addressnew, sizeof(long));
	copyToBuffer(&time, sizeof(float));
	copyToBuffer(&allocationsize, sizeof(long));
}
Beispiel #4
0
void TraceBuffer::addCalloc(long address, float time, long allocationsize,
		int stackid) {
	ensureBufferSpace(frame_data->getCallocFrameSize());

	//Flag
	copyFlag(frame_data->CALLOCFLAG);

	//Data
	copyToBuffer(&address, sizeof(long));
	copyToBuffer(&time, sizeof(float));
	copyToBuffer(&allocationsize, sizeof(long));
	copyToBuffer(&stackid, sizeof(int));

}
Beispiel #5
0
void ScanQueryProcessor::initAggregationRecord() {
    ensureBufferSpace(mData->minimumLength());

    mBufferWriter.write<uint64_t>(0u);
    auto tupleData = mBufferWriter.data();
    mBufferWriter.set(0, mData->minimumLength() - TUPLE_OVERHEAD);

    auto& record = mData->record();
    auto aggIter = mData->aggregationBegin();
    for (Record::id_t i = 0; i < record.fieldCount(); ++i, ++aggIter) {
        uint16_t destFieldIdx;
        record.idOf(crossbow::to_string(i), destFieldIdx);
        auto& metadata = record.getFieldMeta(destFieldIdx);
        auto& field = metadata.field;
        auto aggType = std::get<1>(*aggIter);
        field.initAgg(aggType, tupleData + metadata.offset);

        // Set all fields that can be NULL to NULL
        // Whenever the first value is written the field will be marked as non-NULL
        if (!field.isNotNull()) {
            record.setFieldNull(tupleData, metadata.nullIdx, true);
        }
    }
}
Beispiel #6
0
void XDebugProfiler::recordFrame(const TypedValue* retVal) {
  ensureBufferSpace();
  FrameData* fd = &m_frameBuffer[m_nextFrameIdx++];
  collectFrameData(*fd, retVal);
}