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 X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEDE4C07E95 for ; Tue, 13 Jul 2021 15:11:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B6F86128B for ; Tue, 13 Jul 2021 15:11:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B6F86128B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2ay9IzAmmv1Nl2mAg3shNPDkOWykbV5KBpbBzZ8SfIk=; b=nc9Ti/6UgmJ2ec tIYoc1xpqjwyMrnC/p4636EVJTP6BDAj0hC/TIveAkpPVsDJ6uuEk3ekl+vaQ+gcLQRdPkbkVLRvF HH8IwGkoNTtVOKbT/hSnNDXfkjUG0+6Vs6nq++aPAo9ZC/egI2HgAWvKMrFKte8fHFhO0qxV2tjDA 7shEsMunPmvBwGXMyCAQLsCPHPEuDdI9JUkHCEaHW0Cv/axxCEWVTGqq/vy4O8es7IvxOHZTZfBVf vQ6PJ/j5oAeKFx8ELwanUjAvLq8Wwm5is5Tq+NuxOE55QKKTmXY6CMBZ5EBY6yb0bdes+mztoCYcF 7FBMsJ8Z9u5ndxZqdtQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3K2y-00AkSH-HQ; Tue, 13 Jul 2021 15:10:08 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3K2u-00AkRJ-B7 for linux-arm-kernel@lists.infradead.org; Tue, 13 Jul 2021 15:10:05 +0000 Received: by mail-pg1-x536.google.com with SMTP id s18so21881412pgg.8 for ; Tue, 13 Jul 2021 08:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PEphENIqEyKhL/8vOm7zNFilpyK8f33jXcN4DaEjc2E=; b=EXAEe4csOT80SdiCKNgHT46eobGgV+YDBtIe6/u3Xo/HmTQzWh9Jnlvm9qir8OwFn+ 4tpn2xXg9AtU3lQdLMQ/VlqUUoIFOjOd1Wdw5pm++nZ5RhbW9EST/nrGI193qtA1yqnz mCMEdYx94mnWQuORAMH6hOKXzJ3TnLWpgSxL8zcYLNGGEHFYYkZ+eh4EbE5SXWdhy4nD 4c16wHM+TmuYQjW6nZu0T3y0bfOH63x1sKzwqraybKWRJSHsxi2NDvme9u6DvFBcmV8u n25GWTLim5sa/vfKX7CsQCR29vK9mXLEWP8eBIuu8nyG9lFOikQp3/XX+yDJaxtQyzwu Hggw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PEphENIqEyKhL/8vOm7zNFilpyK8f33jXcN4DaEjc2E=; b=bQ8juQZFjEA0iG93AaNDHd+uSxwbRTI8Tt4VI17INikmrtxxtjjJfbEmCcWE2Bh7MH W02q5I+TGsPkGYEk79mCJA5qC6+se/tW1/ZczUcE62Jp7K3ESsB0QDKDFUpEKTUj7qq0 i6iYkOFMloQ7ycephjAwtOaaSdRzY9BvT7KfW77mD9nFuJZJNmvjkt94xZ58vtiKkk4G YPGbEsY9xLBoKiaqY4bktwVReVfUxvxTN3jR7sJIlolobhAJbvsY742ruqJ6MtV6C6Qw vTIvEJprEs50L8yg7hpVfBDnQAGM8KRodi4HTrjK/onkHwx/ip4Hl06n4SH6GmSLCDFS rOHA== X-Gm-Message-State: AOAM5303gh7M3Vd+sdHRMXCGrJN+GRsrxy+KkoeFmP63W/6zEs4622zN dqxernOXbYcdWCi+khKs1JdWXQ== X-Google-Smtp-Source: ABdhPJzxFp96daVLCaza1b6Bd52oFmsqwsvCs3ZrC4i9Nzy9ONwlsC6juBrZAzz92R+zlcRktGcHVQ== X-Received: by 2002:a63:f712:: with SMTP id x18mr4689666pgh.389.1626189003407; Tue, 13 Jul 2021 08:10:03 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([202.131.71.237]) by smtp.gmail.com with ESMTPSA id b19sm17409447pjh.29.2021.07.13.08.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 08:10:02 -0700 (PDT) Date: Tue, 13 Jul 2021 23:09:53 +0800 From: Leo Yan To: Arnaldo Carvalho de Melo Cc: Adrian Hunter , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Mathieu Poirier , Suzuki K Poulose , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 10/11] perf env: Set flag for kernel is 64-bit mode Message-ID: <20210713150953.GC748506@leoy-ThinkPad-X240s> References: <20210711104105.505728-1-leo.yan@linaro.org> <20210711104105.505728-11-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210713_081004_458751_91780A19 X-CRM114-Status: GOOD ( 29.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Arnaldo, Adrian, On Mon, Jul 12, 2021 at 03:14:35PM -0300, Arnaldo Carvalho de Melo wrote: > Em Sun, Jul 11, 2021 at 06:41:04PM +0800, Leo Yan escreveu: > > It's useful to know that the kernel is running in 32-bit or 64-bit > > mode. E.g. We can decide if perf tool is running in compat mode > > from this info. > > > > This patch adds a global variable "kernel_is_64_bit", it's initialized > > when a session setups environment, its value is decided by checking the > > architecture string. > > > > Signed-off-by: Leo Yan > > --- > > tools/perf/util/env.c | 17 ++++++++++++++++- > > tools/perf/util/env.h | 1 + > > 2 files changed, 17 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c > > index ebc5e9ad35db..345635a2e842 100644 > > --- a/tools/perf/util/env.c > > +++ b/tools/perf/util/env.c > > @@ -11,6 +11,7 @@ > > #include > > #include > > > > +int kernel_is_64_bit; > > struct perf_env perf_env; > > Why can't this be in 'struct perf_env'? Good question. I considered to add it in struct perf_env but finally I used this way; the reason is this variable "kernel_is_64_bit" is only used during recording phase for AUX ring buffer, and don't use it for report. So seems to me it's over complexity to add a new field and just wander if it's necessary to save this field as new feature in the perf header. Combining the comment from Adrian in another email, I think it's good to add a new field "compat_mode" in the struct perf_env, and this field will be initialized in build-record.c. Currently we don't need to save this value into the perf file, if later we need to use this value for decoding phase, then we can add a new feature item to save "compat_mode" into the perf file's header. If you have any different idea, please let me know. Thanks! Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel