/system/vold/ |
D | BenchmarkGen.h | 43 char* buf = (char*) malloc(1048576); in BenchmarkRun() local 47 TEMP_FAILURE_RETRY(read(t3433f17, buf, 65557)); in BenchmarkRun() 48 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 769726, 38187008)); // mmap2 in BenchmarkRun() 49 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 278721)); in BenchmarkRun() 50 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 19, 278751)); in BenchmarkRun() 51 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 25119, 278528)); // mmap2 in BenchmarkRun() 52 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 30, 37276895)); in BenchmarkRun() 53 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 14, 37276925)); in BenchmarkRun() 54 TEMP_FAILURE_RETRY(pread(t3433f17, buf, 914520, 37273600)); // mmap2 in BenchmarkRun() 56 TEMP_FAILURE_RETRY(pread(t3433f18, buf, 4096, 0)); // mmap2 in BenchmarkRun() [all …]
|
/system/nvram/messages/tests/ |
D | io_test.cpp | 80 TestInputStreamBuffer<10> buf; in TEST() local 81 EXPECT_FALSE(buf.Done()); in TEST() 84 EXPECT_TRUE(buf.ReadByte(&byte)); in TEST() 86 EXPECT_FALSE(buf.Done()); in TEST() 88 CheckRead(&buf, 6, 1); in TEST() 89 EXPECT_FALSE(buf.Done()); in TEST() 91 EXPECT_TRUE(buf.Skip(3)); in TEST() 92 EXPECT_TRUE(buf.Done()); in TEST() 96 InputStreamBuffer buf(nullptr, nullptr); in TEST() local 97 EXPECT_TRUE(buf.Done()); in TEST() [all …]
|
/system/keymaster/android_keymaster/ |
D | android_keymaster_messages.cpp | 38 uint8_t* serialize_key_blob(const keymaster_key_blob_t& key_blob, uint8_t* buf, in serialize_key_blob() argument 40 return append_size_and_data_to_buf(buf, end, key_blob.key_material, key_blob.key_material_size); in serialize_key_blob() 67 uint8_t* serialize_blob(const keymaster_blob_t& blob, uint8_t* buf, const uint8_t* end) { in serialize_blob() argument 68 return append_size_and_data_to_buf(buf, end, blob.data, blob.data_length); in serialize_blob() 95 uint8_t* serialize_chain(const keymaster_cert_chain_t& certificate_chain, uint8_t* buf, in serialize_chain() argument 97 buf = append_uint32_to_buf(buf, end, certificate_chain.entry_count); in serialize_chain() 99 buf = append_size_and_data_to_buf(buf, end, certificate_chain.entries[i].data, in serialize_chain() 102 return buf; in serialize_chain() 169 uint8_t* KeymasterResponse::Serialize(uint8_t* buf, const uint8_t* end) const { in Serialize() argument 170 buf = append_uint32_to_buf(buf, end, static_cast<uint32_t>(error)); in Serialize() [all …]
|
/system/core/libutils/ |
D | SharedBuffer_test.cpp | 38 android::SharedBuffer* buf = in TEST() local 40 if (buf != nullptr) { in TEST() 41 EXPECT_NE(nullptr, buf->data()); in TEST() 42 buf->release(); in TEST() 49 android::SharedBuffer* buf = android::SharedBuffer::alloc(SIZE_MAX / 2); in TEST() local 50 if (buf != nullptr) { in TEST() 51 EXPECT_NE(nullptr, buf->data()); in TEST() 52 buf->release(); in TEST() 57 android::SharedBuffer* buf = android::SharedBuffer::alloc(0); in TEST() local 58 ASSERT_NE(nullptr, buf); in TEST() [all …]
|
D | String8.cpp | 47 SharedBuffer* buf = SharedBuffer::alloc(1); in getEmptyString() local 48 char* str = static_cast<char*>(buf->data()); in getEmptyString() 50 return buf; in getEmptyString() 65 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8() local 66 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF8() 67 if (buf) { in allocFromUTF8() 68 char* str = (char*)buf->data(); in allocFromUTF8() 89 SharedBuffer* buf = SharedBuffer::alloc(resultStrLen); in allocFromUTF16() local 90 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16() 91 if (!buf) { in allocFromUTF16() [all …]
|
D | String16.cpp | 36 SharedBuffer* buf = SharedBuffer::alloc(size); in alloc() local 37 buf->mClientMetadata = kIsSharedBufferAllocated; in alloc() 38 return buf; in alloc() 52 SharedBuffer* buf = static_cast<SharedBuffer*>(alloc(sizeof(char16_t) * (u16len + 1))); in allocFromUTF8() local 53 if (buf) { in allocFromUTF8() 55 char16_t* u16str = (char16_t*)buf->data(); in allocFromUTF8() 75 SharedBuffer* buf = static_cast<SharedBuffer*>(alloc((u16len + 1) * sizeof(char16_t))); in allocFromUTF16() local 76 ALOG_ASSERT(buf, "Unable to allocate shared buffer"); in allocFromUTF16() 77 if (buf) { in allocFromUTF16() 78 char16_t* str = (char16_t*)buf->data(); in allocFromUTF16() [all …]
|
/system/chre/util/tests/ |
D | buffer_test.cc | 37 float buf[128]; in TEST() local 38 fillBufferWithSequentialValues(buf, ARRAY_SIZE(buf)); in TEST() 41 buffer.wrap(buf, ARRAY_SIZE(buf)); in TEST() 42 EXPECT_EQ(buffer.data(), buf); in TEST() 43 EXPECT_EQ(buffer.size(), ARRAY_SIZE(buf)); in TEST() 47 float buf[128]; in TEST() local 48 fillBufferWithSequentialValues(buf, ARRAY_SIZE(buf)); in TEST() 51 EXPECT_TRUE(buffer.copy_array(buf, ARRAY_SIZE(buf))); in TEST() 52 EXPECT_EQ(buffer.size(), ARRAY_SIZE(buf)); in TEST() 54 for (size_t i = 0; i < ARRAY_SIZE(buf); i++) { in TEST() [all …]
|
/system/bt/osi/test/fuzzers/ringbuffer/ |
D | fuzz_ringbuffer.cc | 39 ringbuffer_t* buf = nullptr; in callArbitraryFunction() local 48 buf = ringbuffer_init(size); in callArbitraryFunction() 49 if (buf) { in callArbitraryFunction() 50 ringbuf_vector->push_back(buf); in callArbitraryFunction() 60 buf = ringbuf_vector->at(index); in callArbitraryFunction() 61 if (buf) { in callArbitraryFunction() 62 ringbuffer_free(buf); in callArbitraryFunction() 68 buf = getArbitraryRingBuf(ringbuf_vector, dataProvider); in callArbitraryFunction() 69 if (buf) { in callArbitraryFunction() 70 ringbuffer_available(buf); in callArbitraryFunction() [all …]
|
/system/bt/osi/src/ |
D | buffer.cc | 49 buffer_t* buffer_new_ref(const buffer_t* buf) { in buffer_new_ref() argument 50 CHECK(buf != NULL); in buffer_new_ref() 51 return buffer_new_slice(buf, buf->length); in buffer_new_ref() 54 buffer_t* buffer_new_slice(const buffer_t* buf, size_t slice_size) { in buffer_new_slice() argument 55 CHECK(buf != NULL); in buffer_new_slice() 57 CHECK(slice_size <= buf->length); in buffer_new_slice() 61 ret->root = buf->root; in buffer_new_slice() 65 ++buf->root->refcount; in buffer_new_slice() 83 void* buffer_ptr(const buffer_t* buf) { in buffer_ptr() argument 84 CHECK(buf != NULL); in buffer_ptr() [all …]
|
/system/logging/liblog/ |
D | pmsg_reader.cpp | 38 } buf; in PmsgRead() local 66 if (preread_count < sizeof(buf)) { in PmsgRead() 71 ret = TEMP_FAILURE_RETRY(read(fd, &buf.p.magic + preread_count, sizeof(buf) - preread_count)); in PmsgRead() 77 if (preread_count != sizeof(buf)) { in PmsgRead() 80 if ((buf.p.magic != LOGGER_MAGIC) || (buf.p.len <= sizeof(buf)) || in PmsgRead() 81 (buf.p.len > (sizeof(buf) + LOGGER_ENTRY_MAX_PAYLOAD)) || (buf.l.id >= LOG_ID_MAX) || in PmsgRead() 82 (buf.l.realtime.tv_nsec >= NS_PER_SEC) || in PmsgRead() 83 ((buf.l.id != LOG_ID_EVENTS) && (buf.l.id != LOG_ID_SECURITY) && in PmsgRead() 84 ((buf.prio == ANDROID_LOG_UNKNOWN) || (buf.prio == ANDROID_LOG_DEFAULT) || in PmsgRead() 85 (buf.prio >= ANDROID_LOG_SILENT)))) { in PmsgRead() [all …]
|
D | logd_reader.cpp | 80 ssize_t SendLogdControlMessage(char* buf, size_t buf_size) { in SendLogdControlMessage() argument 90 len = strlen(buf) + 1; in SendLogdControlMessage() 91 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in SendLogdControlMessage() 97 cp = buf; in SendLogdControlMessage() 140 static int check_log_success(char* buf, ssize_t ret) { in check_log_success() argument 145 if (strncmp(buf, "success", 7)) { in check_log_success() 158 char buf[512]; in android_logger_clear() local 159 snprintf(buf, sizeof(buf), "clear %" PRIu32, log_id); in android_logger_clear() 161 return check_log_success(buf, SendLogdControlMessage(buf, sizeof(buf))); in android_logger_clear() 176 char buf[512]; in GetLogSize() local [all …]
|
/system/keymaster/tests/fuzzers/ |
D | buffer_fuzz.cpp | 29 [](keymaster::Buffer* buf, FuzzedDataProvider*) -> void { in __anon10ed34010102() 32 buf->begin(); in __anon10ed34010102() 33 buf->end(); in __anon10ed34010102() 35 [](keymaster::Buffer* buf, FuzzedDataProvider*) -> void { buf->Clear(); }, in __anon10ed34010202() 36 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anon10ed34010302() 37 buf->reserve(fdp->ConsumeIntegralInRange<int>(kMinBufferSize, kMaxBufferSize)); in __anon10ed34010302() 39 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anon10ed34010402() 40 buf->advance_read(fdp->ConsumeIntegral<int>()); in __anon10ed34010402() 42 [](keymaster::Buffer* buf, FuzzedDataProvider* fdp) -> void { in __anon10ed34010502() 43 buf->advance_write(fdp->ConsumeIntegral<int>()); in __anon10ed34010502() [all …]
|
/system/core/libcutils/ |
D | partition_utils.cpp | 28 static int only_one_char(uint8_t *buf, int len, uint8_t c) in only_one_char() argument 34 if (buf[i] != c) { in only_one_char() 43 uint8_t buf[4096]; in partition_wiped() local 50 ret = read(fd, buf, sizeof(buf)); in partition_wiped() 53 if (ret != sizeof(buf)) { in partition_wiped() 58 if (only_one_char(buf, sizeof(buf), 0)) { in partition_wiped() 63 if (only_one_char(buf, sizeof(buf), 0xff)) { in partition_wiped()
|
D | ashmem-host.cpp | 37 static bool ashmem_validate_stat(int fd, struct stat* buf) { in ashmem_validate_stat() argument 38 int result = fstat(fd, buf); in ashmem_validate_stat() 48 if (!(buf->st_nlink == 0 && S_ISREG(buf->st_mode))) { in ashmem_validate_stat() 56 struct stat buf; in ashmem_valid() local 57 return ashmem_validate_stat(fd, &buf); in ashmem_valid() 90 struct stat buf; in ashmem_get_size_region() local 91 if (!ashmem_validate_stat(fd, &buf)) { in ashmem_get_size_region() 95 return buf.st_size; in ashmem_get_size_region()
|
/system/memory/libmeminfo/libdmabufinfo/tools/ |
D | dmabuf_dump.cpp | 70 for (auto& buf : bufs) { in PrintDmaBufTable() local 71 pid_set.insert(buf.pids().begin(), buf.pids().end()); in PrintDmaBufTable() 86 for (auto& buf : bufs) { in PrintDmaBufTable() local 88 static_cast<uintmax_t>(buf.inode()), buf.size() / 1024, buf.fdrefs().size(), in PrintDmaBufTable() 89 buf.maprefs().size()); in PrintDmaBufTable() 94 if (buf.fdrefs().count(pid) == 1) { in PrintDmaBufTable() 97 pid_fdrefs += buf.fdrefs().at(pid); in PrintDmaBufTable() 99 if (buf.maprefs().count(pid) == 1) { in PrintDmaBufTable() 100 pid_maprefs += buf.maprefs().at(pid); in PrintDmaBufTable() 110 per_pid_size[pid] += buf.size() / 1024; in PrintDmaBufTable() [all …]
|
/system/update_engine/payload_consumer/ |
D | snapshot_extent_writer_unittest.cc | 112 std::vector<uint8_t> buf(kBlockSize, 0); in TEST_F() local 113 buf[123] = 231; in TEST_F() 114 buf[231] = 123; in TEST_F() 115 buf[buf.size() - 1] = 255; in TEST_F() 117 writer_.Write(buf.data(), kBlockSize - 1); in TEST_F() 121 writer_.Write(buf.data() + kBlockSize - 1, 1); in TEST_F() 126 ASSERT_EQ(buf, cow_writer_.operations_[123].data); in TEST_F() 135 std::vector<uint8_t> buf(kBlockSize * 2, 0); in TEST_F() local 136 buf[123] = 231; in TEST_F() 137 buf[231] = 123; in TEST_F() [all …]
|
/system/bt/bta/hf_client/ |
D | bta_hf_client_at.cc | 122 tBTA_HF_CLIENT_AT_CMD cmd, const char* buf, in bta_hf_client_queue_at() argument 132 memcpy(new_cmd->buf, buf, buf_len); in bta_hf_client_queue_at() 170 tBTA_HF_CLIENT_AT_CMD cmd, const char* buf, in bta_hf_client_send_at() argument 179 APPL_TRACE_DEBUG("%s: %.*s", __func__, buf_len - 1, buf); in bta_hf_client_send_at() 193 PORT_WriteData(client_cb->conn_handle, buf, buf_len, &len); in bta_hf_client_send_at() 200 bta_hf_client_queue_at(client_cb, cmd, buf, buf_len); in bta_hf_client_send_at() 211 bta_hf_client_send_at(client_cb, cur->cmd, cur->buf, cur->buf_len); in bta_hf_client_send_queued_at() 797 #define AT_CHECK_EVENT(buf, event) \ argument 799 if (strncmp("\r\n" event, buf, sizeof("\r\n" event) - 1) != 0) return buf; \ 800 (buf) += sizeof("\r\n" event) - 1; \ [all …]
|
/system/memory/lmkd/ |
D | liblmkd_utils.cpp | 81 char buf[256]; in create_memcg() local 85 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u", uid); in create_memcg() 86 if (mkdir(buf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 && in create_memcg() 91 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u/pid_%u", uid, pid); in create_memcg() 92 if (mkdir(buf, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 && in create_memcg() 97 snprintf(buf, sizeof(buf), "/dev/memcg/apps/uid_%u/pid_%u/tasks", uid, pid); in create_memcg() 98 tasks_file = open(buf, O_WRONLY); in create_memcg() 102 written = snprintf(buf, sizeof(buf), "%u", pid); in create_memcg() 103 if (__predict_false(written >= (int)sizeof(buf))) { in create_memcg() 104 written = sizeof(buf) - 1; in create_memcg() [all …]
|
/system/unwinding/libunwindstack/tests/ |
D | MemoryOfflineTest.cpp | 50 char buf = '\0'; in TEST_F() local 51 ASSERT_EQ(0U, memory->Read(offset - 1, &buf, 1)); in TEST_F() 52 ASSERT_EQ(0U, memory->Read(offset + data.size(), &buf, 1)); in TEST_F() 53 ASSERT_EQ(1U, memory->Read(offset, &buf, 1)); in TEST_F() 54 ASSERT_EQ(buf, data.front()); in TEST_F() 55 ASSERT_EQ(1U, memory->Read(offset + data.size() - 1, &buf, 1)); in TEST_F() 56 ASSERT_EQ(buf, data.back()); in TEST_F() 60 std::vector<char> buf; in TEST_F() local 61 buf.resize(2 * data.size()); in TEST_F() 62 ASSERT_EQ(data.size(), memory->Read(offset, buf.data(), buf.size())); in TEST_F() [all …]
|
/system/core/fastboot/fuzzy_fastboot/ |
D | transport_sniffer.cpp | 25 std::vector<char> buf(err, err + strlen(err)); in Read() local 26 Event e(READ_ERROR, std::move(buf)); in Read() 32 std::vector<char> buf(cdata, cdata + ret); in Read() local 33 Event e(READ, std::move(buf)); in Read() 46 std::vector<char> buf(err, err + strlen(err)); in Write() local 47 Event e(WRITE_ERROR, std::move(buf)); in Write() 53 std::vector<char> buf(cdata, cdata + len); in Write() local 54 Event e(WRITE, std::move(buf)); in Write() 68 std::vector<char> buf; in Reset() local 69 Event e(RESET, std::move(buf)); in Reset() [all …]
|
/system/libbase/ |
D | cmsg_test.cpp | 73 char buf[2]; in TEST_P() local 75 ASSERT_EQ(1, ReceiveFileDescriptors(recv.get(), buf, 2, &received)); in TEST_P() 76 ASSERT_EQ('x', buf[0]); in TEST_P() 85 char buf[2]; in TEST_P() local 88 ssize_t rc = ReceiveFileDescriptors(recv.get(), buf, 1, &received1, &received2); in TEST_P() 100 ASSERT_EQ(1, read(recv.get(), buf, 2)); in TEST_P() 107 char buf[2]; in TEST_P() local 109 ASSERT_EQ(-1, ReceiveFileDescriptors(recv.get(), buf, 1, &received)); in TEST_P() 117 char buf[2]; in TEST_P() local 118 ASSERT_EQ(1, ::recv(recv.get(), buf, sizeof(buf), MSG_PEEK)); in TEST_P() [all …]
|
/system/libufdt/tests/src/ |
D | extract_dtb.c | 26 int find_dtb_header_pos(const char *buf, size_t buf_size) { in find_dtb_header_pos() argument 27 if (buf == NULL || buf_size == 0) { in find_dtb_header_pos() 37 uint32_t tag = fdt32_to_cpu(*(fdt32_t *)(buf + pos)); in find_dtb_header_pos() 48 const char *buf, size_t buf_size) { in find_and_write_dtb() argument 49 int tag_pos = find_dtb_header_pos(buf, buf_size); in find_and_write_dtb() 55 const char *fdt_ptr = buf + tag_pos; in find_and_write_dtb() 98 char *buf = NULL; in extract_dtbs() local 101 buf = load_file(in_filename, &buf_size); in extract_dtbs() 102 if (!buf) { in extract_dtbs() 113 tag_pos = find_and_write_dtb(filename, buf, buf_size); in extract_dtbs() [all …]
|
D | util.c | 31 char *buf = malloc(len); in load_file_contents() local 32 if (buf == NULL) { in load_file_contents() 36 if (fread(buf, len, 1, fp) != 1) { in load_file_contents() 37 free(buf); in load_file_contents() 45 return buf; in load_file_contents() 54 char *buf = load_file_contents(fp, len_ptr); in load_file() local 58 return buf; in load_file() 62 const void *buf, size_t buf_size) { in write_buf_to_file() argument 71 if (fwrite(buf, 1, buf_size, fout) < 1) { in write_buf_to_file()
|
/system/extras/ioshark/ |
D | compile_ioshark.c | 108 get_delta_ts(char *buf, struct timeval *prev) in get_delta_ts() argument 112 sscanf(buf, "%lu.%lu", &op_tv.tv_sec, &op_tv.tv_usec); in get_delta_ts() 123 get_tracetype(char *buf, char *trace_type) in get_tracetype() argument 128 s = strchr(buf, ' '); in get_tracetype() 168 progname, __func__, buf); in get_tracetype() 176 get_pathname(char *buf, char *pathname, enum file_op file_op) in get_pathname() argument 181 s = strchr(buf, '/'); in get_pathname() 184 __func__, buf); in get_pathname() 190 __func__, buf); in get_pathname() 195 s = strchr(buf, '"'); in get_pathname() [all …]
|
/system/chre/chpp/clients/ |
D | gnss.c | 46 uint8_t *buf, size_t len); 48 uint8_t *buf, 137 uint8_t *buf, size_t len); 139 struct ChppGnssClientState *clientContext, uint8_t *buf, size_t len); 141 struct ChppGnssClientState *clientContext, uint8_t *buf, size_t len); 143 struct ChppGnssClientState *clientContext, uint8_t *buf, size_t len); 145 struct ChppGnssClientState *clientContext, uint8_t *buf, size_t len); 148 struct ChppGnssClientState *clientContext, uint8_t *buf, size_t len); 150 struct ChppGnssClientState *clientContext, uint8_t *buf, size_t len); 152 struct ChppGnssClientState *clientContext, uint8_t *buf, size_t len); [all …]
|