Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 231) sorted by relevance

12345678910

/developtools/hdc/hdc_rust/src/serializer/
Dserialize.rs65 buf: SerializedBuffer, in ParseSessionHandShake()
67 fn ParsePayloadProtect(value: *mut PayloadProtectPack, buf: SerializedBuffer) -> libc::c_uchar; in ParsePayloadProtect()
68 fn ParseTransferConfig(value: *mut TransferConfigPack, buf: SerializedBuffer) -> libc::c_uchar; in ParseTransferConfig()
69 fn ParseFileMode(value: *mut FileModePack, buf: SerializedBuffer) -> libc::c_uchar; in ParseFileMode()
72 buf: SerializedBuffer, in ParseTransferPayload()
74 fn ParsePayloadHead(value: *mut PayloadHeadPack, buf: SerializedBuffer) -> libc::c_uchar; in ParsePayloadHead()
75 fn ParseUsbHead(value: *mut UsbHeadPack, buf: SerializedBuffer) -> libc::c_uchar; in ParseUsbHead()
76 fn ParseUartHead(value: *mut UartHeadPack, buf: SerializedBuffer) -> libc::c_uchar; in ParseUartHead()
96 let buf = CString::new(self.buf.as_str()).unwrap(); in serialize() localVariable
103 buf: buf.as_ptr(), in serialize()
[all …]
/developtools/hdc/hdc_rust/src/cffi/
Dserial_struct.cpp41 .buf = string(value.buf), in SerializeSessionHandShake()
149 extern "C" uint8_t ParseSessionHandShake(RustStruct::SessionHandShake &value, SerializedBuffer buf) in ParseSessionHandShake() argument
152 if (!SerialStruct::ParseFromString(shs, string(buf.ptr, buf.size))) { in ParseSessionHandShake()
160 .buf = StringToHeapPtr(shs.buf), in ParseSessionHandShake()
166 extern "C" uint8_t ParsePayloadProtect(RustStruct::PayloadProtect &value, SerializedBuffer buf) in ParsePayloadProtect() argument
169 if (!SerialStruct::ParseFromString(pp, string(buf.ptr, buf.size))) { in ParsePayloadProtect()
181 extern "C" uint8_t ParseTransferConfig(RustStruct::TransferConfig &value, SerializedBuffer buf) in ParseTransferConfig() argument
184 if (!SerialStruct::ParseFromString(tc, string(buf.ptr, buf.size))) { in ParseTransferConfig()
205 extern "C" uint8_t ParseFileMode(RustStruct::FileMode &value, SerializedBuffer buf) in ParseFileMode() argument
208 if (!SerialStruct::ParseFromString(fm, string(buf.ptr, buf.size))) { in ParseFileMode()
[all …]
Dlog.cpp23 char buf[BUF_SIZE_DEFAULT4] = { 0 }; // only 4k to avoid stack overflow in 32bit or L0 in PrintLogEx() local
26 const int retSize = vsnprintf_s(buf, sizeof(buf), sizeof(buf) - 1, msg, vaArgs); in PrintLogEx()
40 filePath.c_str(), line, buf); in PrintLogEx()
44 filePath.c_str(), line, buf); in PrintLogEx()
48 filePath.c_str(), line, buf); in PrintLogEx()
52 filePath.c_str(), line, buf); in PrintLogEx()
Dmount.cpp30 char buf[BUF_SIZE_DEFAULT2]; in FindMountDeviceByPath() local
36 read(fd, buf, sizeof(buf) - 1); in FindMountDeviceByPath()
38 buf[sizeof(buf) - 1] = '\0'; in FindMountDeviceByPath()
39 token = strtok(buf, delims); in FindMountDeviceByPath()
/developtools/profiler/device/services/ipc/src/
Dsocket_context.cpp49 char buf[bufSize] = { 0 }; in ~SocketContext() local
50 strerror_r(errno, buf, bufSize); in ~SocketContext()
51 PROFILER_LOG_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 PROFILER_LOG_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/profiler/device/plugins/native_hook/test/unittest/
Dcheck_hook_data_test.cpp160 char buf[bufSize] = { 0 }; in ReadFile() local
161 strerror_r(errno, buf, bufSize); in ReadFile()
162 … PROFILER_LOG_ERROR(LOG_CORE, "snprintf_s(%s) error, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile()
169 char buf[bufSize] = { 0 }; in ReadFile() local
170 strerror_r(errno, buf, bufSize); in ReadFile()
171 … PROFILER_LOG_ERROR(LOG_CORE, "realpath(%s) failed, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile()
178 char buf[bufSize] = { 0 }; in ReadFile() local
179 strerror_r(errno, buf, bufSize); in ReadFile()
180 …ROFILER_LOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, realPath, errno, buf); in ReadFile()
226 char buf[bufSize] = { 0 }; in ApplyForMalloc() local
[all …]
/developtools/hiperf/src/
Dperf_file_reader.cpp156 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 …]
Dperf_file_format.cpp76 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 …]
Dperf_event_record.cpp176 void PerfEventRecord::GetHeaderBinary(std::vector<uint8_t> &buf) const in GetHeaderBinary()
178 if (buf.size() < GetHeaderSize()) { in GetHeaderBinary()
179 buf.resize(GetHeaderSize()); in GetHeaderBinary()
181 uint8_t *p = buf.data(); in GetHeaderBinary()
360 bool PerfRecordSample::GetBinary(std::vector<uint8_t> &buf) const in GetBinary()
362 if (buf.size() < GetSize()) { in GetBinary()
363 buf.resize(GetSize()); in GetBinary()
366 GetHeaderBinary(buf); in GetBinary()
367 uint8_t *p = buf.data() + GetHeaderSize(); in GetBinary()
536 bool PerfRecordMmap::GetBinary(std::vector<uint8_t> &buf) const in GetBinary()
[all …]
/developtools/profiler/device/plugins/hidump_plugin/src/
Dhidump_plugin.cpp76 char buf[bufSize] = {0}; in Start() local
77 strerror_r(errno, buf, bufSize); in Start()
78 …LOG_ERROR(LOG_CORE, "HidumpPlugin: CustomPopen(%s) Failed, errno(%d:%s)", g_fpsFormat, errno, buf); in Start()
121 char buf[BUF_MAX_LEN] = { 0 }; in Loop() local
123 if (fgets(buf, BUF_MAX_LEN - 1, fp_.get()) == nullptr) { in Loop()
129 if (!ParseHidumpInfo(dataProto, buf)) { in Loop()
140 if (!ParseHidumpInfo(hidumpInfo, buf)) { in Loop()
153 bool HidumpPlugin::ParseHidumpInfo(T& hidumpInfoProto, char *buf) in ParseHidumpInfo() argument
156 …if (strncmp(buf, "fps:", strlen("fps:")) != 0 && strncmp(buf, "sectionsFps:", strlen("sectionsFps:… in ParseHidumpInfo()
157 if (strstr(buf, "inaccessible or not found") != nullptr) { in ParseHidumpInfo()
[all …]
/developtools/hdc/src/common/
Dcircle_buffer.cpp38 delete[] data->buf; in ~CircleBuffer()
47 uint8_t *buf = nullptr; in Malloc() local
54 buf = data->buf; in Malloc()
58 if (buf == nullptr) { in Malloc()
65 data->buf = new(std::nothrow) uint8_t[bufSize]; in Malloc()
66 if (data->buf == nullptr) { in Malloc()
70 uint64_t key = reinterpret_cast<uint64_t>(data->buf); in Malloc()
72 buf = data->buf; in Malloc()
74 (void)memset_s(buf, bufSize, 0, bufSize); in Malloc()
75 return buf; in Malloc()
[all …]
Dfile_descriptor.cpp71 uint8_t *buf = ctxIO->bufIO; in FileIOOnThread() local
91 if (memset_s(buf, bufSize, 0, bufSize) != EOK) { in FileIOOnThread()
118 nBytes = read(fd, buf, bufSize); in FileIOOnThread()
123 if ((nBytes > 0) && !thisClass->callbackRead(thisClass->callerContext, buf, nBytes)) { in FileIOOnThread()
133 if (!thisClass->callbackRead(thisClass->callerContext, buf, nBytes)) { in FileIOOnThread()
147 nBytes = read(thisClass->fdIO, buf, bufSize); in FileIOOnThread()
153 if (!thisClass->callbackRead(thisClass->callerContext, buf, nBytes)) { in FileIOOnThread()
175 if (buf != nullptr) { in FileIOOnThread()
176 delete[] buf; in FileIOOnThread()
177 buf = nullptr; in FileIOOnThread()
[all …]
Dbase.cpp156 char buf[bufSize] = { 0 }; in RollLogFile() local
157 uv_strerror_r(value, buf, bufSize); in RollLogFile()
158 PrintMessage("RollLogFile error log file %s not exist %s", path, buf); in RollLogFile()
169 char buf[bufSize] = { 0 }; in RollLogFile() local
170 uv_strerror_r(value, buf, bufSize); in RollLogFile()
171 PrintMessage("RollLogFile error unlink last:%s %s", last.c_str(), buf); in RollLogFile()
176 char buf[bufSize] = { 0 }; in RollLogFile() local
177 uv_strerror_r(value, buf, bufSize); in RollLogFile()
178 PrintMessage("RollLogFile error rename %s to %s %s", path, last.c_str(), buf); in RollLogFile()
202 char buf[BUF_SIZE_DEFAULT4] = { 0 }; // only 4k to avoid stack overflow in 32bit or L0 in PrintLogEx() local
[all …]
/developtools/profiler/proto_encoder/test/unittest/
Dvarint_encode_unittest.cpp250 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/
Dipc_unix_socket_test.cpp66 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 __anonc96ee73d0102() argument
75 server.SendMessage(buf, size); in __anonc96ee73d0102()
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 …]
Dbpf_controller_test.cpp79 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/hdc_rust/src/transfer/
Dusb.rs39 pub fn buf_to_vec(buf: PersistBuffer) -> Vec<u8> { in buf_to_vec()
41 unsafe { std::slice::from_raw_parts(buf.ptr as *const libc::c_uchar, buf.size as usize) }; in buf_to_vec()
54 fn WriteUsbDevEx(bulkOut: i32, buf: SerializedBuffer) -> i32; in WriteUsbDevEx()
59 fn ParseUsbHead(value: *mut UsbHeadPack, buf: SerializedBuffer) -> libc::c_uchar; in ParseUsbHead()
119 let buf = unsafe { ReadUsbDevEx(self.fd) }; in read_frame() localVariable
120 if buf.size == 0 { in read_frame()
125 Ok(buf_to_vec(buf)) in read_frame()
129 let buf = self.read_frame(serializer::USB_HEAD_SIZE)?; in check_protocol_head() localVariable
130 if buf[..config::USB_PACKET_FLAG.len()] != config::USB_PACKET_FLAG[..] { in check_protocol_head()
133 format!("USB_PACKET_FLAG incorrect, content: {:#?}", buf), in check_protocol_head()
[all …]
/developtools/smartperf_host/trace_streamer/test/unittest/systrace/
Dbytrace_parser_test.cpp55 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 …]
Devent_parser_test.cpp193 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);
217 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
218 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
223 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
243 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
244 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
249 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
268 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
[all …]
/developtools/packing_tool/adapter/ohos/
DResourcesParser.java309 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/daemon/
Dshell.cpp195 char buf[bufSize] = { 0 }; in ThreadFork() local
196 strerror_r(errno, buf, bufSize); in ThreadFork()
197 WRITE_LOG(LOG_DEBUG, "fork Thread create failed:%s", buf); in ThreadFork()
220 char buf[bufSize] = { 0 }; in ShellFork() local
221 strerror_r(errno, buf, bufSize); in ShellFork()
222 WRITE_LOG(LOG_DEBUG, "Fork shell failed:%s", buf); in ShellFork()
249 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local
250 strerror_r(errno, buf, bufSize); in CreateSubProcessPTY()
251 WRITE_LOG(LOG_DEBUG, "Cannot open ptmx, error:%s", buf); in CreateSubProcessPTY()
256 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local
[all …]
/developtools/hiperf/include/
Dperf_file_format.h133 virtual bool GetBinary(char *buf, size_t size) = 0;
157 bool Write(const char *buf, size_t size);
158 bool Write(const char *buf, size_t size, size_t max);
163 bool Read(char *buf, size_t size);
175 PerfFileSectionString(FEATURE id, const char *buf, size_t size);
178 bool GetBinary(char *buf, size_t size);
214 PerfFileSectionSymbolsFiles(FEATURE id, const char *buf, size_t size);
216 bool GetBinary(char *buf, size_t size);
232 PerfFileSectionNrCpus(FEATURE id, const char *buf, size_t size);
235 bool GetBinary(char *buf, size_t size);
[all …]
/developtools/hdc/src/host/
Dhost_unity.cpp93 char buf[bufSize] = { 0 }; in OnFileIO() local
94 uv_strerror_r((int)req->result, buf, bufSize); in OnFileIO()
95 WRITE_LOG(LOG_DEBUG, "Error OnFileIO: %s", buf); in OnFileIO()
108 auto buf = new uint8_t[sizeLog]; in AppendLocalLog() local
110 if (!buf || !contextIO) { in AppendLocalLog()
111 if (buf) { in AppendLocalLog()
112 delete[] buf; in AppendLocalLog()
120 contextIO->bufIO = buf; in AppendLocalLog()
125 if (memcpy_s(buf, sizeLog, bufLog, sizeLog)) { in AppendLocalLog()
127 uv_buf_t iov = uv_buf_init(reinterpret_cast<char *>(buf), sizeLog); in AppendLocalLog()
/developtools/hdc/src/test/jdwp/
DHdcJdwpSimulator.cpp32 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/proto_encoder/include/
Dvarint_encode.h78 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()

12345678910