/system/extras/simpleperf/ |
D | read_elf.cpp | 53 bool IsValidElfPath(const std::string& filename) { in IsValidElfPath() argument 54 if (!IsRegularFile(filename)) { in IsValidElfPath() 58 FILE* fp = fopen(filename.c_str(), mode.c_str()); in IsValidElfPath() 90 bool GetBuildIdFromNoteFile(const std::string& filename, BuildId* build_id) { in GetBuildIdFromNoteFile() argument 92 if (!android::base::ReadFileToString(filename, &content)) { in GetBuildIdFromNoteFile() 93 LOG(DEBUG) << "can't read note file " << filename; in GetBuildIdFromNoteFile() 97 LOG(DEBUG) << "can't read build_id from note file " << filename; in GetBuildIdFromNoteFile() 146 static BinaryRet OpenObjectFile(const std::string& filename, uint64_t file_offset = 0, in OpenObjectFile() argument 149 FileHelper fhelper = FileHelper::OpenReadOnly(filename); in OpenObjectFile() 151 PLOG(DEBUG) << "failed to open " << filename; in OpenObjectFile() [all …]
|
D | read_elf.h | 24 bool GetBuildIdFromNoteFile(const std::string& filename, BuildId* build_id); 25 bool GetBuildIdFromElfFile(const std::string& filename, BuildId* build_id); 26 bool GetBuildIdFromEmbeddedElfFile(const std::string& filename, uint64_t file_offset, 44 bool ParseSymbolsFromElfFile(const std::string& filename, const BuildId& expected_build_id, 46 bool ParseSymbolsFromEmbeddedElfFile(const std::string& filename, uint64_t file_offset, 50 bool ReadMinExecutableVirtualAddressFromElfFile(const std::string& filename, 54 bool ReadSectionFromElfFile(const std::string& filename, const std::string& section_name, 60 bool IsValidElfPath(const std::string& filename);
|
D | thread_tree.cpp | 84 const std::string& filename) { in AddKernelMap() argument 89 Dso* dso = FindKernelDsoOrNew(filename); in AddKernelMap() 96 Dso* ThreadTree::FindKernelDsoOrNew(const std::string& filename) { in FindKernelDsoOrNew() argument 97 if (filename == DEFAULT_KERNEL_MMAP_NAME) { in FindKernelDsoOrNew() 103 auto it = module_dso_tree_.find(filename); in FindKernelDsoOrNew() 105 module_dso_tree_[filename] = Dso::CreateDso(DSO_KERNEL_MODULE, filename); in FindKernelDsoOrNew() 106 it = module_dso_tree_.find(filename); in FindKernelDsoOrNew() 112 uint64_t time, const std::string& filename) { in AddThreadMap() argument 114 Dso* dso = FindUserDsoOrNew(filename); in AddThreadMap() 121 Dso* ThreadTree::FindUserDsoOrNew(const std::string& filename) { in FindUserDsoOrNew() argument [all …]
|
D | utils.cpp | 59 FileHelper FileHelper::OpenReadOnly(const std::string& filename) { in OpenReadOnly() argument 60 int fd = TEMP_FAILURE_RETRY(open(filename.c_str(), O_RDONLY | O_BINARY)); in OpenReadOnly() 64 FileHelper FileHelper::OpenWriteOnly(const std::string& filename) { in OpenWriteOnly() argument 65 int fd = TEMP_FAILURE_RETRY(open(filename.c_str(), O_WRONLY | O_BINARY | O_CREAT, 0644)); in OpenWriteOnly() 143 bool IsRegularFile(const std::string& filename) { in IsRegularFile() argument 145 if (stat(filename.c_str(), &st) == 0) { in IsRegularFile() 153 uint64_t GetFileSize(const std::string& filename) { in GetFileSize() argument 155 if (stat(filename.c_str(), &st) == 0) { in GetFileSize()
|
/system/update_engine/common/ |
D | prefs.cc | 38 base::FilePath filename; in GetString() local 39 TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename)); in GetString() 40 if (!base::ReadFileToString(filename, value)) { in GetString() 48 base::FilePath filename; in SetString() local 49 TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename)); in SetString() 50 if (!base::DirectoryExists(filename.DirName())) { in SetString() 53 TEST_AND_RETURN_FALSE(base::CreateDirectory(filename.DirName())); in SetString() 55 TEST_AND_RETURN_FALSE(base::WriteFile(filename, value.data(), value.size()) == in SetString() 100 base::FilePath filename; in Exists() local 101 TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename)); in Exists() [all …]
|
/system/vold/ |
D | Loop.cpp | 44 char filename[256]; in dumpState() local 50 sprintf(filename, "/dev/block/loop%d", i); in dumpState() 52 if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) { in dumpState() 54 SLOGE("Unable to open %s (%s)", filename, strerror(errno)); in dumpState() 68 SLOGE("Unable to get loop status for %s (%s)", filename, in dumpState() 73 asprintf(&tmp, "%s %d %lld:%lld %llu %lld:%lld %lld 0x%x {%s} {%s}", filename, li.lo_number, in dumpState() 86 char filename[256]; in lookupActive() local 94 sprintf(filename, "/dev/block/loop%d", i); in lookupActive() 96 if ((fd = open(filename, O_RDWR | O_CLOEXEC)) < 0) { in lookupActive() 98 SLOGE("Unable to open %s (%s)", filename, strerror(errno)); in lookupActive() [all …]
|
/system/core/libcutils/ |
D | sched_policy.c | 109 char* filename; in __initialize() local 113 filename = "/dev/cpuctl/tasks"; in __initialize() 114 fg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); in __initialize() 116 SLOGE("open of %s failed: %s\n", filename, strerror(errno)); in __initialize() 119 filename = "/dev/cpuctl/bg_non_interactive/tasks"; in __initialize() 120 bg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); in __initialize() 122 SLOGE("open of %s failed: %s\n", filename, strerror(errno)); in __initialize() 131 filename = "/dev/cpuset/foreground/tasks"; in __initialize() 132 fg_cpuset_fd = open(filename, O_WRONLY | O_CLOEXEC); in __initialize() 133 filename = "/dev/cpuset/background/tasks"; in __initialize() [all …]
|
/system/extras/tests/sdcard/ |
D | sysutil.cpp | 65 void printErrno(const char *msg, const char *filename) in printErrno() argument 67 fprintf(stderr, "# %s %s %d %s\n", msg, filename, errno, strerror(errno)); in printErrno() 77 int readStringFromFile(const char *filename, char *const start, size_t size, bool must_exist=true) in readStringFromFile() argument 84 int fd = open(filename, O_RDONLY); in readStringFromFile() 90 printErrno("Failed to open", filename); in readStringFromFile() 112 printErrno("Failed to read", filename); in readStringFromFile() 138 fprintf(stderr, "Buffer too small for %s\n", filename); in readStringFromFile() 146 int writeStringToFile(const char *filename, const char *start, bool must_exist=true) in writeStringToFile() argument 148 int fd = open(filename, O_WRONLY); in writeStringToFile() 155 printErrno("Failed to open", filename); in writeStringToFile() [all …]
|
/system/security/keystore/ |
D | keystore.h | 30 const uint8_t* filename; member 70 ResponseCode get(const char* filename, Blob* keyBlob, const BlobType type, uid_t userId); 71 ResponseCode put(const char* filename, Blob* keyBlob, uid_t userId); 72 ResponseCode del(const char* filename, const BlobType type, uid_t userId); 76 void addGrant(const char* filename, uid_t granteeUid); 77 bool removeGrant(const char* filename, uid_t granteeUid); 78 bool hasGrant(const char* filename, const uid_t uid) const { in hasGrant() argument 79 return getGrant(filename, uid) != NULL; in hasGrant() 82 ResponseCode importKey(const uint8_t* key, size_t keyLen, const char* filename, uid_t userId, 127 const grant_t* getGrant(const char* filename, uid_t uid) const; [all …]
|
D | keystore.cpp | 145 android::String8 filename(aliases[i]); in resetUser() local 146 filename = android::String8::format("%s/%s", userState->getUserDirName(), in resetUser() 147 getKeyName(filename).string()); in resetUser() 151 ResponseCode rc = get(filename, &blob, ::TYPE_ANY, userId); in resetUser() 162 del(filename, ::TYPE_ANY, userId); in resetUser() 212 ResponseCode KeyStore::get(const char* filename, Blob* keyBlob, const BlobType type, uid_t userId) { in get() argument 215 keyBlob->readBlob(filename, userState->getDecryptionKey(), userState->getState()); in get() 226 if (upgradeBlob(filename, keyBlob, version, type, userId)) { in get() 227 if ((rc = this->put(filename, keyBlob, userId)) != NO_ERROR || in get() 228 (rc = keyBlob->readBlob(filename, userState->getDecryptionKey(), in get() [all …]
|
D | blob.cpp | 90 ResponseCode Blob::writeBlob(const char* filename, AES_KEY* aes_key, State state, in writeBlob() argument 92 ALOGV("writing blob %s", filename); in writeBlob() 100 ALOGW("Could not read random data for: %s", filename); in writeBlob() 146 if (rename(tmpFileName, filename) == -1) { in writeBlob() 147 ALOGW("could not rename blob to %s: %s", filename, strerror(errno)); in writeBlob() 153 ResponseCode Blob::readBlob(const char* filename, AES_KEY* aes_key, State state) { in readBlob() argument 154 ALOGV("reading blob %s", filename); in readBlob() 155 int in = TEMP_FAILURE_RETRY(open(filename, O_RDONLY)); in readBlob()
|
/system/extras/pagecache/ |
D | pagecache.py | 30 filename, filesize = self._inode_to_filename[(device_number, inode)] 31 if filename not in self._file_pages: 32 self._file_pages[filename] = [1, 0] 34 self._file_pages[filename][0] += 1 38 if filename not in self._file_size: 39 self._file_size[filename] = filesize 43 filename, filesize = self._inode_to_filename[(device_number, inode)] 44 if filename not in self._file_pages: 45 self._file_pages[filename] = [0, 1] 47 self._file_pages[filename][1] += 1 [all …]
|
/system/core/libutils/ |
D | Tokenizer.cpp | 38 Tokenizer::Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, in Tokenizer() argument 40 mFilename(filename), mFileMap(fileMap), in Tokenizer() 52 status_t Tokenizer::open(const String8& filename, Tokenizer** outTokenizer) { in open() argument 56 int fd = ::open(filename.string(), O_RDONLY); in open() 59 ALOGE("Error opening file '%s': %s", filename.string(), strerror(errno)); in open() 64 ALOGE("Error getting size of file '%s': %s", filename.string(), strerror(errno)); in open() 86 ALOGE("Error reading file '%s': %s", filename.string(), strerror(errno)); in open() 95 *outTokenizer = new Tokenizer(filename, fileMap, buffer, ownBuffer, length); in open() 103 status_t Tokenizer::fromContents(const String8& filename, in fromContents() argument 105 *outTokenizer = new Tokenizer(filename, NULL, in fromContents()
|
/system/extras/f2fs_utils/ |
D | make_f2fs_main.c | 45 const char *filename = NULL; in main() local 67 filename = argv[optind++]; in main() 75 if (strcmp(filename, "-")) { in main() 76 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); in main() 88 if (exitcode && strcmp(filename, "-")) in main() 89 unlink(filename); in main()
|
/system/core/gatekeeperd/ |
D | gatekeeperd.cpp | 78 char filename[21]; in store_sid() local 79 sprintf(filename, "%u", uid); in store_sid() 80 int fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR); in store_sid() 82 ALOGE("could not open file: %s: %s", filename, strerror(errno)); in store_sid() 90 const char *filename = ".coldboot"; in mark_cold_boot() local 91 if (access(filename, F_OK) == -1) { in mark_cold_boot() 92 int fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR); in mark_cold_boot() 94 ALOGE("could not open file: %s : %s", filename, strerror(errno)); in mark_cold_boot() 104 char filename[21]; in maybe_store_sid() local 105 sprintf(filename, "%u", uid); in maybe_store_sid() [all …]
|
/system/extras/perfprofd/quipper/ |
D | perf_utils.cc | 122 offset = sizeof(event.mmap) - sizeof(event.mmap.filename) + in GetPerfSampleDataOffset() 123 GetUint64AlignedStringLength(event.mmap.filename); in GetPerfSampleDataOffset() 140 offset = sizeof(event.mmap2) - sizeof(event.mmap2.filename) + in GetPerfSampleDataOffset() 141 GetUint64AlignedStringLength(event.mmap2.filename); in GetPerfSampleDataOffset() 153 bool ReadFileToData(const string& filename, std::vector<char>* data) { in ReadFileToData() argument 154 std::ifstream in(filename.c_str(), std::ios::binary); in ReadFileToData() 156 LOG(ERROR) << "Failed to open file " << filename; in ReadFileToData() 167 LOG(ERROR) << "Error reading from file " << filename; in ReadFileToData() 173 bool WriteDataToFile(const std::vector<char>& data, const string& filename) { in WriteDataToFile() argument 174 std::ofstream out(filename.c_str(), std::ios::binary); in WriteDataToFile()
|
D | perf_utils.h | 39 bool FileToBuffer(const string& filename, std::vector<char>* contents); 42 bool BufferToFile(const string& filename, const CharContainer& contents) { in BufferToFile() argument 43 FILE* fp = fopen(filename.c_str(), "wb"); in BufferToFile() 93 bool FileExists(const string& filename); 97 bool ReadFileToData(const string& filename, std::vector<char>* data); 101 bool WriteDataToFile(const std::vector<char>& data, const string& filename);
|
/system/tools/aidl/ |
D | aidl.cpp | 72 bool check_filename(const std::string& filename, in check_filename() argument 82 if (!IoDelegate::GetAbsolutePath(filename, &fn)) { in check_filename() 130 filename.c_str(), line, name.c_str(), expected.c_str()); in check_filename() 136 bool check_filenames(const std::string& filename, const AidlDocument* doc) { in check_filenames() argument 143 return check_filename(filename, interface->GetPackage(), in check_filenames() 150 success &= check_filename(filename, item->GetPackage(), item->GetName(), in check_filenames() 157 bool gather_types(const std::string& filename, in gather_types() argument 165 return types->AddBinderType(*interface, filename); in gather_types() 168 success &= types->AddParcelableType(*item, filename); in gather_types() 174 int check_types(const string& filename, in check_types() argument [all …]
|
/system/core/toolbox/ |
D | top.c | 97 static int read_stat(char *filename, struct proc_info *proc); 100 static int read_cmdline(char *filename, struct proc_info *proc); 101 static int read_status(char *filename, struct proc_info *proc); 227 char filename[64]; in read_procs() local 261 sprintf(filename, "/proc/%d/stat", pid); in read_procs() 262 read_stat(filename, proc); in read_procs() 264 sprintf(filename, "/proc/%d/cmdline", pid); in read_procs() 265 read_cmdline(filename, proc); in read_procs() 267 sprintf(filename, "/proc/%d/status", pid); in read_procs() 268 read_status(filename, proc); in read_procs() [all …]
|
/system/tpm/attestation/client/ |
D | main.cc | 168 base::FilePath filename(command_line->GetSwitchValueASCII("input")); in ScheduleCommand() local 169 if (!base::ReadFileToString(filename, &input)) { in ScheduleCommand() 170 LOG(ERROR) << "Failed to read file: " << filename.value(); in ScheduleCommand() 182 base::FilePath filename(command_line->GetSwitchValueASCII("input")); in ScheduleCommand() local 183 if (!base::ReadFileToString(filename, &input)) { in ScheduleCommand() 184 LOG(ERROR) << "Failed to read file: " << filename.value(); in ScheduleCommand() 196 base::FilePath filename(command_line->GetSwitchValueASCII("input")); in ScheduleCommand() local 197 if (!base::ReadFileToString(filename, &input)) { in ScheduleCommand() 198 LOG(ERROR) << "Failed to read file: " << filename.value(); in ScheduleCommand() 211 base::FilePath filename(command_line->GetSwitchValueASCII("input")); in ScheduleCommand() local [all …]
|
/system/extras/ext4_utils/ |
D | blk_alloc_to_base_fs.c | 26 static void usage(char *filename) in usage() argument 28 fprintf(stderr, "Usage: %s input_blk_alloc_file output_base_fs_file \n", filename); in usage() 34 char filename[MAX_PATH], file_version[MAX_FILE_VERSION], *spaced_allocs = NULL; in main() local 64 while(fscanf(blk_alloc_file, "%s ", filename) != EOF) { in main() 66 fprintf(base_fs_file, "%s ", filename); in main()
|
/system/core/libsparse/ |
D | simg2simg.c | 52 char filename[4096]; in main() local 92 ret = snprintf(filename, sizeof(filename), "%s.%d", argv[2], i); in main() 93 if (ret >= (int)sizeof(filename)) { in main() 98 out = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0664); in main()
|
/system/sepolicy/tools/sepolicy-analyze/ |
D | utils.c | 25 int load_policy(char *filename, policydb_t * policydb, struct policy_file *pf) in load_policy() argument 32 fd = open(filename, O_RDONLY); in load_policy() 34 fprintf(stderr, "Can't open '%s': %s\n", filename, strerror(errno)); in load_policy() 38 fprintf(stderr, "Can't stat '%s': %s\n", filename, strerror(errno)); in load_policy() 44 fprintf(stderr, "Can't mmap '%s': %s\n", filename, strerror(errno)); in load_policy()
|
/system/core/debuggerd/ |
D | getevent.cpp | 108 char* filename; in read_notify() local 123 filename = devname + strlen(devname); in read_notify() 124 *filename++ = '/'; in read_notify() 129 strcpy(filename, event->name); in read_notify() 145 char* filename; in scan_dir() local 152 filename = devname + strlen(devname); in scan_dir() 153 *filename++ = '/'; in scan_dir() 158 strcpy(filename, de->d_name); in scan_dir()
|
/system/extras/verity/fec/ |
D | image.cpp | 312 bool image_save(const std::string& filename, image *ctx) in image_save() argument 319 int fd = TEMP_FAILURE_RETRY(open(filename.c_str(), in image_save() 323 FATAL("failed to open file '%s: %s'\n", filename.c_str(), in image_save() 386 bool image_ecc_new(const std::string& filename, image *ctx) in image_ecc_new() argument 390 ctx->fec_filename = filename.c_str(); in image_ecc_new() 402 bool image_ecc_load(const std::string& filename, image *ctx) in image_ecc_load() argument 404 int fd = TEMP_FAILURE_RETRY(open(filename.c_str(), O_RDONLY)); in image_ecc_load() 407 FATAL("failed to open file '%s': %s\n", filename.c_str(), in image_ecc_load() 412 FATAL("failed to seek to header in '%s': %s\n", filename.c_str(), in image_ecc_load() 423 filename.c_str(), strerror(errno)); in image_ecc_load() [all …]
|