if (!dso__build_id_filename(dso, filename, sizeof(filename), false)) returntrue;
if (filename__read_build_id(filename, &bid, /*block=*/true) == -1) { if (errno == ENOENT) returnfalse;
pr_warning("Problems with %s file, consider removing it from the cache\n",
filename);
} elseif (memcmp(dso__bid(dso)->data, bid.data, bid.size)) {
pr_warning("Problems with %s file, consider removing it from the cache\n",
filename);
}
if (argc || !(list_files || opts_flag))
usage_with_options(buildid_cache_usage, buildid_cache_options);
perf_debuginfod_setup(&debuginfod);
/* -l is exclusive. It can not be used with other options. */ if (list_files && opts_flag) {
usage_with_options_msg(buildid_cache_usage,
buildid_cache_options, "-l is exclusive.\n");
}
if (ns_id > 0)
nsi = nsinfo__new(ns_id);
if (missing_filename) {
data.path = missing_filename;
data.force = force;
session = perf_session__new(&data, NULL); if (IS_ERR(session)) return PTR_ERR(session);
}
if (symbol__init(session ? perf_session__env(session) : NULL) < 0) goto out;
setup_pager();
if (list_files) {
ret = build_id_cache__show_all(); goto out;
}
if (add_name_list_str) {
list = strlist__new(add_name_list_str, NULL); if (list) {
strlist__for_each_entry(pos, list) if (build_id_cache__add_file(pos->s, nsi)) { if (errno == EEXIST) {
pr_debug("%s already in the cache\n",
pos->s); continue;
}
pr_warning("Couldn't add %s: %s\n",
pos->s, str_error_r(errno, sbuf, sizeof(sbuf)));
}
strlist__delete(list);
}
}
if (remove_name_list_str) {
list = strlist__new(remove_name_list_str, NULL); if (list) {
strlist__for_each_entry(pos, list) if (build_id_cache__remove_file(pos->s, nsi)) { if (errno == ENOENT) {
pr_debug("%s wasn't in the cache\n",
pos->s); continue;
}
pr_warning("Couldn't remove %s: %s\n",
pos->s, str_error_r(errno, sbuf, sizeof(sbuf)));
}
strlist__delete(list);
}
}
if (purge_name_list_str) {
list = strlist__new(purge_name_list_str, NULL); if (list) {
strlist__for_each_entry(pos, list) if (build_id_cache__purge_path(pos->s, nsi)) { if (errno == ENOENT) {
pr_debug("%s wasn't in the cache\n",
pos->s); continue;
}
pr_warning("Couldn't remove %s: %s\n",
pos->s, str_error_r(errno, sbuf, sizeof(sbuf)));
}
strlist__delete(list);
}
}
if (purge_all) { if (build_id_cache__purge_all()) {
pr_warning("Couldn't remove some caches. Error: %s.\n",
str_error_r(errno, sbuf, sizeof(sbuf)));
}
}
if (missing_filename)
ret = build_id_cache__fprintf_missing(session, stdout);
if (update_name_list_str) {
list = strlist__new(update_name_list_str, NULL); if (list) {
strlist__for_each_entry(pos, list) if (build_id_cache__update_file(pos->s, nsi)) { if (errno == ENOENT) {
pr_debug("%s wasn't in the cache\n",
pos->s); continue;
}
pr_warning("Couldn't update %s: %s\n",
pos->s, str_error_r(errno, sbuf, sizeof(sbuf)));
}
strlist__delete(list);
}
}
if (kcore_filename && build_id_cache__add_kcore(kcore_filename, force))
pr_warning("Couldn't add %s\n", kcore_filename);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.