/developtools/profiler/device/services/ipc/src/ |
D | socket_context.cpp | 49 char buf[bufSize] = { 0 }; in ~SocketContext() local 50 strerror_r(errno, buf, bufSize); in ~SocketContext() 51 HILOG_ERROR(LOG_CORE, "shutdown socket err = %d %s", errno, buf); in ~SocketContext() 56 char buf[bufSize] = { 0 }; in ~SocketContext() local 57 strerror_r(errno, buf, bufSize); in ~SocketContext() 58 HILOG_ERROR(LOG_CORE, "close socket err = %d %s", errno, buf); in ~SocketContext() 68 int SocketContext::RawProtocolProc(uint32_t pnum, const int8_t* buf, const uint32_t size) in RawProtocolProc() argument 102 std::vector<unsigned char> buf(bufferSize); in UnixSocketRecv() local 104 struct ProtocolHead* pph = (struct ProtocolHead*)buf.data(); in UnixSocketRecv() 109 if (!ReceiveData(pssr->socketHandle_, buf.data(), head_size)) { in UnixSocketRecv() [all …]
|
/developtools/hiperf/src/ |
D | perf_file_reader.cpp | 156 std::vector<char> buf(header_.attrSize); in ReadAttrSection() local 157 if (!Read(buf.data(), buf.size())) { in ReadAttrSection() 172 attr.attr = *(reinterpret_cast<perf_event_attr *>(&buf[0])); in ReadAttrSection() 173 attr.ids = *(reinterpret_cast<perf_file_section *>(&buf[attr_size])); in ReadAttrSection() 260 HIPERF_BUF_ALIGN uint8_t buf[RECORD_SIZE_LIMIT]; in ReadRecord() local 268 } else if (!Read(buf, sizeof(perf_event_header))) { in ReadRecord() 272 perf_event_header *header = reinterpret_cast<perf_event_header *>(buf); in ReadRecord() 273 if (header->size > sizeof(buf)) { in ReadRecord() 279 if (Read(buf + headerSize, header->size - headerSize)) { in ReadRecord() 280 uint8_t *data = buf; in ReadRecord() [all …]
|
D | perf_file_format.cpp | 76 bool PerfFileSection::Write(const char *buf, size_t size) in Write() argument 78 return Write(buf, size, size); in Write() 81 bool PerfFileSection::Write(const char *buf, size_t size, size_t max) in Write() argument 91 std::copy(buf, buf + size, wBuffer_ + offset_); in Write() 124 char buf[size]; in Read() local 125 if (!Read(buf, size)) { in Read() 128 if (buf[size - 1] != 0) { in Read() 131 value = buf; in Read() 140 bool PerfFileSection::Read(char *buf, size_t size) in Read() argument 142 HLOG_ASSERT(buf != nullptr); in Read() [all …]
|
D | perf_event_record.cpp | 132 void PerfEventRecord::GetHeaderBinary(std::vector<uint8_t> &buf) const in GetHeaderBinary() 134 if (buf.size() < GetHeaderSize()) { in GetHeaderBinary() 135 buf.resize(GetHeaderSize()); in GetHeaderBinary() 137 uint8_t *p = buf.data(); in GetHeaderBinary() 281 bool PerfRecordSample::GetBinary(std::vector<uint8_t> &buf) const in GetBinary() 283 if (buf.size() < GetSize()) { in GetBinary() 284 buf.resize(GetSize()); in GetBinary() 287 GetHeaderBinary(buf); in GetBinary() 288 uint8_t *p = buf.data() + GetHeaderSize(); in GetBinary() 434 bool PerfRecordMmap::GetBinary(std::vector<uint8_t> &buf) const in GetBinary() [all …]
|
D | perf_file_writer.cpp | 133 static std::vector<u8> buf(RECORD_SIZE_LIMIT); in WriteRecord() local 135 if (!record.GetBinary(buf)) { in WriteRecord() 139 if (!Write(buf.data(), record.GetSize())) { in WriteRecord() 165 HIPERF_BUF_ALIGN uint8_t buf[RECORD_SIZE_LIMIT]; in ReadRecords() local 173 } else if (Read(buf, sizeof(perf_event_header)) <= 0) { in ReadRecords() 177 perf_event_header *header = reinterpret_cast<perf_event_header *>(buf); in ReadRecords() 178 HLOG_ASSERT(header->size < sizeof(buf)); in ReadRecords() 181 if (Read(buf + headerSize, header->size - headerSize)) { in ReadRecords() 182 uint8_t *data = buf; in ReadRecords() 202 bool PerfFileWriter::Read(void *buf, size_t len) in Read() argument [all …]
|
/developtools/profiler/host/smartperf/trace_streamer/src/parser/hiperf_parser/hiperf/ |
D | perf_file_reader.cpp | 182 std::vector<char> buf(header_.attrSize); in ReadAttrSection() local 183 if (!Read(buf.data(), buf.size())) { in ReadAttrSection() 198 attr.attr = *(reinterpret_cast<perf_event_attr *>(&buf[0])); in ReadAttrSection() 199 attr.ids = *(reinterpret_cast<perf_file_section *>(&buf[attr_size])); in ReadAttrSection() 284 HIPERF_BUF_ALIGN uint8_t buf[RECORD_SIZE_LIMIT]; in ReadRecord() local 292 } else if (!Read(buf, sizeof(perf_event_header))) { in ReadRecord() 296 perf_event_header *header = reinterpret_cast<perf_event_header *>(buf); in ReadRecord() 297 if (header->size > sizeof(buf)) { in ReadRecord() 303 if (Read(buf + headerSize, header->size - headerSize)) { in ReadRecord() 304 uint8_t *data = buf; in ReadRecord() [all …]
|
D | perf_file_format.cpp | 76 bool PerfFileSection::Write(const char *buf, size_t size) in Write() argument 78 return Write(buf, size, size); in Write() 81 bool PerfFileSection::Write(const char *buf, size_t size, size_t max) in Write() argument 91 std::copy(buf, buf + size, wBuffer_ + offset_); in Write() 124 char buf[size]; in Read() local 125 if (!Read(buf, size)) { in Read() 128 if (buf[size - 1] != 0) { in Read() 131 value = buf; in Read() 140 bool PerfFileSection::Read(char *buf, size_t size) in Read() argument 142 HLOG_ASSERT(buf != nullptr); in Read() [all …]
|
D | perf_event_record.cpp | 133 void PerfEventRecord::GetHeaderBinary(std::vector<uint8_t> &buf) const in GetHeaderBinary() 135 if (buf.size() < GetHeaderSize()) { in GetHeaderBinary() 136 buf.resize(GetHeaderSize()); in GetHeaderBinary() 138 uint8_t *p = buf.data(); in GetHeaderBinary() 282 bool PerfRecordSample::GetBinary(std::vector<uint8_t> &buf) const in GetBinary() 284 if (buf.size() < GetSize()) { in GetBinary() 285 buf.resize(GetSize()); in GetBinary() 288 GetHeaderBinary(buf); in GetBinary() 289 uint8_t *p = buf.data() + GetHeaderSize(); in GetBinary() 435 bool PerfRecordMmap::GetBinary(std::vector<uint8_t> &buf) const in GetBinary() [all …]
|
/developtools/hdc/src/common/ |
D | file_descriptor.cpp | 66 uint8_t *buf = ctxIO->bufIO; in OnFileIO() local 73 if (!thisClass->callbackRead(thisClass->callerContext, buf, req->result)) { in OnFileIO() 94 delete[] buf; in OnFileIO() 109 auto buf = new uint8_t[readMax](); in LoopRead() local 110 if (!contextIO || !buf) { in LoopRead() 114 if (buf) { in LoopRead() 115 delete[] buf; in LoopRead() 122 contextIO->bufIO = buf; in LoopRead() 126 iov = uv_buf_init((char *)buf, readMax); in LoopRead() 148 auto buf = new uint8_t[size]; in Write() local [all …]
|
D | debug.cpp | 20 int WriteHexToDebugFile(const char *fileName, const uint8_t *buf, const int bufLen) in WriteHexToDebugFile() argument 42 fwrite(buf, 1, bufLen, fp); in WriteHexToDebugFile() 48 int ReadHexFromDebugFile(const char *fileName, uint8_t *buf, const int bufLen) in ReadHexFromDebugFile() argument 72 int ret = fread(buf, 1, size, fp); in ReadHexFromDebugFile() 92 int PrintfHexBuf(const uint8_t *buf, int bufLen) in PrintfHexBuf() argument 96 printf("0x%02x, ", buf[i]); in PrintfHexBuf()
|
/developtools/packing_tool/adapter/ohos/ |
D | ResourcesParser.java | 308 static String readBaseItem(int resId, ConfigIndex configIndex, ByteBuffer buf) { in readBaseItem() argument 309 buf.rewind(); in readBaseItem() 310 buf.position(configIndex.offset); in readBaseItem() 312 buf.get(tag); in readBaseItem() 313 int count = buf.getInt(); in readBaseItem() 315 int id = buf.getInt(); in readBaseItem() 316 int offset = buf.getInt(); in readBaseItem() 318 buf.rewind(); in readBaseItem() 319 buf.position(offset); in readBaseItem() 320 DataItem item = readItem(buf); in readBaseItem() [all …]
|
/developtools/profiler/device/plugins/hidump_plugin/src/ |
D | hidump_plugin.cpp | 75 char buf[bufSize] = {0}; in Start() local 76 strerror_r(errno, buf, bufSize); in Start() 77 …ILOG_ERROR(LOG_CORE, "HidumpPlugin: CustomPopen(%s) Failed, errno(%d:%s)", FPS_FORMAT, errno, buf); in Start() 120 char buf[BUF_MAX_LEN] = { 0 }; in Loop() local 122 if (fgets(buf, BUF_MAX_LEN - 1, fp_.get()) == nullptr) { in Loop() 126 if (!ParseHidumpInfo(dataProto, buf)) { in Loop() 146 bool HidumpPlugin::ParseHidumpInfo(HidumpInfo& dataProto, char *buf) in ParseHidumpInfo() argument 149 if (strncmp(buf, "fps:", strlen("fps:")) != 0) { in ParseHidumpInfo() 150 if (strstr(buf, "inaccessible or not found") != nullptr) { in ParseHidumpInfo() 153 HILOG_ERROR(LOG_CORE, "format error. %s", buf); in ParseHidumpInfo() [all …]
|
/developtools/hdc/src/daemon/ |
D | shell.cpp | 153 char buf[bufSize] = { 0 }; in ShellFork() local 154 strerror_r(errno, buf, bufSize); in ShellFork() 155 WRITE_LOG(LOG_DEBUG, "Fork shell failed:%s", buf); in ShellFork() 180 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local 181 strerror_r(errno, buf, bufSize); in CreateSubProcessPTY() 182 WRITE_LOG(LOG_DEBUG, "Cannot open ptmx, error:%s", buf); in CreateSubProcessPTY() 187 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local 188 strerror_r(errno, buf, bufSize); in CreateSubProcessPTY() 189 WRITE_LOG(LOG_DEBUG, "Cannot open2 ptmx, error:%s", buf); in CreateSubProcessPTY() 195 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local [all …]
|
/developtools/hdc/src/test/jdwp/ |
D | HdcJdwpSimulator.cpp | 32 char buf[bufSize] = { 0 }; in FinishWriteCallback() local 33 uv_err_name_r(status, buf, bufSize); in FinishWriteCallback() 34 HiLog::Info(LABEL, "FinishWriteCallback:%{public}d error:%{public}s", status, buf); in FinishWriteCallback() 39 RetErrCode HdcJdwpSimulator::SendToStream(uv_stream_t *handleStream, const uint8_t *buf, in SendToStream() argument 42 HiLog::Info(LABEL, "HdcJdwpSimulator::SendToStream: %{public}s, %{public}d", buf, bufLen); in SendToStream() 53 if (memcpy_s(pDynBuf, bufLen, buf, bufLen)) { in SendToStream() 84 void HdcJdwpSimulator::alloc_buffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) in alloc_buffer() argument 89 buf->base = (char *)malloc(suggested_size); in alloc_buffer() 90 buf->len = suggested_size; in alloc_buffer() 96 void HdcJdwpSimulator::ProcessIncoming(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) in ProcessIncoming() argument [all …]
|
/developtools/hdc/src/host/ |
D | host_unity.cpp | 89 char buf[bufSize] = { 0 }; in OnFileIO() local 90 uv_strerror_r((int)req->result, buf, bufSize); in OnFileIO() 91 WRITE_LOG(LOG_DEBUG, "Error OnFileIO: %s", buf); in OnFileIO() 104 auto buf = new uint8_t[sizeLog]; in AppendLocalLog() local 106 if (!buf || !contextIO) { in AppendLocalLog() 107 if (buf) { in AppendLocalLog() 108 delete[] buf; in AppendLocalLog() 116 contextIO->bufIO = buf; in AppendLocalLog() 121 if (memcpy_s(buf, sizeLog, bufLog, sizeLog)) { in AppendLocalLog() 123 uv_buf_t iov = uv_buf_init(reinterpret_cast<char *>(buf), sizeLog); in AppendLocalLog()
|
/developtools/hiperf/include/ |
D | perf_file_format.h | 128 virtual bool GetBinary(char *buf, size_t size) = 0; 152 bool Write(const char *buf, size_t size); 153 bool Write(const char *buf, size_t size, size_t max); 158 bool Read(char *buf, size_t size); 170 PerfFileSectionString(FEATURE id, const char *buf, size_t size); 173 bool GetBinary(char *buf, size_t size); 209 PerfFileSectionSymbolsFiles(FEATURE id, const char *buf, size_t size); 211 bool GetBinary(char *buf, size_t size); 225 PerfFileSectionNrCpus(FEATURE id, const char *buf, size_t size); 228 bool GetBinary(char *buf, size_t size); [all …]
|
/developtools/profiler/host/smartperf/trace_streamer/test/unittest/ |
D | bytrace_parser_test.cpp | 55 auto buf = std::make_unique<uint8_t[]>(1); variable 57 bytraceParser.ParseTraceDataSegment(std::move(buf), 1); 73 auto buf = std::make_unique<uint8_t[]>(bufSize); variable 75 if (memcpy_s(buf.get(), bufSize, " \n", realBufSize)) { 80 bytraceParser.ParseTraceDataSegment(std::move(buf), realBufSize); 98 auto buf = std::make_unique<uint8_t[]>(bufSize); variable 100 if (memcpy_s(buf.get(), bufSize, "0123456789\n", realBufSize)) { 105 bytraceParser.ParseTraceDataSegment(std::move(buf), realBufSize); 123 auto buf = std::make_unique<uint8_t[]>(bufSize); variable 125 if (memcpy_s(buf.get(), bufSize, "TRACE: \n# tracer: nop \n# \n", realBufSize)) { [all …]
|
D | event_parser_test.cpp | 193 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable 194 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) { 199 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE); 218 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable 219 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) { 224 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE); 246 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable 247 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) { 252 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE); 273 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable [all …]
|
/developtools/profiler/device/plugins/native_hook/src/ |
D | runtime_stack_range.cpp | 102 static void GetAnUnlimitedLine(FILE* fp, std::string& buf) in GetAnUnlimitedLine() argument 105 buf.resize(0); in GetAnUnlimitedLine() 109 if (buf.size() == 0) { in GetAnUnlimitedLine() 110 buf.resize(INIT_LINE_SIZE); in GetAnUnlimitedLine() 116 if (offset + length >= static_cast<int>(buf.size())) { in GetAnUnlimitedLine() 117 buf.resize(buf.size() + INC_LINE_SIZE); in GetAnUnlimitedLine() 119 retLine = fgets(&buf[0] + offset, buf.size() - offset, fp); in GetAnUnlimitedLine() 123 length = static_cast<int>(strlen(&buf[0] + offset)); in GetAnUnlimitedLine() 124 if (offset + length - 1 >= 0 && buf[offset + length - 1] == '\n') { in GetAnUnlimitedLine()
|
/developtools/profiler/device/plugins/memory_plugin/src/ |
D | memory_data_plugin.cpp | 99 char buf[bufSize] = { 0 }; in InitMemVmemFd() local 100 strerror_r(errno, buf, bufSize); in InitMemVmemFd() 101 HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd() 107 char buf[bufSize] = { 0 }; in InitMemVmemFd() local 108 strerror_r(errno, buf, bufSize); in InitMemVmemFd() 109 HILOG_ERROR(LOG_CORE, "%s:open failed, fileName, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd() 123 char buf[bufSize] = { 0 }; in InitMemVmemFd() local 124 strerror_r(errno, buf, bufSize); in InitMemVmemFd() 125 HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd() 131 char buf[bufSize] = { 0 }; in InitMemVmemFd() local [all …]
|
D | test_main.cpp | 32 char *buf = nullptr; in main() local 40 buf = (char *)malloc(size * MB_PER_BYTE); in main() 41 if (buf == nullptr) { in main() 48 cache.emplace(cache.begin() + i - 1, buf); in main()
|
/developtools/profiler/device/plugins/api/test/unittest/ |
D | buffer_write_test.cpp | 45 char buf[bufSize] = { 0 }; in InitShareMemory1() local 46 strerror_r(errno, buf, bufSize); in InitShareMemory1() 47 HILOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf); in InitShareMemory1() 55 char buf[bufSize] = { 0 }; in InitShareMemory1() local 56 strerror_r(errno, buf, bufSize); in InitShareMemory1() 57 HILOG_ERROR(LOG_CORE, "CreateBlock g_smbAddr1 mmap ERR : %s", buf); in InitShareMemory1() 82 char buf[bufSize] = { 0 }; in InitShareMemory2() local 83 strerror_r(errno, buf, bufSize); in InitShareMemory2() 84 HILOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf); in InitShareMemory2() 92 char buf[bufSize] = { 0 }; in InitShareMemory2() local [all …]
|
/developtools/hiperf/test/fuzztest/libreport_fuzzer/ |
D | LibReport_fuzzer.cpp | 21 char buf[DATA_MAX_SIZE] = { 0 }; in FuzzLibReport() local 22 if (memcpy_s(buf, sizeof(buf) - 1, data, size) != 0) { // 1 : make sure end of '\0' in FuzzLibReport() 25 const char *dataPtr = reinterpret_cast<const char *>(buf); in FuzzLibReport()
|
/developtools/profiler/device/plugins/native_hook/test/unittest/ |
D | check_hook_data_test.cpp | 102 char buf[bufSize] = { 0 }; in ReadFile() local 103 strerror_r(errno, buf, bufSize); in ReadFile() 104 HILOG_ERROR(LOG_CORE, "snprintf_s(%s) error, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile() 111 char buf[bufSize] = { 0 }; in ReadFile() local 112 strerror_r(errno, buf, bufSize); in ReadFile() 113 HILOG_ERROR(LOG_CORE, "realpath(%s) failed, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile() 120 char buf[bufSize] = { 0 }; in ReadFile() local 121 strerror_r(errno, buf, bufSize); in ReadFile() 122 … HILOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, realPath, errno, buf); in ReadFile() 168 char buf[bufSize] = { 0 }; in ApplyForMalloc() local [all …]
|
/developtools/hiperf/test/unittest/common/native/ |
D | ring_buffer_test.cpp | 44 static void ReadBufferAndCheck(RingBuffer &buf); 45 static void WriteBuffer(RingBuffer &buf); 56 void RingBufferTest::ReadBufferAndCheck(RingBuffer &buf) in ReadBufferAndCheck() argument 61 while ((p = buf.GetReadData()) != nullptr) { in ReadBufferAndCheck() 76 buf.EndRead(); in ReadBufferAndCheck() 80 void RingBufferTest::WriteBuffer(RingBuffer &buf) in WriteBuffer() argument 84 while ((p = buf.AllocForWrite(writeData.size)) != nullptr) { in WriteBuffer() 92 buf.EndWrite(); in WriteBuffer()
|