aboutsummaryrefslogtreecommitdiff
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorGravatar Peter Zijlstra <peterz@infradead.org> 2020-03-12 09:26:29 +0100
committerGravatar Peter Zijlstra <peterz@infradead.org> 2020-03-25 18:28:28 +0100
commit1e11f3fdc326d7466e43185ea943b6156143387c (patch)
tree5a4ee402d9becc5691eef8b30cde9aff8fc31d0b /tools/objtool/check.c
parentobjtool: Optimize find_symbol_by_index() (diff)
downloadlinux-1e11f3fdc326d7466e43185ea943b6156143387c.tar.gz
linux-1e11f3fdc326d7466e43185ea943b6156143387c.tar.bz2
linux-1e11f3fdc326d7466e43185ea943b6156143387c.zip
objtool: Add a statistics mode
Have it print a few numbers which can be used to size the hashtables. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lkml.kernel.org/r/20200324160924.321381240@infradead.org
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 43f7d3c2e8b2..6df1bae2f961 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -239,6 +239,7 @@ static int decode_instructions(struct objtool_file *file)
struct symbol *func;
unsigned long offset;
struct instruction *insn;
+ unsigned long nr_insns = 0;
int ret;
for_each_sec(file, sec) {
@@ -274,6 +275,7 @@ static int decode_instructions(struct objtool_file *file)
hash_add(file->insn_hash, &insn->hash, insn->offset);
list_add_tail(&insn->list, &file->insn_list);
+ nr_insns++;
}
list_for_each_entry(func, &sec->symbol_list, list) {
@@ -291,6 +293,9 @@ static int decode_instructions(struct objtool_file *file)
}
}
+ if (stats)
+ printf("nr_insns: %lu\n", nr_insns);
+
return 0;
err: