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=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 DEEF3C4338F for ; Fri, 23 Jul 2021 07:13:38 +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 AC95E60ED7 for ; Fri, 23 Jul 2021 07:13:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AC95E60ED7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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=/H+UErEAEtzqp73juaCFMzz/SsqtfDnuR9Of3uT7+dg=; b=cBajN/ufLFLVpd 6Ej2RYTkD5Bacgq1o/pEND4XtMefLjlmjJBTxJ7OxabwUb5FxHD/t4tZ1TOtTWTTLkVfobhfuv+Nd xCsnnCaxe9Ti4+n30VGDR+kaCfb2j02DHlV50ylYmIM31D60VRqV2Jnpu3kTE2yvs9/5kDAiSuw2j s5eNliJEBH8bdtVVzF2CgBEfnLpAUqvylzwUSjX4TdPkrNCgMuBjoJPy8vQElz2fkU8JWj6X4q4l2 rbcAVyqQeWBYZmUBhdMJ+5RC52z59pPfon1R+09aSuYaW0vRjCwaJzJpAa+IkpR+ZoDqah+o/It3f GgZSOBtf4emezEZyi2hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6pLy-003efL-HQ; Fri, 23 Jul 2021 07:12:14 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m6pLs-003edL-SK for linux-arm-kernel@lists.infradead.org; Fri, 23 Jul 2021 07:12:10 +0000 Received: by mail-pj1-x102f.google.com with SMTP id j17-20020a17090aeb11b029017613554465so2552562pjz.4 for ; Fri, 23 Jul 2021 00:12:08 -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=B4pG5X92n/pg5azzZDZyLdDsyeHis75paHHHy3/0sK4=; b=hDXynN/MXkoVdK5vfUN2Uq+JsGwfyDkLpdp9vKKyIZm1j7wl6RFjzSJ/U1poKmWBHd ZYHPH/xXHmDteW3YISF2z7Mgt74TEiTPFNcJZRszGwUaTphtOpNPQLKsGrF8GTM/t0bS pUOfFK8dvYQb2CcA0htsXpnXHt3FANpN663kNeyiXFEjhQfffDzCB14WfhLNDskhUghH qSnQ4yYZnKfVntehKgfLOb715qs+npc+DvHBgHcBO3AlneM6E712OA2q/YRaUxdyOLuc 5zpSXpaH9aGM6yQ+imbqvzevn8Y+CJxMhDCpqKLM/w7QIgBWSuXNrE7V3GnRAkRoyo0P IiHA== 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=B4pG5X92n/pg5azzZDZyLdDsyeHis75paHHHy3/0sK4=; b=grFKrewrWwSH/XCyKlZ/s6LfHtt4pIguYZgWrUAbAyjtZ67D6qbKVXKqRaSsfhcK8R nw+XRVxJmJAb0WSEyXS0nZAaE3T8Jt95SyiLB2WP0c8gcxW30TwKLvPWv92Xelu3JJ8Q KAVuW9oNC4K2yHx+M7auGL2tIgHC6efw5ni4QxcRpnN+6gerGCTucxViZlwiP3Cu8dVg z5lAHuQni3LWxMbjyeZPkeCjIDNXcOe1ej6EV/oNzoheRzHoetiWeGCfqmml5bmXuOTr NA9/OiWlMl+FCmvt7zMMhUhFbHjNJCqbryDufwjLO4rXuAjPW+1RExoBo+ubgTWCTOth LMxA== X-Gm-Message-State: AOAM533CmMskdMGpVsTT86va3+e47z4ik5873jgkzOQA84YTpAF9ejAi m/sX0GkwB/Kfq+kHdDkXC/CZ3w== X-Google-Smtp-Source: ABdhPJzltA+1/fGBVtRfH6ySuIQYPXO1zU/U8FHD4pWJ4597K4g8VMOR4HZ+7M//ZFE+V+jEBXf2Bg== X-Received: by 2002:aa7:95a4:0:b029:332:f4e1:1dac with SMTP id a4-20020aa795a40000b0290332f4e11dacmr3154708pfk.34.1627024327574; Fri, 23 Jul 2021 00:12:07 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([202.155.204.36]) by smtp.gmail.com with ESMTPSA id z24sm4971018pju.55.2021.07.23.00.12.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 00:12:06 -0700 (PDT) Date: Fri, 23 Jul 2021 15:11:59 +0800 From: Leo Yan To: Arnaldo Carvalho de Melo Cc: "Hunter, Adrian" , 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: <20210723071159.GF179035@leoy-ThinkPad-X240s> References: <20210711104105.505728-1-leo.yan@linaro.org> <20210711104105.505728-11-leo.yan@linaro.org> <20210713150953.GC748506@leoy-ThinkPad-X240s> 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-20210723_001208_998436_148AE272 X-CRM114-Status: GOOD ( 16.90 ) 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, On Wed, Jul 14, 2021 at 11:00:44AM -0300, Arnaldo Carvalho de Melo wrote: [...] > > So, I wasn't suggesting to add this info to the perf.data file header, > > just to the in-memory 'struct perf_env'. > > > > And also we should avoid unconditionally initializing things that we may > > never need, please structure it as: > > Oops, forgot these: > > > static void perf_env__init_kernel_mode(struct perf_env *env) > > { > > const char *arch = perf_env__raw_arch(env); > > > > if (!strncmp(arch, "x86_64", 6) || !strncmp(arch, "aarch64", 7) || > > !strncmp(arch, "arm64", 5) || !strncmp(arch, "mips64", 6) || > > !strncmp(arch, "parisc64", 8) || !strncmp(arch, "riscv64", 7) || > > !strncmp(arch, "s390x", 5) || !strncmp(arch, "sparc64", 7)) > > kernel_is_64_bit = 1; > env->kernel_is_64_bit = 1; > > else > > kernel_is_64_bit = 0; > env->kernel_is_64_bit = 0; > > } > > > > > > void perf_env__init(struct perf_env *env) > > { > > ... > > env->kernel_is_64_bit = -1; > > ... > > } > > > > bool perf_env__kernel_is_64_bit(struct perf_env *env) > > { > > if (env->kernel_is_64_bit == -1) > > perf_env__init_kernel_mode(env); > > > > return env->kernel_is_64_bit; > > } Thanks a lot for the suggestion; this is much clear for me, will spin new patch set by following it. Sorry for slow response due to my bandwidth was occupied by a task in hand. Thanks, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel