/system/libufdt/tests/src/ |
D | ufdt_gen_test_dts.c | 76 static void output_header(FILE *fp, int is_plugin) { in output_header() argument 77 fprintf(fp, "/dts-v1/;\n"); in output_header() 79 fprintf(fp, "/plugin/;\n"); in output_header() 81 fprintf(fp, "\n"); in output_header() 84 static void output_root_begin(FILE *fp, int depth) { in output_root_begin() argument 85 fprintf(fp, "/ {\n"); in output_root_begin() 89 fprintf(fp, "level%d {\n", i); in output_root_begin() 93 static void output_root_end(FILE *fp, int depth) { in output_root_end() argument 96 fprintf(fp, "};\n"); in output_root_end() 99 fprintf(fp, "};\n\n"); in output_root_end() [all …]
|
D | util.c | 25 static char *load_file_contents(FILE *fp, size_t *len_ptr) { in load_file_contents() argument 27 fseek(fp, 0, SEEK_END); in load_file_contents() 28 size_t len = ftell(fp); in load_file_contents() 29 fseek(fp, 0, SEEK_SET); in load_file_contents() 36 if (fread(buf, len, 1, fp) != 1) { in load_file_contents() 49 FILE *fp = fopen(filename, "r"); in load_file() local 50 if (!fp) { in load_file() 54 char *buf = load_file_contents(fp, len_ptr); in load_file() 56 fclose(fp); in load_file()
|
/system/bt/gd/os/linux_generic/ |
D | files.cc | 34 void HandleError(const std::string& temp_path, int* dir_fd, FILE** fp) { in HandleError() argument 38 if (*fp) { in HandleError() 39 fclose(*fp); in HandleError() 40 *fp = nullptr; in HandleError() 129 FILE* fp = std::fopen(temp_path.c_str(), "wt"); in WriteToFile() local 130 if (!fp) { in WriteToFile() 132 HandleError(temp_path, &dir_fd, &fp); in WriteToFile() 136 if (std::fprintf(fp, "%s", data.c_str()) < 0) { in WriteToFile() 138 HandleError(temp_path, &dir_fd, &fp); in WriteToFile() 143 if (std::fflush(fp) != 0) { in WriteToFile() [all …]
|
/system/core/logcat/tests/ |
D | logcat_test.cpp | 79 FILE* fp; in TEST() local 91 ASSERT_TRUE(NULL != (fp = popen(logcat_executable in TEST() 100 while (fgets(buffer, sizeof(buffer), fp)) { in TEST() 111 pclose(fp); in TEST() 119 FILE* fp; in TEST() local 134 ASSERT_TRUE(NULL != (fp = popen(command.c_str(), "r"))); in TEST() 140 while (fgets(buffer, sizeof(buffer), fp)) { in TEST() 144 pclose(fp); in TEST() 184 FILE* fp; in TEST() local 199 … (fp = popen(logcat_executable " -v long -v year -b all -t 3 2>/dev/null", "r"))); in TEST() [all …]
|
D | logcat_benchmark.cpp | 26 FILE* fp; in BM_logcat_sorted_order() local 30 fp = popen( in BM_logcat_sorted_order() 33 if (!fp) return; in BM_logcat_sorted_order() 83 while (fgets(buffer, sizeof(buffer), fp)) { in BM_logcat_sorted_order() 109 pclose(fp); in BM_logcat_sorted_order()
|
/system/bt/gd/dumpsys/bundler/ |
D | bundler.cc | 123 void WriteHeaderFile(FILE* fp, const uint8_t* data, size_t data_len) { in WriteHeaderFile() argument 124 assert(fp != nullptr); in WriteHeaderFile() 146 fp, in WriteHeaderFile() 152 …namespaces.begin(), namespaces.end(), [fp](const std::string& s) { fprintf(fp, "namespace %s {\n",… in WriteHeaderFile() 154 fp, in WriteHeaderFile() 158 for_each(namespaces.crbegin(), namespaces.crend(), [fp](const std::string& s) { in WriteHeaderFile() 159 fprintf(fp, "} // namespace %s\n", s.c_str()); in WriteHeaderFile() 162 fp, in WriteHeaderFile() 168 fprintf(fp, " 0x%02x", data[i]); in WriteHeaderFile() 170 fprintf(fp, ","); in WriteHeaderFile() [all …]
|
D | test.cc | 31 int WriteHeaderFile(FILE* fp, const uint8_t* data, size_t data_len); 74 FILE* fp = fopen("/tmp/test.h", "w+"); in TEST_F() local 75 ASSERT_NE(fp, nullptr); in TEST_F() 76 WriteHeaderFile(fp, data.data(), data.size()); in TEST_F() 77 fseek(fp, 0L, SEEK_SET); in TEST_F() 79 fread(buf, 1, 15, fp); in TEST_F() 83 fclose(fp); in TEST_F()
|
/system/extras/simpleperf/ |
D | SampleDisplayer.h | 115 void operator()(FILE* fp, const SampleT* sample) { in operator() 121 fprintf(fp, "%s[skipped in brief callgraph mode]\n", prefix.c_str()); in operator() 124 fprintf(fp, "%s|\n", prefix.c_str()); in operator() 125 fprintf(fp, "%s-- %s\n", prefix.c_str(), PrintSampleName(sample).c_str()); in operator() 128 DisplayCallGraphEntry(fp, 1, prefix, sample->callchain.children[i], in operator() 134 void DisplayCallGraphEntry(FILE* fp, size_t depth, std::string prefix, in DisplayCallGraphEntry() argument 150 fprintf(fp, "%s\n", prefix.c_str()); in DisplayCallGraphEntry() 154 fprintf(fp, "%s%s%s\n", prefix.c_str(), percentage_s.c_str(), in DisplayCallGraphEntry() 157 fprintf(fp, "%s%*s%s\n", prefix.c_str(), static_cast<int>(percentage_s.size()), "", in DisplayCallGraphEntry() 162 fprintf(fp, "%s|--%.2f%%-- [hit in function]\n", prefix.c_str(), in DisplayCallGraphEntry() [all …]
|
D | cmd_stat.cpp | 127 void CounterSummaries::Show(FILE* fp) { in Show() argument 131 ShowCSV(fp, show_thread, show_cpu); in Show() 133 ShowText(fp, show_thread, show_cpu); in Show() 137 void CounterSummaries::ShowCSV(FILE* fp, bool show_thread, bool show_cpu) { in ShowCSV() argument 140 fprintf(fp, "%s,%d,%d,", s.thread->name.c_str(), s.thread->pid, s.thread->tid); in ShowCSV() 143 fprintf(fp, "%d,", s.cpu); in ShowCSV() 145 fprintf(fp, "%s,%s,%s,(%.0f%%)%s\n", s.readable_count.c_str(), s.Name().c_str(), in ShowCSV() 150 void CounterSummaries::ShowText(FILE* fp, bool show_thread, bool show_cpu) { in ShowText() argument 187 fprintf(fp, "# "); in ShowText() 190 fprintf(fp, "%*s", static_cast<int>(width[i]), titles[i].c_str()); in ShowText() [all …]
|
D | CallChainJoiner.cpp | 177 static bool WriteCallChain(FILE* fp, pid_t pid, pid_t tid, CallChainJoiner::ChainType type, in WriteCallChain() argument 199 if (fwrite(data.data(), size, 1, fp) != 1) { in WriteCallChain() 206 static bool ReadCallChain(FILE* fp, pid_t& pid, pid_t& tid, CallChainJoiner::ChainType& type, in ReadCallChain() argument 209 if (fread(data.data(), data.size(), 1, fp) != 1) { in ReadCallChain() 220 if (fread(data.data(), data.size(), 1, fp) != 1) { in ReadCallChain() 232 static bool ReadCallChainInReverseOrder(FILE* fp, pid_t& pid, pid_t& tid, in ReadCallChainInReverseOrder() argument 237 if (fseek(fp, -4, SEEK_CUR) != 0 || fread(&size, sizeof(size), 1, fp) != 1) { in ReadCallChainInReverseOrder() 242 if (fseek(fp, -static_cast<int>(size), SEEK_CUR) != 0 || in ReadCallChainInReverseOrder() 243 fread(data.data(), data.size(), 1, fp) != 1 || in ReadCallChainInReverseOrder() 244 fseek(fp, -static_cast<int>(data.size()), SEEK_CUR) != 0) { in ReadCallChainInReverseOrder() [all …]
|
/system/core/liblog/tests/ |
D | libc_test.cpp | 29 FILE* fp; in TEST() local 30 ASSERT_TRUE(NULL != (fp = fopen("/dev/pmsg0", "ae"))); in TEST() 32 ASSERT_EQ((size_t)1, fwrite(message, sizeof(message), 1, fp)); in TEST() 33 int fflushReturn = fflush(fp); in TEST() 37 int fcloseReturn = fclose(fp); in TEST()
|
D | log_radio_test.cpp | 94 FILE* fp = popen(buf.c_str(), "re"); in TEST() local 97 if (fp) { in TEST() 98 if (!android::base::ReadFdToString(fileno(fp), &buf)) buf = ""; in TEST() 99 pclose(fp); in TEST()
|
D | log_system_test.cpp | 94 FILE* fp = popen(buf.c_str(), "re"); in TEST() local 97 if (fp) { in TEST() 98 if (!android::base::ReadFdToString(fileno(fp), &buf)) buf = ""; in TEST() 99 pclose(fp); in TEST()
|
/system/update_engine/update_manager/ |
D | real_random_provider.cc | 47 RandomSeedVariable(const string& name, FILE* fp) in RandomSeedVariable() argument 48 : Variable<uint64_t>(name, kVariableModeConst), fp_(fp) {} in RandomSeedVariable() 82 FILE* fp = fopen(kRandomDevice, "r"); in Init() local 83 if (!fp) in Init() 85 var_seed_.reset(new RandomSeedVariable("seed", fp)); in Init()
|
/system/bt/osi/src/ |
D | config.cc | 69 static bool config_parse(FILE* fp, config_t* config); 102 FILE* fp = fopen(filename, "rt"); in config_new() local 103 if (!fp) { in config_new() 109 if (!config_parse(fp, config.get())) { in config_new() 113 fclose(fp); in config_new() 276 FILE* fp = nullptr; in config_save() local 297 fp = fopen(temp_filename.c_str(), "wt"); in config_save() 298 if (!fp) { in config_save() 313 if (fprintf(fp, "%s", serialized.str().c_str()) < 0) { in config_save() 320 if (fflush(fp) < 0) { in config_save() [all …]
|
/system/core/libunwindstack/tools/ |
D | unwind_for_offline.cpp | 77 std::unique_ptr<FILE, decltype(&fclose)> fp(fopen("regs.txt", "w+"), &fclose); in SaveRegs() local 78 if (fp == nullptr) { in SaveRegs() 82 regs->IterateRegisters([&fp](const char* name, uint64_t value) { in SaveRegs() 83 fprintf(fp.get(), "%s: %" PRIx64 "\n", name, value); in SaveRegs() 110 std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(file_name.c_str(), "w+"), &fclose); in SaveStack() local 111 if (fp == nullptr) { in SaveStack() 116 size_t bytes = fwrite(&sp_start, 1, sizeof(sp_start), fp.get()); in SaveStack() 123 bytes = fwrite(buffer.data(), 1, buffer.size(), fp.get()); in SaveStack() 175 std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(info->name.c_str(), "r"), &fclose); in CopyElfFromFile() local 176 if (fp == nullptr) { in CopyElfFromFile() [all …]
|
/system/core/init/ |
D | bootchart.cpp | 82 auto fp = fopen_unique("/data/bootchart/header", "we"); in log_header() local 83 if (!fp) return; in log_header() 84 fprintf(&*fp, "version = Android init 0.8\n"); in log_header() 85 fprintf(&*fp, "title = Boot chart for Android (%s)\n", date); in log_header() 86 fprintf(&*fp, "system.uname = %s %s %s %s\n", uts.sysname, uts.release, uts.version, uts.machine); in log_header() 87 fprintf(&*fp, "system.release = %s\n", fingerprint.c_str()); in log_header() 89 fprintf(&*fp, "system.cpu = %s\n", uts.machine); in log_header() 90 fprintf(&*fp, "system.kernel.options = %s\n", kernel_cmdline.c_str()); in log_header()
|
/system/extras/ioshark/ |
D | compile_ioshark.h | 72 void files_db_write_objects(FILE *fp); 79 int ioshark_write_header(FILE *fp, struct ioshark_header *header); 80 int ioshark_write_file_state(FILE *fp, struct ioshark_file_state *state); 81 int ioshark_write_file_op(FILE *fp, struct ioshark_file_operation *file_op);
|
D | ioshark_bench.c | 54 FILE *fp; member 177 if (ioshark_read_file_state(state->fp, &file_state) != 1) { in create_files() 408 rewind(state->fp); in do_io() 409 if (ioshark_read_header(state->fp, &header) != 1) { in do_io() 420 fseek(state->fp, in do_io() 428 if (ioshark_read_file_op(state->fp, &file_op) != 1) { in do_io() 510 if (ioshark_read_header(state->fp, &header) != 1) { in do_create() 537 FILE *fp; in get_start_end() local 554 fp = fopen(infile, "r"); in get_start_end() 555 if (fp == NULL) { in get_start_end() [all …]
|
D | compile_ioshark_subr.c | 38 files_db_write_objects(FILE *fp) in files_db_write_objects() argument 52 if (ioshark_write_file_state(fp, &st) != 1) { in files_db_write_objects() 218 ioshark_write_header(FILE *fp, struct ioshark_header *header) in ioshark_write_header() argument 223 return fwrite(header, sizeof(struct ioshark_header), 1, fp); in ioshark_write_header() 227 ioshark_write_file_state(FILE *fp, struct ioshark_file_state *state) in ioshark_write_file_state() argument 232 return fwrite(state, sizeof(struct ioshark_file_state), 1, fp); in ioshark_write_file_state() 236 ioshark_write_file_op(FILE *fp, struct ioshark_file_operation *file_op) in ioshark_write_file_op() argument 279 return fwrite(file_op, sizeof(struct ioshark_file_operation), 1, fp); in ioshark_write_file_op()
|
D | ioshark_bench_subr.c | 424 FILE *fp; in read_disk_util_state() local 437 fp = fopen("/proc/uptime", "r"); in read_disk_util_state() 438 if (fgets(line, sizeof(line), fp) == NULL) { in read_disk_util_state() 443 fclose(fp); in read_disk_util_state() 450 fp = fopen("/proc/diskstats", "r"); in read_disk_util_state() 451 while (fgets(line, sizeof(line), fp)) { in read_disk_util_state() 470 fclose(fp); in read_disk_util_state() 482 FILE *fp; in read_cpu_util_state() local 486 fp = fopen("/proc/stat", "r"); in read_cpu_util_state() 487 if (fgets(line, sizeof(line), fp) == NULL) { in read_cpu_util_state() [all …]
|
/system/libziparchive/ |
D | zip_archive_benchmark.cpp | 32 FILE* fp = fdopen(result->fd, "w"); in CreateZip() local 34 ZipWriter writer(fp); in CreateZip() 47 fclose(fp); in CreateZip() 91 FILE* fp = fdopen(file.fd, "w"); in StartAlignedEntry() local 93 ZipWriter writer(fp); in StartAlignedEntry() 107 fclose(fp); in StartAlignedEntry()
|
/system/core/libutils/ |
D | ProcessCallStack.cpp | 53 FILE* fp; in dumpProcessHeader() local 56 if ((fp = fopen(path, "r"))) { in dumpProcessHeader() 57 procName = fgets(procNameBuf, sizeof(procNameBuf), fp); in dumpProcessHeader() 58 fclose(fp); in dumpProcessHeader() 81 FILE* fp; in getThreadName() local 84 if ((fp = fopen(path, "r"))) { in getThreadName() 85 procName = fgets(procNameBuf, sizeof(procNameBuf), fp); in getThreadName() 86 fclose(fp); in getThreadName()
|
/system/memory/libmeminfo/libdmabufinfo/ |
D | dmabufinfo.cpp | 49 auto fp = std::unique_ptr<FILE, decltype(&fclose)>{fopen(fdinfo.c_str(), "re"), fclose}; in ReadDmaBufFdInfo() 50 if (fp == nullptr) { in ReadDmaBufFdInfo() 57 while (getline(&line, &len, fp.get()) > 0) { in ReadDmaBufFdInfo() 169 auto fp = std::unique_ptr<FILE, decltype(&fclose)>{fopen(mapspath.c_str(), "re"), fclose}; in ReadDmaBufMapRefs() 170 if (fp == nullptr) { in ReadDmaBufMapRefs() 199 while (getline(&line, &len, fp.get()) > 0) { in ReadDmaBufMapRefs() 212 auto fp = std::unique_ptr<FILE, decltype(&fclose)>{fopen(path.c_str(), "re"), fclose}; in ReadDmaBufInfo() 213 if (fp == nullptr) { in ReadDmaBufInfo() 221 while (getline(&line, &len, fp.get()) > 0) { in ReadDmaBufInfo()
|
/system/testing/gtest_extras/ |
D | Isolate.cpp | 100 FILE* fp = popen(command.c_str(), "re"); in EnumerateTests() local 102 FILE* fp = popen(command.c_str(), "r"); in EnumerateTests() local 104 if (fp == nullptr) { in EnumerateTests() 120 while (getline(&buffer, &buffer_len, fp) > 0) { in EnumerateTests() 176 if (pclose(fp) == -1) { in EnumerateTests() 673 FILE* fp = fopen(options_.xml_file().c_str(), "w"); in WriteXmlResults() local 674 if (fp == nullptr) { in WriteXmlResults() 688 fputs("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", fp); in WriteXmlResults() 689 fprintf(fp, "<testsuites tests=\"%zu\" failures=\"%zu\" disabled=\"0\" errors=\"0\"", in WriteXmlResults() 691 fprintf(fp, " timestamp=\"%s\" time=\"%.3lf\" name=\"AllTests\">\n", timestamp, in WriteXmlResults() [all …]
|