Lines Matching refs:c_str
156 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); in Open()
158 MYLOGE("open(%s, %s)\n", path.c_str(), strerror(errno)); in Open()
180 MYLOGD("Going to copy file (%s) to %d\n", input_file.c_str(), out_fd); in CopyFileToFd()
194 if (unlink(file.c_str())) { in UnlinkAndLogOnError()
195 MYLOGE("Failed to unlink file (%s): %s\n", file.c_str(), strerror(errno)); in UnlinkAndLogOnError()
204 MYLOGE("Cannot open file: %s\n", file_path.c_str()); in IsFileEmpty()
220 MYLOGE("Failed to retrieve module metadata package name: %s", status.toString8().c_str()); in GetModuleMetadataVersion()
223 MYLOGD("Module metadata package name: %s", package_name.c_str()); in GetModuleMetadataVersion()
225 status = package_service->getVersionCodeForPackage(android::String16(package_name.c_str()), in GetModuleMetadataVersion()
228 MYLOGE("Failed to retrieve module metadata version: %s", status.toString8().c_str()); in GetModuleMetadataVersion()
282 std::unique_ptr<DIR, decltype(&closedir)> dump_dir(opendir(dir_path.c_str()), closedir); in GetDumpFds()
285 MYLOGW("Unable to open directory %s: %s\n", dir_path.c_str(), strerror(errno)); in GetDumpFds()
303 … TEMP_FAILURE_RETRY(open(abs_path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW | O_NONBLOCK))); in GetDumpFds()
305 MYLOGW("Unable to open dump file %s: %s\n", abs_path.c_str(), strerror(errno)); in GetDumpFds()
311 MYLOGW("Unable to stat dump file %s: %s\n", abs_path.c_str(), strerror(errno)); in GetDumpFds()
316 MYLOGI("Excluding stale dump file: %s\n", abs_path.c_str()); in GetDumpFds()
351 MYLOGE("Unable to add %s to zip file, lseek failed: %s\n", name.c_str(), in AddDumps()
357 MYLOGE("Unable to add %s to zip file, addZipEntryFromFd failed\n", name.c_str()); in AddDumps()
360 dump_file_from_fd(type_name, name.c_str(), fd); in AddDumps()
399 MYLOGD("%s: %d entries added to zip file\n", title.c_str(), (int)mount_points.size()); in add_mountinfo()
715 log_id_t id = android_name_to_log_id(buffer.c_str()); in logcat_timeout()
765 printf("Build: %s\n", build.c_str()); in PrintHeader()
767 printf("Build fingerprint: '%s'\n", fingerprint.c_str()); in PrintHeader()
768 printf("Bootloader: %s\n", bootloader.c_str()); in PrintHeader()
769 printf("Radio: %s\n", radio.c_str()); in PrintHeader()
770 printf("Network: %s\n", network.c_str()); in PrintHeader()
782 printf("Bugreport format version: %s\n", version_.c_str()); in PrintHeader()
784 PropertiesHelper::IsDryRun(), options_->args.c_str(), options_->extra_options.c_str()); in PrintHeader()
800 entry_name.c_str()); in AddZipEntryFromFd()
812 MYLOGI("Renaming entry %s to %s\n", entry_name.c_str(), valid_name.c_str()); in AddZipEntryFromFd()
818 int32_t err = zip_writer_->StartEntryWithTime(valid_name.c_str(), ZipWriter::kCompress, in AddZipEntryFromFd()
821 MYLOGE("zip_writer_->StartEntryWithTime(%s): %s\n", valid_name.c_str(), in AddZipEntryFromFd()
853 entry_name.c_str(), strerror(errno)); in AddZipEntryFromFd()
857 entry_name.c_str(), strerror(errno), timeout.count()); in AddZipEntryFromFd()
866 MYLOGE("read(%s): %s\n", entry_name.c_str(), strerror(errno)); in AddZipEntryFromFd()
888 TEMP_FAILURE_RETRY(open(entry_path.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC))); in AddZipEntry()
890 MYLOGE("open(%s): %s\n", entry_path.c_str(), strerror(errno)); in AddZipEntry()
904 MYLOGD("Not adding dir %s because it's not a zipped bugreport\n", dir.c_str()); in AddDir()
907 MYLOGD("Adding dir %s (recursive: %d)\n", dir.c_str(), recursive); in AddDir()
909 dump_files("", dir.c_str(), recursive ? skip_none : is_dir, _add_file_from_fd); in AddDir()
915 entry_name.c_str()); in AddTextZipEntry()
918 MYLOGD("Adding zip text entry %s\n", entry_name.c_str()); in AddTextZipEntry()
919 … int32_t err = zip_writer_->StartEntryWithTime(entry_name.c_str(), ZipWriter::kCompress, ds.now_); in AddTextZipEntry()
921 MYLOGE("zip_writer_->StartEntryWithTime(%s): %s\n", entry_name.c_str(), in AddTextZipEntry()
926 err = zip_writer_->WriteBytes(content.c_str(), content.length()); in AddTextZipEntry()
928 MYLOGE("zip_writer_->WriteBytes(%s): %s\n", entry_name.c_str(), in AddTextZipEntry()
1007 anr_traces_dir.c_str()); in AddAnrTraceDir()
1040 printf("*** NO ANRs to dump in %s\n\n", ANR_DIR.c_str()); in AddAnrTraceDir()
1059 if (stat(slow_trace_path.c_str(), &st)) { in AddAnrTraceFiles()
1063 ds.DumpFile("VM TRACES WHEN SLOW", slow_trace_path.c_str()); in AddAnrTraceFiles()
1087 printf("------ BLOCK STAT (%s) ------\n", new_path.c_str()); in DumpBlockStatFiles()
1088 dump_files("", new_path.c_str(), skip_not_stat, dump_stat_from_fd); in DumpBlockStatFiles()
1123 path.append(" - ").append(String8(service).c_str()); in RunDumpsysTextByPriority()
1142 MYLOGE("*** command '%s' timed out after %llums\n", title.c_str(), in RunDumpsysTextByPriority()
1154 dprintf(STDOUT_FILENO, "------ %s (/system/bin/dumpsys) ------\n", title.c_str()); in RunDumpsysText()
1164 dprintf(STDOUT_FILENO, "------ %s (/system/bin/dumpsys) ------\n", title.c_str()); in RunDumpsysTextNormalPriority()
1179 MYLOGD("Not dumping %s because it's not a zipped bugreport\n", title.c_str()); in RunDumpsysProto()
1193 path.append(String8(service).c_str()); in RunDumpsysProto()
1215 MYLOGE("*** command '%s' timed out after %llums\n", title.c_str(), in RunDumpsysProto()
1290 TEMP_FAILURE_RETRY(open(path.c_str(), in DumpHals()
1294 MYLOGE("Could not open %s to dump additional hal information.\n", path.c_str()); in DumpHals()
1308 unlink(path.c_str()); in DumpHals()
1397 printf("*** NO TOMBSTONES to dump in %s\n\n", TOMBSTONE_DIR.c_str()); in dumpstate()
1689 memcpy(file_name_buf.get(), temp_file_pattern.c_str(), buf_size); in DumpTraces()
1748 } else if (should_dump_native_traces(exe.c_str()) || hal_pids.find(pid) != hal_pids.end()) { in DumpTraces()
1807 paths.emplace_back(StringPrintf("%s/%s", ds.bugreport_internal_dir_.c_str(), in DumpstateBoard()
1808 kDumpstateBoardFiles[i].c_str())); in DumpstateBoard()
1833 MYLOGI("Calling IDumpstateDevice implementation using path %s\n", paths[i].c_str()); in DumpstateBoard()
1836 open(paths[i].c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW, in DumpstateBoard()
1839 MYLOGE("Could not open file %s: %s\n", paths[i].c_str(), strerror(errno)); in DumpstateBoard()
1853 MYLOGE("dumpstateBoard failed: %s\n", status.description().c_str()); in DumpstateBoard()
1882 MYLOGE("Failed to fstat %s: %s\n", kDumpstateBoardFiles[i].c_str(), in DumpstateBoard()
1895 MYLOGE("Ignoring empty %s\n", kDumpstateBoardFiles[i].c_str()); in DumpstateBoard()
1933 MYLOGD("Adding main entry (%s) from %s to .zip bugreport\n", entry_name.c_str(), in FinishZipFile()
1934 tmp_path_.c_str()); in FinishZipFile()
1953 if (!ds.AddZipEntry("dumpstate_log.txt", ds.log_path_.c_str())) { in FinishZipFile()
1959 if (!redirect_to_existing_file(stderr, const_cast<char*>(ds.log_path_.c_str()))) { in FinishZipFile()
1973 MYLOGD("Removing temporary file %s\n", tmp_path_.c_str()) in FinishZipFile()
1980 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(filepath.c_str(), O_RDONLY | O_NONBLOCK in SHA256_file_hash()
1983 MYLOGE("open(%s): %s\n", filepath.c_str(), strerror(errno)); in SHA256_file_hash()
1996 MYLOGE("read(%s): %s\n", filepath.c_str(), strerror(errno)); in SHA256_file_hash()
2057 ds.base_name_ = StringPrintf("bugreport-%s-%s", device_name.c_str(), build_id.c_str()); in PrepareToWriteToFile()
2080 : ds.bugreport_internal_dir_.c_str(); in PrepareToWriteToFile()
2088 destination.c_str(), ds.base_name_.c_str(), ds.name_.c_str(), ds.log_path_.c_str(), in PrepareToWriteToFile()
2089 ds.tmp_path_.c_str(), ds.screenshot_path_.c_str()); in PrepareToWriteToFile()
2093 MYLOGD("Creating initial .zip file (%s)\n", ds.path_.c_str()); in PrepareToWriteToFile()
2094 create_parent_dirs(ds.path_.c_str()); in PrepareToWriteToFile()
2095 ds.zip_file.reset(fopen(ds.path_.c_str(), "wb")); in PrepareToWriteToFile()
2097 MYLOGE("fopen(%s, 'wb'): %s\n", ds.path_.c_str(), strerror(errno)); in PrepareToWriteToFile()
2117 if (std::regex_match(name.c_str(), valid_regex)) { in FinalizeFile()
2120 MYLOGE("invalid suffix provided by user: %s\n", name.c_str()); in FinalizeFile()
2124 MYLOGI("changing suffix from %s to %s\n", ds.name_.c_str(), name.c_str()); in FinalizeFile()
2128 if (rename(ds.screenshot_path_.c_str(), new_screenshot_path.c_str())) { in FinalizeFile()
2129 MYLOGE("rename(%s, %s): %s\n", ds.screenshot_path_.c_str(), in FinalizeFile()
2130 new_screenshot_path.c_str(), strerror(errno)); in FinalizeFile()
2147 MYLOGD("Renaming zip file from %s to %s\n", ds.path_.c_str(), new_path.c_str()); in FinalizeFile()
2148 if (rename(ds.path_.c_str(), new_path.c_str())) { in FinalizeFile()
2149 MYLOGE("rename(%s, %s): %s\n", ds.path_.c_str(), new_path.c_str(), in FinalizeFile()
2159 MYLOGD("Generating .txt bugreport at %s from %s\n", ds.path_.c_str(), ds.tmp_path_.c_str()); in FinalizeFile()
2160 if (rename(ds.tmp_path_.c_str(), ds.path_.c_str())) { in FinalizeFile()
2161 MYLOGE("rename(%s, %s): %s\n", ds.tmp_path_.c_str(), ds.path_.c_str(), strerror(errno)); in FinalizeFile()
2170 ds.log_path_.c_str()); in FinalizeFile()
2172 dprintf(ds.control_socket_fd_, "OK:%s\n", ds.path_.c_str()); in FinalizeFile()
2181 MYLOGI("Final bugreport path: %s\n", ds.path_.c_str()); in SendBugreportFinishedBroadcast()
2304 MYLOGE("Unknown extra option: %s\n", extra_options.c_str()); in getBugreportModeFromProperty()
2329 MYLOGD("notification (title: %s, description: %s)\n", options->notification_title.c_str(), in SetOptionsFromProperties()
2330 options->notification_description.c_str()); in SetOptionsFromProperties()
2349 MYLOGI("extra_options: %s\n", options.extra_options.c_str()); in LogDumpOptions()
2350 MYLOGI("args: %s\n", options.args.c_str()); in LogDumpOptions()
2351 MYLOGI("notification_title: %s\n", options.notification_title.c_str()); in LogDumpOptions()
2352 MYLOGI("notification_description: %s\n", options.notification_description.c_str()); in LogDumpOptions()
2523 version_.c_str(), VERSION_DEFAULT.c_str(), VERSION_CURRENT.c_str(), in RunInternal()
2524 VERSION_SPLIT_ANR.c_str()); in RunInternal()
2535 android::String16 package(calling_package.c_str()); in RunInternal()
2545 ? android::base::StringPrintf("%s/dumpstate-stats.txt", bugreport_internal_dir_.c_str()) in RunInternal()
2571 MYLOGI("dumpstate info: id=%d, args='%s', extra_options= %s)\n", id_, options_->args.c_str(), in RunInternal()
2572 options_->extra_options.c_str()); in RunInternal()
2574 MYLOGI("bugreport format version: %s\n", version_.c_str()); in RunInternal()
2612 dprintf(control_socket_fd_, "BEGIN:%s\n", path_.c_str()); in RunInternal()
2639 if (chown(path_.c_str(), AID_SHELL, AID_SHELL)) { in RunInternal()
2640 MYLOGE("Unable to change ownership of zip file %s: %s\n", path_.c_str(), in RunInternal()
2650 if (!redirect_to_file(stderr, const_cast<char*>(log_path_.c_str()))) { in RunInternal()
2653 if (chown(log_path_.c_str(), AID_SHELL, AID_SHELL)) { in RunInternal()
2654 MYLOGE("Unable to change ownership of dumpstate log file %s: %s\n", log_path_.c_str(), in RunInternal()
2665 if (!redirect_to_file(stdout, const_cast<char*>(tmp_path_.c_str()))) { in RunInternal()
2668 if (chown(tmp_path_.c_str(), AID_SHELL, AID_SHELL)) { in RunInternal()
2670 tmp_path_.c_str(), strerror(errno)); in RunInternal()