Lines Matching refs:error
220 std::string error; in MergeWith() local
227 LockedFile::Open(filename.c_str(), flags, /*block=*/false, &error); in MergeWith()
230 LOG(WARNING) << "Couldn't lock the profile file " << filename << ": " << error; in MergeWith()
236 ProfileLoadStatus status = LoadInternal(fd, &error); in MergeWith()
241 LOG(WARNING) << "Could not load profile data from file " << filename << ": " << error; in MergeWith()
247 std::string error; in Load() local
262 LockedFile::Open(filename.c_str(), flags, /*block=*/false, &error); in Load()
265 LOG(WARNING) << "Couldn't lock the profile file " << filename << ": " << error; in Load()
271 ProfileLoadStatus status = LoadInternal(fd, &error); in Load()
279 << filename << ": " << error; in Load()
288 LOG(WARNING) << "Could not load profile data from file " << filename << ": " << error; in Load()
294 std::string error; in Save() local
304 LockedFile::Open(filename.c_str(), flags, /*block=*/false, &error); in Save()
306 LOG(WARNING) << "Couldn't lock the profile file " << filename << ": " << error; in Save()
758 #define READ_UINT(type, buffer, dest, error) \ argument
761 *(error) = "Could not read "#dest; \
772 /*out*/ std::string* error) { in ReadInlineCache() argument
774 READ_UINT(uint16_t, buffer, inline_cache_size, error); in ReadInlineCache()
778 READ_UINT(uint16_t, buffer, dex_pc, error); in ReadInlineCache()
779 READ_UINT(uint8_t, buffer, dex_to_classes_map_size, error); in ReadInlineCache()
793 *error = "Cannot read profile index"; in ReadInlineCache()
796 READ_UINT(uint8_t, buffer, dex_classes_size, error); in ReadInlineCache()
798 *error = "dex_profile_index out of bounds "; in ReadInlineCache()
799 *error += std::to_string(dex_profile_index) + " " + std::to_string(number_of_dex_files); in ReadInlineCache()
804 READ_UINT(uint16_t, buffer, type_index, error); in ReadInlineCache()
824 /*out*/std::string* error) { in ReadMethods() argument
827 *error += "Profile EOF reached prematurely for ReadMethod"; in ReadMethods()
838 READ_UINT(uint16_t, buffer, diff_with_last_method_index, error); in ReadMethods()
849 error)) { in ReadMethods()
855 *error += "Profile data inconsistent for ReadMethods"; in ReadMethods()
863 /*out*/std::string* error) { in ReadClasses() argument
866 *error += "Profile EOF reached prematurely for ReadClasses"; in ReadClasses()
873 READ_UINT(uint16_t, buffer, diff_with_last_class_index, error); in ReadClasses()
888 *error += "Profile data inconsistent for ReadClasses"; in ReadClasses()
933 /*out*/ std::string* error) { in Fill() argument
936 return source.Read(buffer, byte_count, debug_stage, error); in Fill()
956 /*out*/std::string* error) { in ReadProfileHeader() argument
963 ProfileLoadStatus status = safe_buffer_version.Fill(source, "ReadProfileHeaderVersion", error); in ReadProfileHeader()
969 *error = "Profile missing magic"; in ReadProfileHeader()
973 *error = "Cannot read profile version"; in ReadProfileHeader()
979 *error = "Profile version mismatch"; in ReadProfileHeader()
989 status = safe_buffer_header_data.Fill(source, "ReadProfileHeaderData", error); in ReadProfileHeader()
995 *error = "Cannot read the number of dex files"; in ReadProfileHeader()
999 *error = "Cannot read the size of uncompressed data"; in ReadProfileHeader()
1003 *error = "Cannot read the size of compressed data"; in ReadProfileHeader()
1012 /*out*/std::string* error) { in ReadProfileLineHeaderElements() argument
1013 READ_UINT(uint16_t, buffer, *profile_key_size, error); in ReadProfileLineHeaderElements()
1014 READ_UINT(uint16_t, buffer, line_header->class_set_size, error); in ReadProfileLineHeaderElements()
1015 READ_UINT(uint32_t, buffer, line_header->method_region_size_bytes, error); in ReadProfileLineHeaderElements()
1016 READ_UINT(uint32_t, buffer, line_header->checksum, error); in ReadProfileLineHeaderElements()
1017 READ_UINT(uint32_t, buffer, line_header->num_method_ids, error); in ReadProfileLineHeaderElements()
1024 /*out*/std::string* error) { in ReadProfileLineHeader() argument
1026 *error += "Profile EOF reached prematurely for ReadProfileLineHeader"; in ReadProfileLineHeader()
1031 if (!ReadProfileLineHeaderElements(buffer, &profile_key_size, line_header, error)) { in ReadProfileLineHeader()
1036 *error = "ProfileKey has an invalid size: " + in ReadProfileLineHeader()
1042 *error += "Profile EOF reached prematurely for ReadProfileHeaderDexLocation"; in ReadProfileLineHeader()
1058 /*out*/std::string* error) { in ReadProfileLine() argument
1063 *error = "Error when reading profile file line header: checksum mismatch for " in ReadProfileLine()
1068 if (!ReadMethods(buffer, number_of_dex_files, line_header, dex_profile_index_remap, error)) { in ReadProfileLine()
1073 if (!ReadClasses(buffer, line_header, error)) { in ReadProfileLine()
1081 *error += "Profile EOF reached prematurely for ReadProfileHeaderDexLocation"; in ReadProfileLine()
1095 std::string error; in Load() local
1097 ProfileLoadStatus status = LoadInternal(fd, &error, merge_classes, filter_fn); in Load()
1102 LOG(WARNING) << "Error when reading profile: " << error; in Load()
1203 /*out*/ std::string* error) { in OpenSource() argument
1209 ZipArchive::OpenFromFd(DupCloexec(fd), "profile", error)); in OpenSource()
1211 *error = "Could not open the profile zip archive"; in OpenSource()
1214 std::unique_ptr<ZipEntry> zip_entry(zip_archive->Find(kDexMetadataProfileEntry, error)); in OpenSource()
1225 *error = "Empty profile entry in the zip archive."; in OpenSource()
1231 kDexMetadataProfileEntry, "profile file", error, alignof(ProfileSource)); in OpenSource()
1246 std::string* error) { in Read() argument
1259 *error += "Profile EOF reached prematurely for " + debug_stage; in Read()
1262 *error += "Profile IO error for " + debug_stage + strerror(errno); in Read()
1293 std::string* error, in LoadInternal() argument
1300 ProfileLoadStatus status = OpenSource(fd, &source, error); in LoadInternal()
1320 error); in LoadInternal()
1340 status = source->Read(compressed_data.get(), compressed_data_size, "ReadContent", error); in LoadInternal()
1342 *error += "Unable to read compressed profile data"; in LoadInternal()
1347 *error += "Unexpected data in the profile file."; in LoadInternal()
1359 *error += "Error reading uncompressed profile data"; in LoadInternal()
1369 status = ReadProfileLineHeader(uncompressed_data, &line_header, error); in LoadInternal()
1397 error); in LoadInternal()
1406 *error = "Unexpected content in the profile file: " + in LoadInternal()