kpatch-build: Rename fentry instances to func_profiling

symbol->has_fentry_call is x86 specfic. Rename it to more
generic name, representing the general idea of calling
profiling function at function entry.

This patch converts all instance of symbol->has_fentry_call
to symbol->has_func_profiling and also renames functions:
kpatch_check_fentry_calls() -> kpatch_check_func_profiling_calls()
kpatch_find_fentry_calls() -> kpatch_find_func_profiling_calls()

Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
This commit is contained in:
Kamalesh Babulal 2017-05-27 01:32:31 -04:00
parent afafc239e5
commit c9e4230d88
3 changed files with 11 additions and 11 deletions

View File

@ -1014,7 +1014,7 @@ static void kpatch_replace_sections_syms(struct kpatch_elf *kelf)
log_debug("\n"); log_debug("\n");
} }
static void kpatch_check_fentry_calls(struct kpatch_elf *kelf) static void kpatch_check_func_profiling_calls(struct kpatch_elf *kelf)
{ {
struct symbol *sym; struct symbol *sym;
int errs = 0; int errs = 0;
@ -1022,8 +1022,8 @@ static void kpatch_check_fentry_calls(struct kpatch_elf *kelf)
list_for_each_entry(sym, &kelf->symbols, list) { list_for_each_entry(sym, &kelf->symbols, list) {
if (sym->type != STT_FUNC || sym->status != CHANGED) if (sym->type != STT_FUNC || sym->status != CHANGED)
continue; continue;
if (!sym->twin->has_fentry_call) { if (!sym->twin->has_func_profiling) {
log_normal("function %s has no fentry call, unable to patch\n", log_normal("function %s has no fentry/mcount call, unable to patch\n",
sym->name); sym->name);
errs++; errs++;
} }
@ -2294,7 +2294,7 @@ static void kpatch_create_mcount_sections(struct kpatch_elf *kelf)
nr = 0; nr = 0;
list_for_each_entry(sym, &kelf->symbols, list) list_for_each_entry(sym, &kelf->symbols, list)
if (sym->type == STT_FUNC && sym->status != SAME && if (sym->type == STT_FUNC && sym->status != SAME &&
sym->has_fentry_call) sym->has_func_profiling)
nr++; nr++;
/* create text/rela section pair */ /* create text/rela section pair */
@ -2308,8 +2308,8 @@ static void kpatch_create_mcount_sections(struct kpatch_elf *kelf)
if (sym->type != STT_FUNC || sym->status == SAME) if (sym->type != STT_FUNC || sym->status == SAME)
continue; continue;
if (!sym->has_fentry_call) { if (!sym->has_func_profiling) {
log_debug("function %s has no fentry call, no mcount record is needed\n", log_debug("function %s has no fentry/mcount call, no mcount record is needed\n",
sym->name); sym->name);
continue; continue;
} }
@ -2533,7 +2533,7 @@ int main(int argc, char *argv[])
*/ */
kpatch_mark_ignored_sections(kelf_patched); kpatch_mark_ignored_sections(kelf_patched);
kpatch_compare_correlated_elements(kelf_patched); kpatch_compare_correlated_elements(kelf_patched);
kpatch_check_fentry_calls(kelf_patched); kpatch_check_func_profiling_calls(kelf_patched);
kpatch_elf_teardown(kelf_base); kpatch_elf_teardown(kelf_base);
kpatch_elf_free(kelf_base); kpatch_elf_free(kelf_base);

View File

@ -350,7 +350,7 @@ void kpatch_create_symbol_list(struct kpatch_elf *kelf)
} }
/* Check which functions have fentry calls; save this info for later use. */ /* Check which functions have fentry calls; save this info for later use. */
static void kpatch_find_fentry_calls(struct kpatch_elf *kelf) static void kpatch_find_func_profiling_calls(struct kpatch_elf *kelf)
{ {
struct symbol *sym; struct symbol *sym;
struct rela *rela; struct rela *rela;
@ -364,7 +364,7 @@ static void kpatch_find_fentry_calls(struct kpatch_elf *kelf)
strcmp(rela->sym->name, "__fentry__")) strcmp(rela->sym->name, "__fentry__"))
continue; continue;
sym->has_fentry_call = 1; sym->has_func_profiling = 1;
} }
} }
@ -405,7 +405,7 @@ struct kpatch_elf *kpatch_elf_open(const char *name)
kpatch_create_rela_list(kelf, sec); kpatch_create_rela_list(kelf, sec);
} }
kpatch_find_fentry_calls(kelf); kpatch_find_func_profiling_calls(kelf);
return kelf; return kelf;
} }

View File

@ -79,7 +79,7 @@ struct symbol {
int include; /* used in the patched elf */ int include; /* used in the patched elf */
int strip; /* used in the output elf */ int strip; /* used in the output elf */
}; };
int has_fentry_call; int has_func_profiling;
}; };
struct rela { struct rela {