linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Kees Cook <keescook@chromium.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too
Date: Fri, 22 Oct 2021 13:38:35 +0200	[thread overview]
Message-ID: <YXKiu6U2aK//va1G@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <YXJrtiFgwMCYNAAM@gmail.com>

On Fri, Oct 22, 2021 at 09:43:50AM +0200, Ingo Molnar wrote:
> 
> * Qi Zheng <zhengqi.arch@bytedance.com> wrote:
> 
> > 
> > 
> > On 10/18/21 2:23 PM, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > After merging the tip tree, today's linux-next build (x86_64 allnoconfig)
> > > failed like this:
> > > 
> > > arch/x86/kernel/process.c: In function '__get_wchan':
> > > arch/x86/kernel/process.c:950:2: error: implicit declaration of function 'stack_trace_save_tsk' [-Werror=implicit-function-declaration]
> > >    950 |  stack_trace_save_tsk(p, &entry, 1, 0);
> > >        |  ^~~~~~~~~~~~~~~~~~~~
> > > cc1: some warnings being treated as errors
> > > 
> > > Caused by commit
> > > 
> > >    bc9bbb81730e ("x86: Fix get_wchan() to support the ORC unwinder")
> > > 
> > > stack_trace_save_tsk() requires CONFIG_STACKTRACE which is not set for
> > > this build.
> > 
> > Maybe get_wchan() can be updated to:
> > 
> > unsigned long get_wchan(struct task_struct *p)
> > {
> > #ifdef CONFIG_STACKTRACE
> > 	unsigned long entry = 0;
> > 
> > 	stack_trace_save_tsk(p, &entry, 1, 0);
> > 	return entry;
> > #else /* CONFIG_STACKTRACE */
> > 	return 0;
> > #endif
> > }
> 
> And repeat the same ugliness in every single function that happens to use 
> the stack_trace_save_tsk() API??
> 
> The correct solution is to define stack_trace_save_tsk() in the 
> !CONFIG_STACKTRACE case too, as the patch below does.

That doesn't make sense for x86. We have an unconditional unwinder
present.

I've got these, meant to post them later today:

  https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=sched/wchan

      reply	other threads:[~2021-10-22 11:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  6:23 linux-next: build failure after merge of the tip tree Stephen Rothwell
2021-10-18  6:45 ` Qi Zheng
2021-10-22  7:43   ` [PATCH] stacktrace: Provide stack_trace_save_tsk() stub in the !CONFIG_STACKTRACE case too Ingo Molnar
2021-10-22 11:38     ` Peter Zijlstra [this message]

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=YXKiu6U2aK//va1G@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --cc=zhengqi.arch@bytedance.com \
    /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;
as well as URLs for NNTP newsgroup(s).