Re: [PATCH 1/6] perf offcpu: Fix a build failure on old kernels

From: Namhyung Kim
Date: Tue Jun 28 2022 - 12:55:20 EST


On Tue, Jun 28, 2022 at 7:44 AM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> Em Fri, Jun 24, 2022 at 04:13:08PM -0700, Namhyung Kim escreveu:
> > Old kernels have task_struct which contains "state" field and newer
> > kernels have "__state". While the get_task_state() in the BPF code
> > handles that in some way, it assumed the current kernel has the new
> > definition and it caused a build error on old kernels.
> >
> > We should not assume anything and access them carefully. Do not use
> > the task struct directly and access them using new and old definitions
> > in a row.
>
> I added a:
>
> Fixes: edc41a1099c2d08c ("perf record: Enable off-cpu analysis with BPF")
>
> Ok?

Sure, thanks for doing this!
Namhyung