/* * If 'filename' matches a current kernel module, must use a kernel * map. Find the one that already exists.
*/ if (dso && dso__kernel(dso) != DSO_SPACE__USER) {
*map_p = find_module_map(ti->machine, dso);
dso__put(dso); if (!*map_p) {
pr_debug("Failed to find map for current kernel module %s",
filename); return TEST_FAIL;
}
map__get(*map_p); return TEST_OK;
}
dso__put(dso);
/* Create a dummy map at 0x100000 */
*map_p = map__new(ti->machine, 0x100000, 0xffffffff, 0, &dso_id_empty,
PROT_EXEC, /*flags=*/0, filename, ti->thread); if (!*map_p) {
pr_debug("Failed to create map!"); return TEST_FAIL;
}
return TEST_OK;
}
staticint test_dso(struct dso *dso)
{ struct symbol *last_sym = NULL; struct rb_node *nd; int ret = TEST_OK;
/* dso__fprintf() prints all the symbols */ if (verbose > 1)
dso__fprintf(dso, stderr);
for (nd = rb_first_cached(dso__symbols(dso)); nd; nd = rb_next(nd)) { struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
if (sym->type != STT_FUNC && sym->type != STT_GNU_IFUNC) continue;
/* Check for overlapping function symbols */ if (last_sym && sym->start < last_sym->end) {
pr_debug("Overlapping symbols:\n");
symbol__fprintf(last_sym, stderr);
symbol__fprintf(sym, stderr);
ret = TEST_FAIL;
} /* Check for zero-length function symbol */ if (sym->start == sym->end) {
pr_debug("Zero-length symbol:\n");
symbol__fprintf(sym, stderr);
ret = TEST_FAIL;
}
last_sym = sym;
}
ret = create_map(ti, filename, &map); if (ret != TEST_OK) return ret;
dso = map__dso(map);
nr = dso__load(dso, map); if (nr < 0) {
pr_debug("dso__load() failed!\n");
ret = TEST_FAIL; goto out_put;
}
if (nr == 0) {
pr_debug("DSO has no symbols!\n");
ret = TEST_SKIP; goto out_put;
}
ret = test_dso(dso);
/* Module dso is split into many dsos by section */ if (ret == TEST_OK && dso__kernel(dso) != DSO_SPACE__USER)
ret = process_subdivided_dso(ti->machine, dso);
out_put:
map__put(map);
return ret;
}
staticint test__symbols(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ char filename[PATH_MAX]; struct test_info ti; int ret;
ret = init_test_info(&ti); if (ret != TEST_OK) return ret;
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.