Lines Matching refs:ds

125 static Dumpstate& ds = Dumpstate::GetInstance();  variable
129 return ds.RunCommand(title, full_command, options, verbose_duration); in RunCommand()
186 if (ds.IsUserConsentDenied()) { \
309 return ds.RunDumpsys(title, dumpsysArgs, options, dumpsysTimeoutMs); in RunDumpsys()
312 return ds.DumpFile(title, path); in DumpFile()
340 const time_t thirty_minutes_ago = ds.now_ - 60 * 30; in GetDumpFds()
410 if (ds.IsZipping() && add_to_zip) { in AddDumps()
411 if (ds.AddZipEntryFromFd(ZIP_ROOT_DIR + name, fd, /* timeout = */ 0ms) != OK) { in AddDumps()
440 if (ds.AddZipEntry(ZIP_ROOT_DIR + path, path)) { in do_mountinfo()
449 if (!ds.IsZipping()) return; in add_mountinfo()
686 if (ds.options_->is_screenshot_copied) { in onReportApproved()
690 if (!ds.options_->do_screenshot || ds.options_->screenshot_fd.get() == -1 || in onReportApproved()
691 !ds.do_early_screenshot_) { in onReportApproved()
695 bool copy_succeeded = android::os::CopyFileToFd(ds.screenshot_path_, in onReportApproved()
696 ds.options_->screenshot_fd.get()); in onReportApproved()
697 ds.options_->is_screenshot_copied = copy_succeeded; in onReportApproved()
699 android::os::UnlinkAndLogOnError(ds.screenshot_path_); in onReportApproved()
790 get_mtime(fd, ds.now_)); in AddZipEntryFromFd()
870 return (ds.AddZipEntryFromFd(ZIP_ROOT_DIR + path, fd) == OK) ? 0 : 1; in _add_file_from_fd()
890 … int32_t err = zip_writer_->StartEntryWithTime(entry_name.c_str(), ZipWriter::kCompress, ds.now_); in AddTextZipEntry()
981 if (!ds.IsZipping()) { in DumpIncidentReport()
986 const std::string path = ds.bugreport_internal_dir_ + "/tmp_incident_report"; in DumpIncidentReport()
1000 ds.AddZipEntry(kProtoPath + "incident_report" + kProtoExt, path); in DumpIncidentReport()
1006 if (!ds.IsZipping()) { in DumpVisibleWindowViews()
1011 const std::string path = ds.bugreport_internal_dir_ + "/tmp_visible_window_views"; in DumpVisibleWindowViews()
1023 ds.AddZipEntry("visible_windows.zip", path); in DumpVisibleWindowViews()
1059ds.AddZipEntry(ZIP_ROOT_DIR + anr_traces_dir + "/traces-just-now.txt", dump_traces_path); in AddAnrTraceDir()
1063 ds.DumpFile("VM TRACES JUST NOW", dump_traces_path); in AddAnrTraceDir()
1074 if (ds.anr_data_.size() > 0) { in AddAnrTraceDir()
1075 AddDumps(ds.anr_data_.begin(), ds.anr_data_.begin() + 1, in AddAnrTraceDir()
1082 AddDumps(ds.anr_data_.begin() + ((add_to_zip) ? 1 : 0), ds.anr_data_.end(), in AddAnrTraceDir()
1090 const bool add_to_zip = ds.IsZipping() && ds.version_ == VERSION_SPLIT_ANR; in AddAnrTraceFiles()
1108 ds.DumpFile("VM TRACES WHEN SLOW", slow_trace_path.c_str()); in AddAnrTraceFiles()
1220 if (!ds.IsZipping()) { in RunDumpsysProto()
1244 status = ds.AddZipEntryFromFd(path, dumpsys.getDumpFd(), service_timeout); in RunDumpsysProto()
1249 ds.zip_writer_->GetLastEntry(&file_entry); in RunDumpsysProto()
1298 if (!ds.IsZipping()) { in DumpHals()
1325 const std::string path = ds.bugreport_internal_dir_ + "/lshal_debug_" + cleanName; in DumpHals()
1343 ds.AddZipEntry("lshal-debug/" + cleanName + ".txt", path); in DumpHals()
1428 printf("== Final progress (pid %d): %d/%d (estimated %d)\n", ds.pid_, ds.progress_->Get(), in DumpstateLimitedOnly()
1429 ds.progress_->GetMax(), ds.progress_->GetInitialMax()); in DumpstateLimitedOnly()
1431 printf("== dumpstate: done (id %d)\n", ds.id_); in DumpstateLimitedOnly()
1499 ds.AddDir("/data/misc/bluetooth/logs", true); in dumpstate()
1501 if (ds.options_->do_screenshot && !ds.do_early_screenshot_) { in dumpstate()
1503 ds.TakeScreenshot(); in dumpstate()
1510 const bool tombstones_dumped = AddDumps(ds.tombstone_data_.begin(), ds.tombstone_data_.end(), in dumpstate()
1550 ds.AddDir(WMTRACE_DATA_DIR, false); in dumpstate()
1553 ds.AddDir(SNAPSHOTCTL_LOG_DIR, false); in dumpstate()
1555 RUN_SLOW_FUNCTION_WITH_CONSENT_CHECK(ds.DumpstateBoard); in dumpstate()
1637 printf("== Final progress (pid %d): %d/%d (estimated %d)\n", ds.pid_, ds.progress_->Get(), in dumpstate()
1638 ds.progress_->GetMax(), ds.progress_->GetInitialMax()); in dumpstate()
1640 printf("== dumpstate: done (id %d)\n", ds.id_); in dumpstate()
1650 ds.AddDir(LINKERCONFIG_DIR, true); in dumpstate()
1673 RUN_SLOW_FUNCTION_WITH_CONSENT_CHECK(ds.DumpTraces, &dump_traces_path); in DumpstateDefaultAfterCritical()
1676 ds.tombstone_data_ = GetDumpFds(TOMBSTONE_DIR, TOMBSTONE_FILE_PREFIX, !ds.IsZipping()); in DumpstateDefaultAfterCritical()
1677 ds.anr_data_ = GetDumpFds(ANR_DIR, ANR_FILE_PREFIX, !ds.IsZipping()); in DumpstateDefaultAfterCritical()
1679 ds.AddDir(RECOVERY_DIR, true); in DumpstateDefaultAfterCritical()
1680 ds.AddDir(RECOVERY_DATA_DIR, true); in DumpstateDefaultAfterCritical()
1681 ds.AddDir(UPDATE_ENGINE_LOG_DIR, true); in DumpstateDefaultAfterCritical()
1682 ds.AddDir(LOGPERSIST_DATA_DIR, false); in DumpstateDefaultAfterCritical()
1684 ds.AddDir(PROFILE_DATA_DIR_CUR, true); in DumpstateDefaultAfterCritical()
1685 ds.AddDir(PROFILE_DATA_DIR_REF, true); in DumpstateDefaultAfterCritical()
1686 ds.AddZipEntry(ZIP_ROOT_DIR + PACKAGE_DEX_USE_LIST, PACKAGE_DEX_USE_LIST); in DumpstateDefaultAfterCritical()
1688 ds.AddDir(PREREBOOT_DATA_DIR, false); in DumpstateDefaultAfterCritical()
1692 ds.AddDir(OTA_METADATA_DIR, true); in DumpstateDefaultAfterCritical()
1733 ds.AddDir(LOGPERSIST_DATA_DIR, false); in DumpstateRadioCommon()
1849 printf("== dumpstate: done (id %d)\n", ds.id_); in DumpstateTelephonyOnly()
1869 printf("== dumpstate: done (id %d)\n", ds.id_); in DumpstateWifiOnly()
1997 paths.emplace_back(StringPrintf("%s/%s", ds.bugreport_internal_dir_.c_str(), in DumpstateBoard()
2151 MYLOGD("dumpstate id %d finished around %s (%ld s)\n", ds.id_, date, in FinishZipFile()
2152 the_real_now_please_stand_up - ds.now_); in FinishZipFile()
2154 if (!ds.AddZipEntry(entry_name, tmp_path_)) { in FinishZipFile()
2165 if (!ds.AddZipEntry("dumpstate_log.txt", ds.log_path_.c_str())) { in FinishZipFile()
2171 if (!redirect_to_existing_file(stderr, const_cast<char*>(ds.log_path_.c_str()))) { in FinishZipFile()
2183 ds.zip_file.reset(nullptr); in FinishZipFile()
2230 MaybeResolveSymlink(&ds.bugreport_internal_dir_); in PrepareToWriteToFile()
2234 ds.base_name_ = StringPrintf("bugreport-%s-%s", device_name.c_str(), build_id.c_str()); in PrepareToWriteToFile()
2235 if (ds.options_->do_add_date) { in PrepareToWriteToFile()
2237 strftime(date, sizeof(date), "%Y-%m-%d-%H-%M-%S", localtime(&ds.now_)); in PrepareToWriteToFile()
2238 ds.name_ = date; in PrepareToWriteToFile()
2240 ds.name_ = "undated"; in PrepareToWriteToFile()
2243 if (ds.options_->telephony_only) { in PrepareToWriteToFile()
2244 ds.base_name_ += "-telephony"; in PrepareToWriteToFile()
2245 } else if (ds.options_->wifi_only) { in PrepareToWriteToFile()
2246 ds.base_name_ += "-wifi"; in PrepareToWriteToFile()
2249 if (ds.options_->do_screenshot) { in PrepareToWriteToFile()
2250 ds.screenshot_path_ = ds.GetPath(ds.CalledByApi() ? "-png.tmp" : ".png"); in PrepareToWriteToFile()
2252 ds.tmp_path_ = ds.GetPath(".tmp"); in PrepareToWriteToFile()
2253 ds.log_path_ = ds.GetPath("-dumpstate_log-" + std::to_string(ds.pid_) + ".txt"); in PrepareToWriteToFile()
2255 std::string destination = ds.CalledByApi() in PrepareToWriteToFile()
2256 ? StringPrintf("[fd:%d]", ds.options_->bugreport_fd.get()) in PrepareToWriteToFile()
2257 : ds.bugreport_internal_dir_.c_str(); in PrepareToWriteToFile()
2265 destination.c_str(), ds.base_name_.c_str(), ds.name_.c_str(), ds.log_path_.c_str(), in PrepareToWriteToFile()
2266 ds.tmp_path_.c_str(), ds.screenshot_path_.c_str()); in PrepareToWriteToFile()
2268 if (ds.options_->do_zip_file) { in PrepareToWriteToFile()
2269 ds.path_ = ds.GetPath(ds.CalledByApi() ? "-zip.tmp" : ".zip"); in PrepareToWriteToFile()
2270 MYLOGD("Creating initial .zip file (%s)\n", ds.path_.c_str()); in PrepareToWriteToFile()
2271 create_parent_dirs(ds.path_.c_str()); in PrepareToWriteToFile()
2272 ds.zip_file.reset(fopen(ds.path_.c_str(), "wb")); in PrepareToWriteToFile()
2273 if (ds.zip_file == nullptr) { in PrepareToWriteToFile()
2274 MYLOGE("fopen(%s, 'wb'): %s\n", ds.path_.c_str(), strerror(errno)); in PrepareToWriteToFile()
2276 ds.zip_writer_.reset(new ZipWriter(ds.zip_file.get())); in PrepareToWriteToFile()
2278 ds.AddTextZipEntry("version.txt", ds.version_); in PrepareToWriteToFile()
2288 if (ds.options_->do_zip_file) { in FinalizeFile()
2289 if (!ds.FinishZipFile()) { in FinalizeFile()
2297 std::string final_path = ds.path_; in FinalizeFile()
2298 if (ds.options_->OutputToCustomFile()) { in FinalizeFile()
2299 final_path = ds.GetPath(ds.options_->out_dir, ".zip"); in FinalizeFile()
2300 android::os::CopyFileToFile(ds.path_, final_path); in FinalizeFile()
2303 if (ds.options_->use_control_socket) { in FinalizeFile()
2305 dprintf(ds.control_socket_fd_, in FinalizeFile()
2308 ds.log_path_.c_str()); in FinalizeFile()
2310 dprintf(ds.control_socket_fd_, "OK:%s\n", final_path.c_str()); in FinalizeFile()
2517 android::os::UnlinkAndLogOnError(ds.bugreport_internal_dir_ + "/" + in Cancel()
2860 return ds.consent_callback_ != nullptr && in IsUserConsentDenied()
2861 ds.consent_callback_->getResult() == UserConsentResult::DENIED; in IsUserConsentDenied()
2865 return ds.options_->bugreport_fd.get() != -1 ? true : false; in CalledByApi()
2957 Dumpstate::RunStatus status = ds.ParseCommandlineAndRun(argc, argv); in run_main()
3177 if (ds.IsUserConsentDenied()) { in __for_each_pid()
3255 if (ds.IsUserConsentDenied()) { in for_each_tid_helper()
3718 ds.DumpFile("RT_TABLES", RT_TABLES_PATH); in dump_route_tables()