core: Allow sizing the loader hash table
For now this will only apply to the dwarf loader, for experimenting as time passes and kernels grow bigger or with more symbols. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
3068ff36b7
commit
ff7bd7083f
|
@ -3042,6 +3042,21 @@ static int dwarf__load_file(struct cus *cus, struct conf_load *conf,
|
||||||
{
|
{
|
||||||
int fd, err;
|
int fd, err;
|
||||||
|
|
||||||
|
if (conf->max_hashtable_bits != 0) {
|
||||||
|
if (conf->max_hashtable_bits > 31)
|
||||||
|
return -E2BIG;
|
||||||
|
|
||||||
|
max_hashtags__bits = conf->max_hashtable_bits;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conf->hashtable_bits != 0) {
|
||||||
|
if (conf->hashtable_bits > max_hashtags__bits)
|
||||||
|
return -E2BIG;
|
||||||
|
|
||||||
|
hashtags__bits = conf->hashtable_bits;
|
||||||
|
} else if (hashtags__bits > max_hashtags__bits)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
elf_version(EV_CURRENT);
|
elf_version(EV_CURRENT);
|
||||||
|
|
||||||
fd = open(filename, O_RDONLY);
|
fd = open(filename, O_RDONLY);
|
||||||
|
|
|
@ -56,6 +56,8 @@ struct conf_load {
|
||||||
bool ignore_alignment_attr;
|
bool ignore_alignment_attr;
|
||||||
bool ignore_inline_expansions;
|
bool ignore_inline_expansions;
|
||||||
bool ignore_labels;
|
bool ignore_labels;
|
||||||
|
uint8_t hashtable_bits;
|
||||||
|
uint8_t max_hashtable_bits;
|
||||||
uint16_t kabi_prefix_len;
|
uint16_t kabi_prefix_len;
|
||||||
const char *kabi_prefix;
|
const char *kabi_prefix;
|
||||||
struct btf *base_btf;
|
struct btf *base_btf;
|
||||||
|
|
Loading…
Reference in New Issue