/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/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 …]
|
D | sdcard_perf_test.cpp | 292 char filename[80] = {'\0',}; in readData() local 294 sprintf(filename, "%s/file-%d-%d", kTestDir, idx, getpid()); in readData() 297 int fd = open(filename, O_RDONLY); in readData() 373 char filename[80] = {'\0',}; in testRead() local 375 sprintf(filename, "%s/file-%d-%d", kTestDir, i, testCase->pid()); in testRead() 376 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); in testRead() 419 char filename[80] = {'\0',}; in writeData() local 421 sprintf(filename, "%s/file-%d-%d", kTestDir, idx, getpid()); in writeData() 423 int fd = open(filename, O_RDWR | O_CREAT, S_IRWXU); // no O_TRUNC, see header comment in writeData() 533 char filename[80] = {'\0',}; in testOpenCreate() local [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/simpleperf/ |
D | read_elf.cpp | 63 bool GetBuildIdFromNoteFile(const std::string& filename, BuildId* build_id) { in GetBuildIdFromNoteFile() argument 65 if (!android::base::ReadFileToString(filename, &content)) { in GetBuildIdFromNoteFile() 66 LOG(DEBUG) << "can't read note file " << filename; in GetBuildIdFromNoteFile() 70 LOG(DEBUG) << "can't read build_id from note file " << filename; in GetBuildIdFromNoteFile() 95 bool GetBuildIdFromElfFile(const std::string& filename, BuildId* build_id) { in GetBuildIdFromElfFile() argument 96 auto owning_binary = llvm::object::createBinary(llvm::StringRef(filename)); in GetBuildIdFromElfFile() 98 PLOG(DEBUG) << "can't open file " << filename; in GetBuildIdFromElfFile() 109 PLOG(DEBUG) << "unknown elf format in file " << filename; in GetBuildIdFromElfFile() 113 PLOG(DEBUG) << "can't read build_id from file " << filename; in GetBuildIdFromElfFile()
|
D | cmd_record.cpp | 267 std::string filename = module_mmap.filepath; in DumpKernelAndModuleMmaps() local 268 if (filename.empty()) { in DumpKernelAndModuleMmaps() 269 filename = "[" + module_mmap.name + "]"; in DumpKernelAndModuleMmaps() 272 module_mmap.len, 0, filename); in DumpKernelAndModuleMmaps() 329 for (auto& filename : hit_kernel_modules) { in DumpBuildIdFeature() local 330 if (filename == DEFAULT_KERNEL_MMAP_NAME) { in DumpBuildIdFeature() 338 std::string module_name = basename(&filename[0]); in DumpBuildIdFeature() 346 build_id_records.push_back(CreateBuildIdRecord(true, UINT_MAX, build_id, filename)); in DumpBuildIdFeature() 350 for (auto& filename : hit_user_files) { in DumpBuildIdFeature() local 351 if (filename == DEFAULT_EXECNAME_FOR_THREAD_MMAP) { in DumpBuildIdFeature() [all …]
|
D | record.cpp | 178 filename = p; in MmapRecord() 179 p += ALIGN(filename.size() + 1, 8); in MmapRecord() 187 PrintIndented(indent, "pgoff 0x%" PRIx64 ", filename %s\n", data.pgoff, filename.c_str()); in DumpData() 195 strcpy(p, filename.c_str()); in BinaryFormat() 196 p += ALIGN(filename.size() + 1, 8); in BinaryFormat() 312 filename = p; in BuildIdRecord() 313 p += ALIGN(filename.size() + 1, 64); in BuildIdRecord() 324 PrintIndented(indent, "filename %s\n", filename.c_str()); in DumpData() 334 strcpy(p, filename.c_str()); in BinaryFormat() 335 p += ALIGN(filename.size() + 1, 64); in BinaryFormat() [all …]
|
D | record_equal_test.h | 19 ASSERT_EQ(r1.filename, r2.filename); in CheckMmapRecordDataEqual() 30 ASSERT_EQ(r1.filename, r2.filename); in CheckBuildIdRecordDataEqual()
|
D | record_file.cpp | 36 const std::string& filename, const perf_event_attr& event_attr, in CreateInstance() argument 38 FILE* fp = fopen(filename.c_str(), "web+"); in CreateInstance() 40 PLOG(ERROR) << "failed to open record file '" << filename << "'"; in CreateInstance() 44 auto writer = std::unique_ptr<RecordFileWriter>(new RecordFileWriter(filename, fp)); in CreateInstance() 51 RecordFileWriter::RecordFileWriter(const std::string& filename, FILE* fp) in RecordFileWriter() argument 52 : filename_(filename), in RecordFileWriter() 165 hit_kernel_set.insert(m_record.filename); in GetHitModulesInBuffer() 174 hit_user_set.insert(m_record.filename); in GetHitModulesInBuffer() 321 std::unique_ptr<RecordFileReader> RecordFileReader::CreateInstance(const std::string& filename) { in CreateInstance() argument 322 int fd = open(filename.c_str(), O_RDONLY | O_CLOEXEC); in CreateInstance() [all …]
|
/system/extras/f2fs_utils/ |
D | make_f2fs_main.c | 42 const char *filename = NULL; in main() local 64 filename = argv[optind++]; in main() 72 if (strcmp(filename, "-")) { in main() 73 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); in main() 85 if (exitcode && strcmp(filename, "-")) in main() 86 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/core/base/ |
D | test_utils.cpp | 32 unlink(filename); in ~TemporaryFile() 36 snprintf(filename, sizeof(filename), "%s/TemporaryFile-XXXXXX", tmp_dir); in init() 37 fd = mkstemp(filename); in init()
|
D | file_test.cpp | 49 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.filename)) << errno; in TEST() 51 ASSERT_TRUE(android::base::ReadFileToString(tf.filename, &s)) << errno; in TEST() 58 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.filename, 0660, in TEST() 62 ASSERT_EQ(0, stat(tf.filename, &sb)); in TEST() 67 ASSERT_TRUE(android::base::ReadFileToString(tf.filename, &s)) << errno; in TEST() 104 ASSERT_TRUE(android::base::ReadFileToString(tf.filename, &s)) << errno; in TEST()
|
/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/core/libcutils/ |
D | sched_policy.c | 103 char* filename; in __initialize() local 107 filename = "/dev/cpuctl/tasks"; in __initialize() 108 fg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); in __initialize() 110 SLOGE("open of %s failed: %s\n", filename, strerror(errno)); in __initialize() 113 filename = "/dev/cpuctl/bg_non_interactive/tasks"; in __initialize() 114 bg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); in __initialize() 116 SLOGE("open of %s failed: %s\n", filename, strerror(errno)); in __initialize() 125 filename = "/dev/cpuset/foreground/tasks"; in __initialize() 126 fg_cpuset_fd = open(filename, O_WRONLY | O_CLOEXEC); in __initialize() 127 filename = "/dev/cpuset/background/tasks"; in __initialize() [all …]
|
/system/core/toolbox/ |
D | top.c | 96 static int read_stat(char *filename, struct proc_info *proc); 99 static int read_cmdline(char *filename, struct proc_info *proc); 100 static int read_status(char *filename, struct proc_info *proc); 225 char filename[64]; in read_procs() local 259 sprintf(filename, "/proc/%d/stat", pid); in read_procs() 260 read_stat(filename, proc); in read_procs() 262 sprintf(filename, "/proc/%d/cmdline", pid); in read_procs() 263 read_cmdline(filename, proc); in read_procs() 265 sprintf(filename, "/proc/%d/status", pid); in read_procs() 266 read_status(filename, proc); in read_procs() [all …]
|
/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/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/cpustats/ |
D | cpustats.c | 57 static int get_cpu_count_from_file(char *filename); 187 static int get_cpu_count_from_file(char *filename) { in get_cpu_count_from_file() argument 192 file = fopen(filename, "r"); in get_cpu_count_from_file() 193 if (!file) die("Could not open %s\n", filename); in get_cpu_count_from_file() 194 if (!fgets(line, MAX_BUF_SIZE, file)) die("Could not get %s contents\n", filename); in get_cpu_count_from_file() 205 die("Unexpected input in file %s (%s).\n", filename, line); in get_cpu_count_from_file() 214 char filename[MAX_BUF_SIZE]; in get_freq_scales_count() local 218 sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", cpu); in get_freq_scales_count() 219 file = fopen(filename, "r"); in get_freq_scales_count() 220 if (!file) die("Could not open %s\n", filename); in get_freq_scales_count() [all …]
|
/system/extras/ext4_utils/ |
D | make_ext4fs_main.c | 66 const char *filename = NULL; in main() local 215 filename = argv[optind++]; in main() 229 if (strcmp(filename, "-")) { in main() 230 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); in main() 244 if (exitcode && strcmp(filename, "-")) in main() 245 unlink(filename); in main()
|
/system/extras/libpagemap/ |
D | pm_process.c | 35 char filename[MAX_FILENAME]; in pm_process_create() local 48 error = snprintf(filename, MAX_FILENAME, "/proc/%d/pagemap", pid); in pm_process_create() 55 proc->pagemap_fd = open(filename, O_RDONLY); in pm_process_create() 178 char filename[MAX_FILENAME]; in pm_process_workingset() local 199 error = snprintf(filename, MAX_FILENAME, "/proc/%d/clear_refs", in pm_process_workingset() 205 fd = open(filename, O_WRONLY); in pm_process_workingset() 245 char filename[MAX_FILENAME]; in read_maps() local 260 error = snprintf(filename, MAX_FILENAME, "/proc/%d/maps", proc->pid); in read_maps() 266 maps_f = fopen(filename, "r"); in read_maps()
|
/system/core/init/ |
D | bootchart.cpp | 125 char filename[32]; in do_log_procs() local 129 snprintf(filename, sizeof(filename), "/proc/%d/cmdline", pid); in do_log_procs() 131 android::base::ReadFileToString(filename, &cmdline); in do_log_procs() 135 snprintf(filename, sizeof(filename), "/proc/%d/stat", pid); in do_log_procs() 137 if (android::base::ReadFileToString(filename, &stat)) { in do_log_procs()
|
/system/core/logd/ |
D | LogCommand.cpp | 74 char filename[1024]; in clientHasLogCredentials() local 75 snprintf(filename, sizeof(filename), "/proc/%d/status", cli->getPid()); in clientHasLogCredentials() 77 FILE *file = fopen(filename, "r"); in clientHasLogCredentials()
|
/system/bt/osi/src/ |
D | config.c | 84 config_t *config_new(const char *filename) { in config_new() argument 85 assert(filename != NULL); in config_new() 91 FILE *fp = fopen(filename, "rt"); in config_new() 93 LOG_ERROR("%s unable to open file '%s': %s", __func__, filename, strerror(errno)); in config_new() 276 bool config_save(const config_t *config, const char *filename) { in config_save() argument 278 assert(filename != NULL); in config_save() 279 assert(*filename != '\0'); in config_save() 294 const int filename_len = strlen(filename); in config_save() 297 snprintf(temp_filename, temp_filename_len, "%s%s", filename, temp_file_ext); in config_save() 300 char *temp_dirname = osi_strdup(filename); in config_save() [all …]
|