From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FC26C433EF for ; Tue, 28 Jun 2022 16:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232927AbiF1QzN (ORCPT ); Tue, 28 Jun 2022 12:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234149AbiF1Qyf (ORCPT ); Tue, 28 Jun 2022 12:54:35 -0400 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F2262B268; Tue, 28 Jun 2022 09:52:40 -0700 (PDT) Received: by mail-oi1-f181.google.com with SMTP id q11so17938546oih.10; Tue, 28 Jun 2022 09:52:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E648dBFHTDJv9vUh9mhheRk7gXIcU15BjfaY5SWNU/4=; b=gSOVjOcaZjALmK5EbfhepRESzg4GXINUrjHEeizQpL7tEMR01Fpqo/0q9LiBDhPxjX 7FoTvZhsbl8QY9p66GREDRk1O92ugUyTjYH+QjUSX3EpIIG9322ru9vWy8ZgkCw0vfAE Cy2gLMtYI3WUUBD64a6VsoRSPjMke93xJt0GqfZQjAG+ZYK8eAilDLZHaB9pmrMRNuU0 Kp0zRpUJxraFtu0xJMnHHGD3q4ZFLWTGV0ENtljaPzrZAJRvmWZ5nZiOiyDvHxabd4kX Whsi7Z1bUSvinvIhyTN4mQ0Qhbd9bgMvL5Em4piMmIsX6BsqCQ5Qp8tkMtqQ32frgKtG /XBQ== X-Gm-Message-State: AJIora9iM6tLltSP80PZLveZ4OwdsovipQY1RTXzxjnmmdOkw4grTvZD AUcfnCodqQKbbuVF40rhZ1eW6HWtVDMad2ZLq7M= X-Google-Smtp-Source: AGRyM1sbCijzlGmpKPdegGoOMfsLP5Ed4vha/ePGdTsixV1iBn+35ReKPUl0TQoX1sPRdZ7ta5gDOyitlr+H1Ui4kzg= X-Received: by 2002:aca:bb56:0:b0:32f:2160:bfd8 with SMTP id l83-20020acabb56000000b0032f2160bfd8mr402430oif.92.1656435159732; Tue, 28 Jun 2022 09:52:39 -0700 (PDT) MIME-Version: 1.0 References: <20220624231313.367909-1-namhyung@kernel.org> <20220624231313.367909-2-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 28 Jun 2022 09:52:28 -0700 Message-ID: Subject: Re: [PATCH 1/6] perf offcpu: Fix a build failure on old kernels To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , linux-perf-users , Song Liu , Hao Luo , Milian Wolff , bpf , Blake Jones Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Tue, Jun 28, 2022 at 7:44 AM Arnaldo Carvalho de Melo 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