| /developtools/hdc/src/common/ |
| D | circle_buffer.cpp | 31 delete[] data->buf; in ~CircleBuffer() 40 uint8_t *buf = nullptr; in Malloc() local 47 buf = data->buf; in Malloc() 51 if (buf == nullptr) { in Malloc() 58 data->buf = new(std::nothrow) uint8_t[bufSize]; in Malloc() 59 if (data->buf == nullptr) { in Malloc() 63 uint64_t key = reinterpret_cast<uint64_t>(data->buf); in Malloc() 65 buf = data->buf; in Malloc() 67 (void)memset_s(buf, bufSize, 0, bufSize); in Malloc() 68 return buf; in Malloc() [all …]
|
| D | file_descriptor.cpp | 62 uint8_t *buf = ctxIO->bufIO; in FileIOOnThread() local 79 nBytes = write(thisClass->fdIO, buf, bufSize); in FileIOOnThread() 86 if (memset_s(buf, bufSize, 0, bufSize) != EOK) { in FileIOOnThread() 99 nBytes = read(thisClass->fdIO, buf, bufSize); in FileIOOnThread() 108 … } else if (!isWrite && !thisClass->callbackRead(thisClass->callerContext, buf, nBytes)) { in FileIOOnThread() 130 if (buf != nullptr) { in FileIOOnThread() 131 delete[] buf; in FileIOOnThread() 132 buf = nullptr; in FileIOOnThread() 147 auto buf = new(std::nothrow) uint8_t[readMax](); in LoopReadOnThread() local 148 if (!contextIO || !buf) { in LoopReadOnThread() [all …]
|
| D | base.cpp | 159 char buf[bufSize] = { 0 }; in RollLogFile() local 160 uv_strerror_r(value, buf, bufSize); in RollLogFile() 161 PrintMessage("RollLogFile error log file %s not exist %s", path, buf); in RollLogFile() 172 char buf[bufSize] = { 0 }; in RollLogFile() local 173 uv_strerror_r(value, buf, bufSize); in RollLogFile() 174 PrintMessage("RollLogFile error unlink last:%s %s", last.c_str(), buf); in RollLogFile() 179 char buf[bufSize] = { 0 }; in RollLogFile() local 180 uv_strerror_r(value, buf, bufSize); in RollLogFile() 181 PrintMessage("RollLogFile error rename %s to %s %s", path, last.c_str(), buf); in RollLogFile() 205 char buf[BUF_SIZE_DEFAULT4] = { 0 }; // only 4k to avoid stack overflow in 32bit or L0 in PrintLogEx() local [all …]
|
| /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() 289 bool PerfRecordSample::GetBinary(std::vector<uint8_t> &buf) const in GetBinary() 291 if (buf.size() < GetSize()) { in GetBinary() 292 buf.resize(GetSize()); in GetBinary() 295 GetHeaderBinary(buf); in GetBinary() 296 uint8_t *p = buf.data() + GetHeaderSize(); in GetBinary() 442 bool PerfRecordMmap::GetBinary(std::vector<uint8_t> &buf) const in GetBinary() [all …]
|
| /developtools/profiler/device/plugins/native_hook/test/unittest/ |
| D | check_hook_data_test.cpp | 144 char buf[bufSize] = { 0 }; in ReadFile() local 145 strerror_r(errno, buf, bufSize); in ReadFile() 146 HILOG_ERROR(LOG_CORE, "snprintf_s(%s) error, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile() 153 char buf[bufSize] = { 0 }; in ReadFile() local 154 strerror_r(errno, buf, bufSize); in ReadFile() 155 HILOG_ERROR(LOG_CORE, "realpath(%s) failed, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile() 162 char buf[bufSize] = { 0 }; in ReadFile() local 163 strerror_r(errno, buf, bufSize); in ReadFile() 164 … HILOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, realPath, errno, buf); in ReadFile() 210 char buf[bufSize] = { 0 }; in ApplyForMalloc() local [all …]
|
| /developtools/profiler/proto_encoder/test/unittest/ |
| D | varint_encode_unittest.cpp | 250 uint8_t buf[VARINT_ENCODE_MAX_SIZE] = {0}; variable 252 EXPECT_EQ(EncodeVarint(buf, b), (uint32_t)sizeof(ENCODE_BYTES_MIN_BOOL)); 253 EXPECT_TRUE(CompareBytes(buf, ENCODE_BYTES_MIN_BOOL, sizeof(ENCODE_BYTES_MIN_BOOL))); 255 EXPECT_EQ(EncodeVarint(buf, b), (uint32_t)sizeof(ENCODE_BYTES_MAX_BOOL)); 256 EXPECT_TRUE(CompareBytes(buf, ENCODE_BYTES_MAX_BOOL, sizeof(ENCODE_BYTES_MAX_BOOL))); 259 EXPECT_EQ(EncodeVarint(buf, s8), (uint32_t)sizeof(ENCODE_BYTES_MIN_S8)); 260 EXPECT_TRUE(CompareBytes(buf, ENCODE_BYTES_MIN_S8, sizeof(ENCODE_BYTES_MIN_S8))); 262 EXPECT_EQ(EncodeVarint(buf, s8), (uint32_t)sizeof(ENCODE_BYTES_MAX_S8)); 263 EXPECT_TRUE(CompareBytes(buf, ENCODE_BYTES_MAX_S8, sizeof(ENCODE_BYTES_MAX_S8))); 266 EXPECT_EQ(EncodeVarint(buf, u8), (uint32_t)sizeof(ENCODE_BYTES_MIN_U8)); [all …]
|
| /developtools/profiler/hiebpf/test/unittest/ |
| D | ipc_unix_socket_test.cpp | 66 std::string buf; variable 68 buf.resize(size); 70 ASSERT_TRUE(client.RecvMessage(buf.data(), size, timeout)); 74 server.SetHandleCallback([&](const void *buf, size_t size) { in __anon560455bc0102() argument 75 server.SendMessage(buf, size); in __anon560455bc0102() 78 ASSERT_TRUE(client.RecvMessage(buf.data(), size, timeout)); 79 buf.resize(size); 80 ASSERT_EQ(buf, cmd); 100 std::string buf; variable 101 buf.resize(size); [all …]
|
| D | bpf_controller_test.cpp | 79 char buf[BUF_SIZE] = {0}; variable 80 ASSERT_TRUE(memset_s(buf, sizeof(buf), '1', sizeof(buf)) == EOK); 83 pwrite(fd, buf, sizeof(buf), offset); 85 pread(fd, buf, sizeof(buf), offset); 86 offset += sizeof(buf);
|
| /developtools/hdc/src/daemon/ |
| D | shell.cpp | 173 char buf[bufSize] = { 0 }; in ThreadFork() local 174 strerror_r(errno, buf, bufSize); in ThreadFork() 175 WRITE_LOG(LOG_DEBUG, "fork Thread create failed:%s", buf); in ThreadFork() 194 char buf[bufSize] = { 0 }; in ShellFork() local 195 strerror_r(errno, buf, bufSize); in ShellFork() 196 WRITE_LOG(LOG_DEBUG, "Fork shell failed:%s", buf); in ShellFork() 223 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local 224 strerror_r(errno, buf, bufSize); in CreateSubProcessPTY() 225 WRITE_LOG(LOG_DEBUG, "Cannot open ptmx, error:%s", buf); in CreateSubProcessPTY() 230 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local [all …]
|
| /developtools/profiler/device/plugins/hidump_plugin/src/ |
| D | hidump_plugin.cpp | 72 char buf[bufSize] = {0}; in Start() local 73 strerror_r(errno, buf, bufSize); in Start() 74 …LOG_ERROR(LOG_CORE, "HidumpPlugin: CustomPopen(%s) Failed, errno(%d:%s)", g_fpsFormat, errno, buf); in Start() 117 char buf[BUF_MAX_LEN] = { 0 }; in Loop() local 119 if (fgets(buf, BUF_MAX_LEN - 1, fp_.get()) == nullptr) { in Loop() 123 if (!ParseHidumpInfo(dataProto, buf)) { in Loop() 143 bool HidumpPlugin::ParseHidumpInfo(HidumpInfo& dataProto, char *buf) in ParseHidumpInfo() argument 146 if (strncmp(buf, "fps:", strlen("fps:")) != 0) { in ParseHidumpInfo() 147 if (strstr(buf, "inaccessible or not found") != nullptr) { in ParseHidumpInfo() 150 HILOG_ERROR(LOG_CORE, "format error. %s", buf); in ParseHidumpInfo() [all …]
|
| /developtools/packing_tool/adapter/ohos/ |
| D | ResourcesParser.java | 309 static String readBaseItem(int resId, ConfigIndex configIndex, ByteBuffer buf) { in readBaseItem() argument 310 buf.rewind(); in readBaseItem() 311 buf.position(configIndex.offset); in readBaseItem() 313 buf.get(tag); in readBaseItem() 314 int count = buf.getInt(); in readBaseItem() 316 int id = buf.getInt(); in readBaseItem() 317 int offset = buf.getInt(); in readBaseItem() 319 buf.rewind(); in readBaseItem() 320 buf.position(offset); in readBaseItem() 321 DataItem item = readItem(buf); in readBaseItem() [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/smartperf_host/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 | parser_pbreader_test.cpp | 56 std::unique_ptr<uint8_t[]> buf = std::make_unique<uint8_t[]>(readSize); variable 57 auto rsize = base::Read(fd, buf.get(), readSize); 66 if (!ta->ParseTraceDataSegment(std::move(buf), rsize)) { 99 std::unique_ptr<uint8_t[]> buf = std::make_unique<uint8_t[]>(readSize); variable 100 auto rsize = base::Read(fd, buf.get(), readSize); 108 if (!ta->ParseTraceDataSegment(std::move(buf), rsize)) { 141 std::unique_ptr<uint8_t[]> buf = std::make_unique<uint8_t[]>(readSize); variable 142 auto rsize = base::Read(fd, buf.get(), readSize); 151 if (!ta->ParseTraceDataSegment(std::move(buf), rsize)) { 184 std::unique_ptr<uint8_t[]> buf = std::make_unique<uint8_t[]>(readSize); variable [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/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/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/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/proto_encoder/include/ |
| D | varint_encode.h | 78 inline uint32_t EncodeVarint(uint8_t* buf, T v) in EncodeVarint() argument 85 buf[size] = (VARINT_MASK_PAYLOAD & value) | VARINT_MASK_MSB; in EncodeVarint() 89 buf[size] = (VARINT_MASK_PAYLOAD & value); in EncodeVarint() 96 inline uint32_t EncodeZigZagVarint(uint8_t* buf, T v) in EncodeZigZagVarint() argument 98 return EncodeVarint(buf, EncodeZigZag(v)); in EncodeZigZagVarint() 102 inline void EncodeVarintPadding(uint8_t* buf, T v, uint32_t paddingSize) in EncodeVarintPadding() argument 107 buf[size] = (VARINT_MASK_PAYLOAD & v) | VARINT_MASK_MSB; in EncodeVarintPadding() 111 buf[size] = (VARINT_MASK_PAYLOAD & v); in EncodeVarintPadding()
|
| /developtools/profiler/device/plugins/memory_plugin/src/ |
| D | memory_data_plugin.cpp | 97 char buf[bufSize] = { 0 }; in InitMemVmemFd() local 98 strerror_r(errno, buf, bufSize); in InitMemVmemFd() 99 HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd() 105 char buf[bufSize] = { 0 }; in InitMemVmemFd() local 106 strerror_r(errno, buf, bufSize); in InitMemVmemFd() 107 HILOG_ERROR(LOG_CORE, "%s:open failed, fileName, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd() 119 char buf[bufSize] = { 0 }; in InitMemVmemFd() local 120 strerror_r(errno, buf, bufSize); in InitMemVmemFd() 121 HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd() 127 char buf[bufSize] = { 0 }; in InitMemVmemFd() local [all …]
|
| /developtools/profiler/hiebpf/src/ |
| D | kernel_symbol_info.cpp | 42 std::vector<uint8_t> &buf) in GetBinary() argument 50 buf.resize(dataLen); in GetBinary() 52 uint8_t *p = buf.data(); in GetBinary() 79 uint32_t KernelSymbolInfo::GetSymbolData(std::vector<uint8_t> &buf) in GetSymbolData() argument 81 buf.clear(); in GetSymbolData() 82 buf.reserve(DEFAULT_BUFF_SIZE); in GetSymbolData() 116 GetBinary(symbolItems, vaddrStart, vaddrEnd, strTabLen, buf); in GetSymbolData() 117 return buf.size(); in GetSymbolData()
|
| /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 …]
|