diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/objtool/check.c | 13 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 1 | ||||
-rw-r--r-- | tools/perf/util/unwind-libunwind.c | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index fea222192c57..2c6d74880403 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1371,6 +1371,12 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, func = insn->func; + if (func && insn->ignore) { + WARN_FUNC("BUG: why am I validating an ignored function?", + sec, insn->offset); + return -1; + } + if (insn->visited) { if (!!insn_state_match(insn, &state)) return 1; @@ -1426,16 +1432,19 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, case INSN_JUMP_CONDITIONAL: case INSN_JUMP_UNCONDITIONAL: - if (insn->jump_dest) { + if (insn->jump_dest && + (!func || !insn->jump_dest->func || + func == insn->jump_dest->func)) { ret = validate_branch(file, insn->jump_dest, state); if (ret) return 1; + } else if (func && has_modified_stack_frame(&state)) { WARN_FUNC("sibling call from callable instruction with modified stack frame", sec, insn->offset); return 1; - } /* else it's a sibling call */ + } if (insn->type == INSN_JUMP_UNCONDITIONAL) return 0; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 6f4882f8d61f..87b431886670 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -273,6 +273,7 @@ struct perf_evsel *perf_evsel__new_cycles(void) struct perf_event_attr attr = { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES, + .exclude_kernel = 1, }; struct perf_evsel *evsel; diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c index 6d542a4e0648..8aef572d0889 100644 --- a/tools/perf/util/unwind-libunwind.c +++ b/tools/perf/util/unwind-libunwind.c @@ -50,7 +50,7 @@ int unwind__prepare_access(struct thread *thread, struct map *map, if (!ops) { pr_err("unwind: target platform=%s is not supported\n", arch); - return -1; + return 0; } out_register: unwind__register_ops(thread, ops); |