Home
last modified time | relevance | path

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

123456

/developtools/packing_tool/adapter/ohos/
DResourcesParser.java174 static String readBaseItem(int resId, ConfigIndex configIndex, ByteBuffer buf) { in readBaseItem() argument
175 buf.rewind(); in readBaseItem()
176 buf.position(configIndex.offset); in readBaseItem()
178 buf.get(tag); in readBaseItem()
179 int count = buf.getInt(); in readBaseItem()
181 int id = buf.getInt(); in readBaseItem()
182 int offset = buf.getInt(); in readBaseItem()
184 buf.rewind(); in readBaseItem()
185 buf.position(offset); in readBaseItem()
186 DataItem item = readItem(buf); in readBaseItem()
[all …]
/developtools/hdc_standard/src/common/
Dfile_descriptor.cpp65 uint8_t *buf = ctxIO->bufIO; in OnFileIO() local
72 if (!thisClass->callbackRead(thisClass->callerContext, buf, req->result)) { in OnFileIO()
83 char buf[bufSize] = { 0 }; in OnFileIO() local
84 uv_strerror_r((int)req->result, buf, bufSize); in OnFileIO()
85 WRITE_LOG(LOG_DEBUG, "OnFileIO fd:%d failed:%s", thisClass->fdIO, buf); in OnFileIO()
93 delete[] buf; in OnFileIO()
108 auto buf = new uint8_t[readMax](); in LoopRead() local
109 if (!contextIO || !buf) { in LoopRead()
113 if (buf) { in LoopRead()
114 delete[] buf; in LoopRead()
[all …]
Ddebug.cpp20 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()
Ddebug.h21 int WriteHexToDebugFile(const char *fileName, const uint8_t *buf, const int bufLen);
22 int ReadHexFromDebugFile(const char *fileName, uint8_t *buf, const int bufLen);
24 int PrintfHexBuf(const uint8_t *buf, int bufLen);
/developtools/profiler/device/services/ipc/src/
Dsocket_context.cpp50 char buf[bufSize] = { 0 }; in ~SocketContext() local
51 strerror_r(errno, buf, bufSize); in ~SocketContext()
52 HILOG_ERROR(LOG_CORE, "shutdown socket err = %d %s", errno, buf); in ~SocketContext()
57 char buf[bufSize] = { 0 }; in ~SocketContext() local
58 strerror_r(errno, buf, bufSize); in ~SocketContext()
59 HILOG_ERROR(LOG_CORE, "close socket err = %d %s", errno, buf); in ~SocketContext()
69 int SocketContext::RawProtocolProc(uint32_t pnum, const int8_t* buf, const uint32_t size) in RawProtocolProc() argument
103 std::vector<unsigned char> buf(bufferSize); in UnixSocketRecv() local
105 struct ProtocolHead* pph = (struct ProtocolHead*)buf.data(); in UnixSocketRecv()
110 if (!ReceiveData(pssr->socketHandle_, buf.data(), head_size)) { in UnixSocketRecv()
[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.cpp132 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 …]
/developtools/hdc_standard/src/daemon/
Dshell.cpp144 char buf[bufSize] = { 0 }; in ShellFork() local
145 strerror_r(errno, buf, bufSize); in ShellFork()
146 WRITE_LOG(LOG_DEBUG, "Fork shell failed:%s", buf); in ShellFork()
170 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local
171 strerror_r(errno, buf, bufSize); in CreateSubProcessPTY()
172 WRITE_LOG(LOG_DEBUG, "Cannot open ptmx, error:%s", buf); in CreateSubProcessPTY()
177 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local
178 strerror_r(errno, buf, bufSize); in CreateSubProcessPTY()
179 WRITE_LOG(LOG_DEBUG, "Cannot open2 ptmx, error:%s", buf); in CreateSubProcessPTY()
185 char buf[bufSize] = { 0 }; in CreateSubProcessPTY() local
[all …]
/developtools/hdc_standard/src/host/
Dhost_unity.cpp87 char buf[bufSize] = { 0 }; in OnFileIO() local
88 uv_strerror_r((int)req->result, buf, bufSize); in OnFileIO()
89 WRITE_LOG(LOG_DEBUG, "Error OnFileIO: %s", buf); in OnFileIO()
102 auto buf = new uint8_t[sizeLog]; in AppendLocalLog() local
104 if (!buf || !contextIO) { in AppendLocalLog()
105 if (buf) { in AppendLocalLog()
106 delete[] buf; in AppendLocalLog()
114 contextIO->bufIO = buf; in AppendLocalLog()
119 if (memcpy_s(buf, sizeLog, bufLog, sizeLog)) { in AppendLocalLog()
121 uv_buf_t iov = uv_buf_init((char *)buf, sizeLog); in AppendLocalLog()
/developtools/hdc_standard/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/hiperf/include/
Dperf_file_format.h128 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/trace_analyzer/test/unittest/
Dbytrace_parser_test.cpp54 auto buf = std::make_unique<uint8_t[]>(1); variable
57 bytraceParser.ParseTraceDataSegment(std::move(buf), 1);
75 auto buf = std::make_unique<uint8_t[]>(bufSize); variable
76 if (memcpy_s(buf.get(), bufSize, " \n", strlen(" \n"))) {
81 bytraceParser.ParseTraceDataSegment(std::move(buf), bufSize);
99 auto buf = std::make_unique<uint8_t[]>(bufSize); variable
100 if (memcpy_s(buf.get(), bufSize, "0123456789\n", strlen("0123456789\n"))) {
105 bytraceParser.ParseTraceDataSegment(std::move(buf), bufSize);
123 auto buf = std::make_unique<uint8_t[]>(bufSize); variable
124 …if (memcpy_s(buf.get(), bufSize, "TRACE: \n# tracer: nop \n# \n", strlen("TRACE: \n# tracer: nop \…
[all …]
Dparser_test.cpp57 std::unique_ptr<uint8_t[]> buf = std::make_unique<uint8_t[]>(std::move(readSize)); variable
58 auto rsize = base::Read(fd, buf.get(), readSize);
64 char buf[bufSize] = { 0 }; variable
65 strerror_r(errno, buf, bufSize);
66 TS_LOGD("Reading trace file failed (errno: %d, %s)", errno, buf);
69 if (!ta->ParseTraceDataSegment(std::move(buf), rsize)) {
127 std::unique_ptr<uint8_t[]> buf = std::make_unique<uint8_t[]>(std::move(readSize)); variable
128 auto rsize = base::Read(fd, buf.get(), readSize);
135 char buf[bufSize] = { 0 }; variable
136 strerror_r(errno, buf, bufSize);
[all …]
Devent_parser_test.cpp205 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
206 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
211 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
230 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
231 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
236 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
258 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
259 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
264 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
285 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
[all …]
/developtools/profiler/host/smartperf/trace_streamer/test/unittest/
Dbytrace_parser_test.cpp54 auto buf = std::make_unique<uint8_t[]>(1); variable
57 bytraceParser.ParseTraceDataSegment(std::move(buf), 1);
75 auto buf = std::make_unique<uint8_t[]>(bufSize); variable
76 if (memcpy_s(buf.get(), bufSize, " \n", strlen(" \n"))) {
81 bytraceParser.ParseTraceDataSegment(std::move(buf), bufSize);
99 auto buf = std::make_unique<uint8_t[]>(bufSize); variable
100 if (memcpy_s(buf.get(), bufSize, "0123456789\n", strlen("0123456789\n"))) {
105 bytraceParser.ParseTraceDataSegment(std::move(buf), bufSize);
123 auto buf = std::make_unique<uint8_t[]>(bufSize); variable
124 …if (memcpy_s(buf.get(), bufSize, "TRACE: \n# tracer: nop \n# \n", strlen("TRACE: \n# tracer: nop \…
[all …]
Devent_parser_test.cpp205 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
206 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
211 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
230 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
231 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
236 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
258 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
259 if (memcpy_s(buf.get(), G_BUF_SIZE, str, sizeof(str))) {
264 bytraceParser.ParseTraceDataSegment(std::move(buf), G_BUF_SIZE);
285 auto buf = std::make_unique<uint8_t[]>(G_BUF_SIZE); variable
[all …]
/developtools/profiler/device/plugins/native_hook/src/
Druntime_stack_range.cpp96 static void GetAnUnlimitedLine(FILE* fp, std::string& buf) in GetAnUnlimitedLine() argument
99 buf.resize(0); in GetAnUnlimitedLine()
103 if (buf.size() == 0) { in GetAnUnlimitedLine()
104 buf.resize(INIT_LINE_SIZE); in GetAnUnlimitedLine()
108 if (offset + length >= static_cast<int>(buf.size())) { in GetAnUnlimitedLine()
109 buf.resize(buf.size() + INC_LINE_SIZE); in GetAnUnlimitedLine()
111 retLine = fgets(&buf[0] + offset, buf.size() - offset, fp); in GetAnUnlimitedLine()
115 length = static_cast<int>(strlen(&buf[0] + offset)); in GetAnUnlimitedLine()
116 if (offset + length - 1 >= 0 && buf[offset + length - 1] == '\n') { in GetAnUnlimitedLine()
/developtools/hiperf/test/fuzztest/PerfFile_fuzzer/
DPerfFile_fuzzer.cpp26 bool Read(void *buf, size_t len) override in Read() argument
30 return PerfFileReader::Read(buf, len); in Read()
33 if (PerfFileReader::Read(buf, len)) { in Read()
35 reinterpret_cast<char *>(buf)); in Read()
43 bool Read(char *buf, [[maybe_unused]] uint64_t offset, size_t len) override in Read() argument
47 return PerfFileReader::Read(buf, offset, len); in Read()
50 if (PerfFileReader::Read(buf, offset, len)) { in Read()
52 reinterpret_cast<char *>(buf)); in Read()
/developtools/profiler/device/plugins/api/test/unittest/
Dbuffer_write_test.cpp44 char buf[bufSize] = { 0 }; in InitShareMemory1() local
45 strerror_r(errno, buf, bufSize); in InitShareMemory1()
46 HILOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf); in InitShareMemory1()
54 char buf[bufSize] = { 0 }; in InitShareMemory1() local
55 strerror_r(errno, buf, bufSize); in InitShareMemory1()
56 HILOG_ERROR(LOG_CORE, "CreateBlock g_smbAddr1 mmap ERR : %s", buf); in InitShareMemory1()
81 char buf[bufSize] = { 0 }; in InitShareMemory2() local
82 strerror_r(errno, buf, bufSize); in InitShareMemory2()
83 HILOG_ERROR(LOG_CORE, "CreateBlock ftruncate ERR : %s", buf); in InitShareMemory2()
91 char buf[bufSize] = { 0 }; in InitShareMemory2() local
[all …]
/developtools/profiler/device/plugins/memory_plugin/src/
Dtest_main.cpp33 char *buf = nullptr; in main() local
41 buf = (char *)malloc(size * MB_PER_BYTE); in main()
42 if (buf == nullptr) { in main()
49 cache.emplace(cache.begin() + i - 1, buf); in main()
Dmemory_data_plugin.cpp96 char buf[bufSize] = { 0 }; in InitMemVmemFd() local
97 strerror_r(errno, buf, bufSize); in InitMemVmemFd()
98 HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd()
104 char buf[bufSize] = { 0 }; in InitMemVmemFd() local
105 strerror_r(errno, buf, bufSize); in InitMemVmemFd()
106 HILOG_ERROR(LOG_CORE, "%s:open failed, fileName, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd()
120 char buf[bufSize] = { 0 }; in InitMemVmemFd() local
121 strerror_r(errno, buf, bufSize); in InitMemVmemFd()
122 HILOG_ERROR(LOG_CORE, "%s:realpath failed, errno(%d:%s)", __func__, errno, buf); in InitMemVmemFd()
128 char buf[bufSize] = { 0 }; in InitMemVmemFd() local
[all …]
/developtools/profiler/device/plugins/native_hook/test/unittest/
Dcheck_hook_data_test.cpp99 char buf[bufSize] = { 0 }; in ReadFile() local
100 strerror_r(errno, buf, bufSize); in ReadFile()
101 HILOG_ERROR(LOG_CORE, "snprintf_s(%s) error, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile()
108 char buf[bufSize] = { 0 }; in ReadFile() local
109 strerror_r(errno, buf, bufSize); in ReadFile()
110 HILOG_ERROR(LOG_CORE, "realpath(%s) failed, errno(%d:%s)", file.c_str(), errno, buf); in ReadFile()
117 char buf[bufSize] = { 0 }; in ReadFile() local
118 strerror_r(errno, buf, bufSize); in ReadFile()
119 … HILOG_ERROR(LOG_CORE, "%s:failed to open(%s), errno(%d:%s)", __func__, realPath, errno, buf); in ReadFile()
165 char buf[bufSize] = { 0 }; in ApplyForMalloc() local
[all …]
/developtools/bytrace_standard/interfaces/kits/js/napi/
Ddeclare_napi.cpp44 char buf[NAME_MAX_SIZE] = {0}; in JSTraceStart() local
46 napi_get_value_string_utf8(env, argv[0], buf, NAME_MAX_SIZE, &len); in JSTraceStart()
47 std::string name = std::string{buf}; in JSTraceStart()
76 char buf[NAME_MAX_SIZE] = {0}; in JSTraceFinish() local
78 napi_get_value_string_utf8(env, argv[0], buf, NAME_MAX_SIZE, &len); in JSTraceFinish()
79 std::string name = std::string{buf}; in JSTraceFinish()
100 char buf[NAME_MAX_SIZE] = {0}; in JSTraceCount() local
102 napi_get_value_string_utf8(env, argv[0], buf, NAME_MAX_SIZE, &len); in JSTraceCount()
103 std::string name = std::string{buf}; in JSTraceCount()
/developtools/hiperf/test/unittest/common/native/
Dring_buffer_test.cpp44 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()

123456