mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 4/5] objtool: Add per-function rate limiting for unreachable warnings
Date: Tue, 28 Mar 2023 11:07:44 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.21.2303281104010.14873@pobox.suse.cz> (raw)
In-Reply-To: <b21f7791b30c54cf8c4d0f489decdc4a47a18963.1679932620.git.jpoimboe@kernel.org>

On Mon, 27 Mar 2023, Josh Poimboeuf wrote:

> Unreachable instruction warnings are rate limited to once per object
> file.  That no longer makes sense for vmlinux validation, which might
> have other unreachable instructions lurking in other places.  Change it
> to once per function.
> 
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
>  tools/objtool/check.c               | 4 ++++
>  tools/objtool/include/objtool/elf.h | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 73dd091c0075..67a684225702 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -4557,6 +4557,10 @@ static int validate_reachable_instructions(struct objtool_file *file)
>  		if (insn->visited || ignore_unreachable_insn(file, insn))
>  			continue;
>  
> +		if (insn->sym->warned)
> +			continue;
> +		insn->sym->warned = 1;
> +

Ok

>  		WARN_FUNC("unreachable instruction", insn->sec, insn->offset);
>  		return 1;

But we still return here when an unreachable instruction is encountered 
and warned about. Or maybe I am just misunderstanding the purpose.

If not, would it be better to just collect the number of warnings per 
object as we do elsewhere?

  warnings++;

and then at the end

  return warnings;

Miroslav

  parent reply	other threads:[~2023-03-28  9:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 16:00 [PATCH 0/5] objtool: warning improvements Josh Poimboeuf
2023-03-27 16:00 ` [PATCH 1/5] objtool: Add '--verbose' option for disassembling affected functions Josh Poimboeuf
2023-03-28  8:47   ` Miroslav Benes
2023-03-27 16:00 ` [PATCH 2/5] objtool: Combine '--backtrace' with '--verbose' Josh Poimboeuf
2023-03-28  8:07   ` Peter Zijlstra
2023-03-28 20:19     ` Josh Poimboeuf
2023-03-29  7:25       ` Peter Zijlstra
2023-03-27 16:00 ` [PATCH 3/5] objtool: Remove superfluous dead_end_function() check Josh Poimboeuf
2023-03-27 16:00 ` [PATCH 4/5] objtool: Add per-function rate limiting for unreachable warnings Josh Poimboeuf
2023-03-28  8:11   ` Peter Zijlstra
2023-03-28 20:22     ` Josh Poimboeuf
2023-03-29  7:26       ` Peter Zijlstra
2023-03-28  9:07   ` Miroslav Benes [this message]
2023-03-27 16:00 ` [PATCH 5/5] objtool: Add "missing __noreturn" warning Josh Poimboeuf
2023-03-28  9:10   ` Miroslav Benes
2023-03-29 16:24     ` Josh Poimboeuf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.21.2303281104010.14873@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®