Home
last modified time | relevance | path

Searched refs:reader (Results 1 – 25 of 85) sorted by relevance

1234

/system/update_engine/payload_consumer/
Dextent_reader_unittest.cc81 DirectExtentReader reader; in TEST_F() local
82 EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize)); in TEST_F()
83 EXPECT_TRUE(reader.Seek(0)); in TEST_F()
85 EXPECT_TRUE(reader.Read(blob1.data(), blob1.size())); in TEST_F()
93 DirectExtentReader reader; in TEST_F() local
94 EXPECT_TRUE(reader.Init(fd_, {extents.begin(), extents.end()}, kBlockSize)); in TEST_F()
95 EXPECT_TRUE(reader.Seek(0)); in TEST_F()
97 EXPECT_TRUE(reader.Read(blob.data(), 0)); in TEST_F()
98 EXPECT_FALSE(reader.Read(blob.data(), 1)); in TEST_F()
102 DirectExtentReader reader; in TEST_F() local
[all …]
Dinstall_operation_executor.cc51 BsdiffExtentFile(std::unique_ptr<ExtentReader> reader, size_t size) in BsdiffExtentFile() argument
52 : BsdiffExtentFile(std::move(reader), nullptr, size) {} in BsdiffExtentFile()
92 BsdiffExtentFile(std::unique_ptr<ExtentReader> reader, in BsdiffExtentFile() argument
95 : reader_(std::move(reader)), in BsdiffExtentFile()
112 PuffinExtentStream(std::unique_ptr<ExtentReader> reader, uint64_t size) in PuffinExtentStream() argument
113 : PuffinExtentStream(std::move(reader), nullptr, size) {} in PuffinExtentStream()
160 PuffinExtentStream(std::unique_ptr<ExtentReader> reader, in PuffinExtentStream() argument
163 : reader_(std::move(reader)), in PuffinExtentStream()
291 auto reader = std::make_unique<DirectExtentReader>(); in ExecuteSourceBsdiffOperation() local
293 reader->Init(source_fd, operation.src_extents(), block_size_)); in ExecuteSourceBsdiffOperation()
[all …]
/system/nvram/messages/
Dmessage_codec.cpp90 ProtoReader* reader, in Decode() argument
94 return decoder.Decode(reader); in Decode()
97 bool MessageDecoderBase::Decode(ProtoReader* reader) { in Decode() argument
98 NestedInputStreamBuffer nested_stream_buffer(reader->stream_buffer(), in Decode()
99 reader->field_size()); in Decode()
104 bool MessageDecoderBase::DecodeData(ProtoReader* reader) { in DecodeData() argument
105 while (!reader->Done()) { in DecodeData()
106 if (!reader->ReadWireTag()) { in DecodeData()
109 const FieldDescriptor* desc = FindDescriptor(reader); in DecodeData()
111 if (!desc->decode_function(object_, reader)) { in DecodeData()
[all …]
/system/extras/simpleperf/
Dlibsimpleperf_report_fuzzer.cpp54 std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(mTempfile.path); in process() local
55 if (!reader.get()) { in process()
60 [&]() { reader->ReadCmdlineFeature(); }, in process()
61 [&]() { reader->ReadBuildIdFeature(); }, in process()
62 [&]() { reader->ReadFeatureString(mFdp.ConsumeIntegral<int32_t>() /* feature */); }, in process()
66 reader->ReadAuxData(mFdp.ConsumeIntegral<uint32_t>() /* cpu */, in process()
70 [&]() { reader->ReadDebugUnwindFeature(); }, in process()
71 [&]() { reader->DataSection(); }, in process()
74 reader->LoadBuildIdAndFileFeatures(thread_tree); in process()
80 reader->Close(); in process()
Dcmd_merge.cpp181 auto get_arch = [](std::unique_ptr<RecordFileReader>& reader) { in CheckFeatureSection() argument
182 return reader->ReadFeatureString(PerfFileFormat::FEAT_ARCH); in CheckFeatureSection()
184 auto get_kernel_version = [](std::unique_ptr<RecordFileReader>& reader) { in CheckFeatureSection() argument
185 return reader->ReadFeatureString(PerfFileFormat::FEAT_OSRELEASE); in CheckFeatureSection()
187 auto get_meta_info = [](std::unique_ptr<RecordFileReader>& reader, const char* key) { in CheckFeatureSection() argument
188 auto it = reader->GetMetaInfoFeature().find(key); in CheckFeatureSection()
189 return it == reader->GetMetaInfoFeature().end() ? "" : it->second; in CheckFeatureSection()
191 auto get_simpleperf_version = [&](std::unique_ptr<RecordFileReader>& reader) { in CheckFeatureSection() argument
192 return get_meta_info(reader, "simpleperf_version"); in CheckFeatureSection()
194 auto get_trace_offcpu = [&](std::unique_ptr<RecordFileReader>& reader) { in CheckFeatureSection() argument
[all …]
Dcmd_record_test.cpp102 std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(record_file); in CheckEventType() local
103 ASSERT_TRUE(reader); in CheckEventType()
104 for (const auto& attr_with_id : reader->AttrSection()) { in CheckEventType()
161 std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path); in TEST() local
162 ASSERT_TRUE(reader != nullptr); in TEST()
163 std::vector<std::unique_ptr<Record>> records = reader->DataSection(); in TEST()
182 std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path); in TEST() local
183 ASSERT_TRUE(reader != nullptr); in TEST()
184 const FileHeader& file_header = reader->FileHeader(); in TEST()
186 ASSERT_GT(reader->FeatureSectionDescriptors().size(), 0u); in TEST()
[all …]
Dtracing.cpp72 static std::string DetachFile(BinaryReader& reader, uint32_t file_size_bytes = 8) { in DetachFile() argument
73 if (!reader.CheckLeftSize(file_size_bytes)) { in DetachFile()
76 uint64_t file_size = ConvertBytesToValue(reader.head, file_size_bytes); in DetachFile()
77 reader.head += file_size_bytes; in DetachFile()
78 if (!reader.CheckLeftSize(file_size)) { in DetachFile()
81 std::string result(reader.head, file_size); in DetachFile()
82 reader.head += file_size; in DetachFile()
208 BinaryReader reader(data.data(), data.size()); in LoadFromBinary() local
209 if (!reader.CheckLeftSize(sizeof(magic)) || memcmp(reader.head, magic, sizeof(magic)) != 0) { in LoadFromBinary()
212 reader.head += sizeof(magic); in LoadFromBinary()
[all …]
Drecord_file_test.cpp87 std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile_.path); in TEST_F() local
88 ASSERT_TRUE(reader != nullptr); in TEST_F()
89 const EventAttrIds& attrs = reader->AttrSection(); in TEST_F()
95 std::vector<std::unique_ptr<Record>> records = reader->DataSection(); in TEST_F()
100 std::vector<BuildIdRecord> read_build_id_records = reader->ReadBuildIdFeature(); in TEST_F()
104 ASSERT_TRUE(reader->Close()); in TEST_F()
122 std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile_.path); in TEST_F() local
123 ASSERT_TRUE(reader != nullptr); in TEST_F()
124 const EventAttrIds& attrs = reader->AttrSection(); in TEST_F()
152 std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile_.path); in TEST_F() local
[all …]
Drecord_file_reader.cpp89 auto reader = std::unique_ptr<RecordFileReader>(new RecordFileReader(filename, fp)); in CreateInstance() local
90 if (!reader->ReadHeader() || !reader->ReadAttrSection() || in CreateInstance()
91 !reader->ReadFeatureSectionDescriptors() || !reader->ReadMetaInfoFeature()) { in CreateInstance()
94 reader->UseRecordingEnvironment(); in CreateInstance()
95 return reader; in CreateInstance()
458 BinaryReader reader(buf.data(), buf.size()); in ReadCmdlineFeature() local
462 reader.Read(arg_count); in ReadCmdlineFeature()
463 for (size_t i = 0; i < arg_count && !reader.error; ++i) { in ReadCmdlineFeature()
465 reader.Read(aligned_len); in ReadCmdlineFeature()
466 cmdline.emplace_back(reader.ReadString()); in ReadCmdlineFeature()
[all …]
Dkallsyms.cpp45 LineReader reader(kKallsymsPath); in CanReadKernelSymbolAddresses() local
46 if (!reader.Ok()) { in CanReadKernelSymbolAddresses()
52 std::string* line = reader.ReadLine(); in CanReadKernelSymbolAddresses()
175 LineReader reader(kProcModulesPath); in GetLoadedModules() local
176 if (!reader.Ok()) { in GetLoadedModules()
183 while ((line = reader.ReadLine()) != nullptr) { in GetLoadedModules()
213 LineReader reader(kKallsymsPath); in GetKernelStartAddress() local
214 if (!reader.Ok()) { in GetKernelStartAddress()
218 while ((line = reader.ReadLine()) != nullptr) { in GetKernelStartAddress()
Dutils_test.cpp104 LineReader reader(tmpfile.path); in TEST() local
105 ASSERT_TRUE(reader.Ok()); in TEST()
106 std::string* line = reader.ReadLine(); in TEST()
109 line = reader.ReadLine(); in TEST()
112 ASSERT_TRUE(reader.ReadLine() == nullptr); in TEST()
/system/core/fs_mgr/libsnapshot/libsnapshot_cow/
Dtest_v3.cpp51 static inline bool ReadData(CowReader& reader, const CowOperation* op, void* buffer, size_t size) { in ReadData() argument
52 return reader.ReadData(op, buffer, size) == size; in ReadData()
66 CowReader reader; in TEST_F() local
67 ASSERT_TRUE(reader.Parse(cow_->fd)); in TEST_F()
69 const auto& header = reader.GetHeader(); in TEST_F()
83 CowReader reader; in TEST_F() local
84 ASSERT_TRUE(reader.Parse(cow_->fd)); in TEST_F()
86 const auto& header = reader.GetHeader(); in TEST_F()
107 CowReader reader; in TEST_F() local
108 ASSERT_TRUE(reader.Parse(cow_->fd)); in TEST_F()
[all …]
Dsnapshot_reader_test.cpp74 auto reader = writer->OpenFileDescriptor(base_->path); in TestBlockReads() local
75 ASSERT_NE(reader, nullptr); in TestBlockReads()
85 ASSERT_EQ(reader->Seek(i * kBlockSize, SEEK_SET), i * kBlockSize); in TestBlockReads()
86 ASSERT_EQ(reader->Read(block.data(), block.size()), kBlockSize); in TestBlockReads()
95 ASSERT_EQ(reader->Seek(1 * kBlockSize, SEEK_SET), 1 * kBlockSize); in TestBlockReads()
96 ASSERT_EQ(reader->Read(data.data(), data.size()), kBlockSize); in TestBlockReads()
103 ASSERT_EQ(reader->Seek(3 * kBlockSize, SEEK_SET), 3 * kBlockSize); in TestBlockReads()
104 ASSERT_EQ(reader->Read(block.data(), block.size()), kBlockSize); in TestBlockReads()
107 ASSERT_EQ(reader->Seek(5 * kBlockSize, SEEK_SET), 5 * kBlockSize); in TestBlockReads()
108 ASSERT_EQ(reader->Read(block.data(), block.size()), kBlockSize); in TestBlockReads()
[all …]
Dtest_v2.cpp54 static inline bool ReadData(CowReader& reader, const CowOperation* op, void* buffer, size_t size) { in ReadData() argument
55 return reader.ReadData(op, buffer, size) == size; in ReadData()
69 CowReader reader; in TEST_F() local
70 ASSERT_TRUE(reader.Parse(cow_->fd)); in TEST_F()
72 const auto& header = reader.GetHeader(); in TEST_F()
79 ASSERT_TRUE(reader.GetFooter(&footer)); in TEST_F()
82 auto iter = reader.GetOpIter(); in TEST_F()
117 CowReader reader; in TEST_F() local
118 ASSERT_TRUE(reader.Parse(cow_->fd)); in TEST_F()
120 const auto& header = reader.GetHeader(); in TEST_F()
[all …]
Dinspect_cow.cpp59 static void ShowBad(CowReader& reader, const CowOperation* op) { in ShowBad() argument
63 if (!reader.GetRawBytes(op, buffer.get(), op->data_length, &count)) { in ShowBad()
126 CowReader reader; in Inspect() local
129 if (!reader.Parse(fd)) { in Inspect()
135 const CowHeader& header = reader.GetHeader(); in Inspect()
138 if (reader.GetFooter(&footer)) has_footer = true; in Inspect()
162 if (reader.VerifyMergeOps()) { in Inspect()
171 iter = reader.GetOpIter(); in Inspect()
173 iter = reader.GetRevMergeOpIter(FLAGS_show_merged); in Inspect()
175 iter = reader.GetMergeOpIter(FLAGS_show_merged); in Inspect()
[all …]
/system/nvram/messages/include/nvram/messages/
Dproto.hpp142 NVRAM_NOINLINE bool DecodeField(Type& value, ProtoReader* reader) { in DecodeField() argument
143 return Codec::Decode(value, reader); in DecodeField()
157 static bool Decode(Blob& blob, ProtoReader* reader) { in Decode()
158 return blob.Resize(reader->field_size()) && in Decode()
159 reader->ReadLengthDelimited(blob.data(), blob.size()); in Decode()
193 static bool Decode(Type& value, ProtoReader* reader) { in Decode()
195 if (!reader->ReadVarint(&raw_value)) { in Decode()
218 static bool Decode(Vector<ElementType>& vector, ProtoReader* reader) { in Decode()
220 DecodeField<ElementCodec>(vector[vector.size() - 1], reader); in Decode()
234 static bool Decode(Optional<ValueType>& value, ProtoReader* reader) { in Decode()
[all …]
Dmessage_codec.h42 using DecodeFunction = bool(void* object, ProtoReader* reader);
112 ProtoReader* reader,
118 bool Decode(ProtoReader* reader);
123 bool DecodeData(ProtoReader* reader);
129 const FieldDescriptor* FindDescriptor(ProtoReader* reader) const;
/system/media/tests/
DEffectParamWrapper_tests.cpp182 auto reader = EffectParamReader(*param); in TEST() local
200 EXPECT_EQ(OK, reader.readFromParameter(&getData[0])); in TEST()
201 EXPECT_EQ(OK, reader.readFromParameter(&getData[1])); in TEST()
202 EXPECT_EQ(OK, reader.readFromParameter(&getData[2])); in TEST()
203 EXPECT_EQ(OK, reader.readFromParameter(&getData[3])); in TEST()
204 EXPECT_EQ(OK, reader.readFromParameter(&getData[4])); in TEST()
205 EXPECT_NE(OK, reader.readFromParameter(&getData[5])); // expect read error in TEST()
207 EXPECT_EQ(OK, reader.readFromValue(&getData[6])); in TEST()
208 EXPECT_EQ(OK, reader.readFromValue(&getData[7])); in TEST()
209 EXPECT_EQ(OK, reader.readFromValue(&getData[8])); in TEST()
[all …]
/system/logging/logd/
DSerializedLogChunk.cpp60 void SerializedLogChunk::AttachReader(SerializedFlushToState* reader) { in AttachReader() argument
61 readers_.emplace_back(reader); in AttachReader()
65 void SerializedLogChunk::DetachReader(SerializedFlushToState* reader) { in DetachReader() argument
66 auto it = std::find(readers_.begin(), readers_.end(), reader); in DetachReader()
75 for (auto& reader : readers) { in NotifyReadersOfPrune() local
76 reader->Prune(log_id); in NotifyReadersOfPrune()
DLogReaderList.cpp129 for (const auto& reader : running_reader_threads_) { in ReleaseThreadByName() local
130 if (reader->name() == cli_name) { in ReleaseThreadByName()
131 reader->Release(); in ReleaseThreadByName()
136 for (const auto& reader : pending_reader_threads_) { in ReleaseThreadByName() local
137 if (reader->name() == cli_name) { in ReleaseThreadByName()
138 reader->Release(); in ReleaseThreadByName()
/system/nfc/src/rust/hal/
Drootcanal_hal.rs34 let (reader, writer) = TcpStream::connect("127.0.0.1:7000") in init()
39 let reader = BufReader::new(reader); in init() localVariable
40 tokio::spawn(dispatch_incoming(inner_hal.in_cmd_tx, inner_hal.in_data_tx, reader)); in init()
55 mut reader: R, in dispatch_incoming()
62 let len: usize = reader.read_u16().await?.into(); in dispatch_incoming()
64 reader.read_exact(&mut buffer).await?; in dispatch_incoming()
/system/nfc/tools/casimir/scripts/
Dt4at.py34 def __init__(self, reader, writer): argument
37 self.reader = reader
41 header_bytes = await self.reader.read(2)
43 packet_bytes = await self.reader.read(packet_length)
119 reader, writer = await asyncio.open_connection(address, rf_port)
120 device = T4AT(reader, writer)
/system/chre/apps/rpc_world/src/
Drpc_world_manager.cc44 chre_rpc_NumberMessage> &reader) { in Add() argument
45 RpcWorldManagerSingleton::get()->addStart(reader); in Add()
168 chre_rpc_NumberMessage> &reader) { in addStart() argument
170 reader.set_on_next([](const chre_rpc_NumberMessage &request) { in addStart()
173 reader.set_on_completion_requested([]() { in addStart()
180 mAddReader = std::move(reader); in addStart()
/system/nvram/core/
Dpersistence.cpp69 ProtoReader reader(&stream); in DecodeObject() local
70 if (!reader.ReadWireTag() || reader.field_number() != magic || in DecodeObject()
71 reader.wire_type() != WireType::kLengthDelimited || in DecodeObject()
72 !proto::detail::MessageDecoder<Object>::Decode(*object, &reader)) { in DecodeObject()
/system/update_engine/aosp/
Dlogging_android.cc59 base::DirReaderPosix reader(kLogsRoot.c_str()); in DeleteOldLogs() local
60 if (!reader.IsValid()) { in DeleteOldLogs()
66 while (reader.Next()) { in DeleteOldLogs()
67 if (reader.name()[0] == '.') in DeleteOldLogs()
74 if (sscanf(reader.name(), in DeleteOldLogs()
78 old_logs.push_back(reader.name()); in DeleteOldLogs()
80 LOG(WARNING) << "Unrecognized log file " << reader.name(); in DeleteOldLogs()

1234