Lines Matching defs:file
4 This file is part of elfutils.
6 This file is free software; you can redistribute it and/or modify
141 "pragma wal_checkpoint = truncate;\n" // clean out any preexisting wal file
142 "pragma journal_size_limit = 0;\n" // limit steady state file (between grooming, which also =truncate's)
147 // Normalization table for interning file names
156 // Track the completion of scanning of a given file & sourcetype at given time
159 " file integer not null,\n"
163 " foreign key (file) references " BUILDIDS "_files(id) on update cascade on delete cascade,\n"
164 " primary key (file, mtime, sourcetype)\n"
170 " file integer not null,\n"
172 " foreign key (file) references " BUILDIDS "_files(id) on update cascade on delete cascade,\n"
174 " primary key (buildid, file, mtime)\n"
176 // Index for faster delete by file identifier
177 "create index if not exists " BUILDIDS "_f_de_idx on " BUILDIDS "_f_de (file, mtime);\n"
181 " file integer not null,\n" // NB: not necessarily entered into _mtime_scanned
183 " foreign key (file) references " BUILDIDS "_files(id) on update cascade on delete cascade,\n"
186 " primary key (buildid, artifactsrc, file, mtime)\n"
192 " file integer not null,\n"
195 " foreign key (file) references " BUILDIDS "_files(id) on update cascade on delete cascade,\n"
198 " primary key (buildid, debuginfo_p, executable_p, file, content, mtime)\n"
200 // Index for faster delete by archive file identifier
201 "create index if not exists " BUILDIDS "_r_de_idx on " BUILDIDS "_r_de (file, mtime);\n"
210 " file integer not null,\n"
213 " foreign key (file) references " BUILDIDS "_files(id) on update cascade on delete cascade,\n"
215 " primary key (content, file, mtime)\n"
222 " where b.id = n.buildid and f0.id = n.file and n.debuginfo_p = 1\n"
226 " where b.id = n.buildid and f0.id = n.file and f1.id = n.content and n.debuginfo_p = 1\n"
233 " where b.id = n.buildid and f0.id = n.file and n.executable_p = 1\n"
237 " where b.id = n.buildid and f0.id = n.file and f1.id = n.content and n.executable_p = 1\n"
244 " where b.id = n.buildid and f0.id = n.file and fs.id = n.artifactsrc\n"
249 " where b.id = sr.buildid and f0.id = sd.file and fsref.id = sde.file and f1.id = sd.content\n"
255 " select 'file d/e' as label,count(*) as quantity from " BUILDIDS "_f_de\n"
256 "union all select 'file s',count(*) from " BUILDIDS "_f_s\n"
332 "pragma wal_checkpoint = truncate;\n" // clean out any preexisting wal file
348 { "scan-file-dir", 'F', NULL, 0, "Enable ELF/DWARF file scanning.", 0 },
372 { "fdcache-mbs", ARGP_KEY_FDCACHE_MBS, "MB", 0, "Maximum total size of archive file fdcache.", 0 },
510 db_path = "file::memory:?cache=shared";
1190 i = ""; // no need to handle "/." complete-path-segment case; we're dealing with file names
1201 i = ""; // no need to handle "/.." complete-path-segment case; we're dealing with file names
1204 // no need to handle these cases; we're dealing with file names
1247 // A map-like class that owns a cache of file descriptors (indexed by
1248 // file / content names).
1250 // If only it could use fd's instead of file names ... but we can't
1533 If found copy the section to a temporary file and return
1534 its file descriptor, otherwise return -1.
1536 The temporary file's mtime will be set to PARENT_MTIME.
1537 B_SOURCE should be a description of the parent file suitable
1573 /* Try to find the section and copy the contents into a separate file. */
1610 /* Create temporary file containing the section. */
1618 throw libc_exception (errno, "cannot create temporary file");
1621 throw libc_exception (errno, "cannot write to temporary file");
1623 /* Set mtime to be the same as the parent file's mtime. */
1626 throw libc_exception (errno, "cannot fstat file");
1663 // file transfer.
1706 inc_metric ("http_responses_total","result","file");
1716 std::string file = b_source0.substr(b_source0.find_last_of("/")+1, b_source0.length());
1720 add_mhd_response_header (r, "X-DEBUGINFOD-FILE", file.c_str());
1723 obatched(clog) << "serving file " << b_source0 << " section=" << section << endl;
1735 // assumption that this matches the dwarf-derived file names too.
1798 << " file " << b_source1 << endl;
1807 string ("fstat archive ") + b_source0 + string (" file ") + b_source1
1831 << " file " << b_source1
1918 // extract this file to a temporary file
1926 throw libc_exception (errno, "cannot create temporary file");
1929 // NB: this can take many uninterruptible seconds for a huge file
1935 throw archive_exception(a, "cannot extract file");
1938 // Set the mtime so the fdcache file mtimes, even prefetched ones,
1947 // NB: now we know we have a complete reusable file; make fdcache
1957 // NB: now we know we have a complete reusable file; make fdcache
1976 << " file " << b_source1 << endl;
1998 break; // assume no chance of better luck around another iteration; no other copies of same file
2002 std::string file = b_source1.substr(b_source1.find_last_of("/")+1, b_source1.length());
2009 add_mhd_response_header (r, "X-DEBUGINFOD-FILE", file.c_str());
2013 << " file " << b_source1
2022 // XXX: rpm/file not found: delete this R entry?
2228 // If a debuginfo file matching BUILDID was found but didn't contain
2368 obatched(clog) << "serving file from upstream debuginfod/cache" << endl;
2824 // extract DW_AT_comp_dir to resolve relative file names
2841 // where the altdebug file cannot be resolved.
2869 // to supply for us to give them the file The comp_dir
2920 // It's not a diagnostic-worthy error for an elf file to lack build-id.
3050 // no need to recheck a file/version we already know
3051 // specifically, no need to elf-begin a file we already determined is non-elf
3069 add_metric ("scanned_bytes_total","source","file",
3071 inc_metric ("scanned_files_total","source","file");
3085 // register this file name in the interning table
3093 // no point storing an elf file without buildid
3135 // throw libc_exception(errno, "fts/file realpath " + srcpath);
3145 obatched(clog) << "recorded buildid=" << buildid << " file=" << srps
3187 obatched(clog) << "recorded buildid=" << buildid << " file=" << rps
3197 // Analyze given archive file of given age; record buildids / exec/debuginfo-ness of its
3277 // extract this file to a temporary file
3285 throw libc_exception (errno, "cannot create temporary file");
3286 unlink (tmppath); // unlink now so OS will release the file as soon as we close the fd
3291 throw archive_exception(a, "cannot extract file");
3308 ps_upsert_files // register this rpm constituent file name in interning table
3315 // NB: we intern each source file once. Once raw, as it
3316 // appears in the DWARF file list coming back from
3384 obatched(clog) << "recorded buildid=" << buildid << " rpm=" << rps << " file=" << fn
3424 // no need to recheck a file/version we already know
3433 // intern the archive file name
3495 // The thread that consumes file names off of the scanq. We hold
3496 // the persistent sqlite_ps's at this level and delegate file/archive
3504 sqlite_ps ps_f_upsert_buildids (db, "file-buildids-intern", "insert or ignore into " BUILDIDS "_buildids VALUES (NULL, ?);");
3505 sqlite_ps ps_f_upsert_files (db, "file-files-intern", "insert or ignore into " BUILDIDS "_files VALUES (NULL, ?);");
3506 sqlite_ps ps_f_upsert_de (db, "file-de-upsert",
3508 "(buildid, debuginfo_p, executable_p, file, mtime) "
3512 sqlite_ps ps_f_upsert_s (db, "file-s-upsert",
3514 "(buildid, artifactsrc, file, mtime) "
3519 sqlite_ps ps_f_query (db, "file-negativehit-find",
3521 "and file = (select id from " BUILDIDS "_files where name = ?) and mtime = ?;");
3522 sqlite_ps ps_f_scan_done (db, "file-scanned",
3523 "insert or ignore into " BUILDIDS "_file_mtime_scanned (sourcetype, file, mtime, size)"
3528 sqlite_ps ps_r_upsert_files (db, "rpm-file-intern", "insert or ignore into " BUILDIDS "_files VALUES (NULL, ?);");
3530 "insert or ignore into " BUILDIDS "_r_de (buildid, debuginfo_p, executable_p, file, mtime, content) values ("
3539 "insert or ignore into " BUILDIDS "_r_sdef (file, mtime, content) values ("
3544 "sourcetype = 'R' and file = (select id from " BUILDIDS "_files where name = ?) and mtime = ?;");
3546 "insert or ignore into " BUILDIDS "_file_mtime_scanned (sourcetype, file, mtime, size)"
3622 // matching files into the file/archive scan queue.
3671 /* Found a file. Convert it to an absolute path, so
3690 inc_metric("traversed_total","type","file-skipped-I");
3692 inc_metric("traversed_total","type","file-skipped-X");
3697 inc_metric("traversed_total","type","file");
3827 "select distinct s.mtime, s.file, f.name from "
3829 "where f.id = s.file");
3831 // R records for the same file, this query would return duplicates if the
3873 obatched(clog) << "groom: stale file=" << filename << " mtime=" << mtime << endl;
3888 // Now that we know which file/mtime tuples are stale, actually do
3898 sqlite_ps files_del_f_de (db, "nuke f_de", "delete from " BUILDIDS "_f_de where file = ? and mtime = ?");
3899 sqlite_ps files_del_r_de (db, "nuke r_de", "delete from " BUILDIDS "_r_de where file = ? and mtime = ?");
3901 "where file = ? and mtime = ?");
4065 // case the same sref (source file name) is in many -debuginfo or
4287 // tables that have file foreign-keys, which is a lot.