Linux Power Management development
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: mingo@redhat.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, rafael@kernel.org, viresh.kumar@linaro.org,
	mathieu.desnoyers@efficios.com, paulmck@kernel.org,
	hannes@cmpxchg.org, surenb@google.com
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	tj@kernel.org, masahiroy@kernel.org
Subject: Re: [PATCH] sched: Make clangd usable
Date: Mon, 26 May 2025 11:04:35 +0200	[thread overview]
Message-ID: <20250526090435.GD31726@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250526085943.GQ39944@noisy.programming.kicks-ass.net>

On Mon, May 26, 2025 at 10:59:43AM +0200, Peter Zijlstra wrote:
> On Fri, May 23, 2025 at 06:43:48PM +0200, Peter Zijlstra wrote:
> 
> > Setting up clangd on the kernel source is a giant pain in the arse
> > (this really should be improved), but once you do manage, you run into
> > dumb stuff like the above.
> 
> Given Steve asked for an emacs lsp plugin, I'm guessing he's going to be
> wanting this part too.
> 
> The way I got clangd working is something like:
> 
> 
> $ mkdir clangd-build
> $ make O=clangd-build allmodconfig
> $ make O=clangd-build LLVM=-19 -j128
> $ cd clangd-build
> $ ../scripts/clang-tools/gen_compile_commands.py
> $ sed -i "s'randomize-layout-seed-file=\.'randomize-layout-seed-file=$PWD'g" compile_commands.json
> $ cd -
> $ ln -s clang-build/compile_commands.json 
> 
> I then also have:
> 
> $ cat .clangd
> # https://clangd.llvm.org/config
> CompileFlags:
>   Add: -ferror-limit=0
> Diagnostics:
>   ClangTidy:
>     Remove: bugprone-sizeof-expression
>   UnusedIncludes: None
> Completion:
>   HeaderInsertion: Never
> $
> 
> 
> This has you sit on about 10G of build output, and while it is very
> tempting to do make clean on clangd-build, this will in fact ruin
> things. You can however manually delete all the compiler output, just
> not the various generated files.
> 
> I've not been annoyed enough to (or out of diskspace enough) to go stare
> at fixing the Makefiles to make all this easier. But ideally it would be
> possible to do a no-op build to just generate the .cmd files without
> doing any actual compiling -- building allmodconfig is slow, doubly so
> with allmodconfig.

.. with clang -- gcc is still significantly faster; and I know there's a
k.org clang build optimized for kernels, however I seem to end up using
either distro builds or custom builds, neither of which are having
whatever goodness the k.org build has.

> Or maybe this is already possible and I just didn't find the magic
> incantations.

  reply	other threads:[~2025-05-26  9:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 16:43 [PATCH] sched: Make clangd usable Peter Zijlstra
2025-05-23 16:48 ` Tejun Heo
2025-05-23 18:19   ` Tejun Heo
2025-05-23 21:02   ` Andrea Righi
2025-05-23 16:49 ` Peter Zijlstra
2025-05-23 18:09   ` Steven Rostedt
2025-05-26  7:41     ` Peter Zijlstra
2025-05-26  8:11 ` Ingo Molnar
2025-05-26  8:59 ` Peter Zijlstra
2025-05-26  9:04   ` Peter Zijlstra [this message]
2025-05-26 11:44   ` Peter Zijlstra
2025-05-26 14:49 ` Juri Lelli

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=20250526090435.GD31726@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=surenb@google.com \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vschneid@redhat.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