Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3956595pxp; Wed, 23 Mar 2022 08:45:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUuXPDgypXSWzvUxmIO7PdQR5UBMfghE7Y3ulWGFB2ih4D3F1vbCV+V+j962De/tJOBeQG X-Received: by 2002:a17:907:d27:b0:6db:d928:a976 with SMTP id gn39-20020a1709070d2700b006dbd928a976mr711978ejc.24.1648050338765; Wed, 23 Mar 2022 08:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648050338; cv=none; d=google.com; s=arc-20160816; b=vdR/zQyHjJOHuGiv6ilyzNiL9P40ZM278HEuk4IhmiqEChi7tN0JBmASdt1D6G/jrn +njhsgiaFpaD2ZlnsHF+0z+1TqH7OL7rBb7B3k9IC58DYiPjaDxl2vMlSwg4CmCDWqUg LWYpFMtsZQQHM7+jIDyMyaHYzB5yDdpwP/L1b8OMrSwjuxBLG4v7OHjhTesax8PcGDJa F1HMFqVuabqBF6YJW9mJalT6FREohglHNitngIlku2/Yqd8Oa3Cu2NRk0W/AZtu8B8VB QOEr1+HmIZh6eL6e7EtVd9h7CXAm9nxEoi7pb8ja35WAca+k0VCWRScHtWza612UT1Ou 1IBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yThzV6cmTzNMmxXexBNrkaOcp+iboMv5dcpmVWUTcuM=; b=Af6tYPBK6w/P0rwc25Pq6nKruepHUu077r2RMUi80e9Y+MZdyZBSPWKAqVJa/GFiXi XyR3HcDJ2W8Vv6Fb8CAgc6kzqB7G2wvKSvw64PukOT1LAUvt1gqnmPhF9/QyrlRXR0a0 ha46BtGCuZDU3zfM4J+C7TebpiGics4y+rsjA9XyaNo3Eof2zRYDzpddS6AeeC9WYDdA dtS2KCb93hcpp0W0GntJXBR41qKbHR7ATp8hiYe5xCy7Wn492x+2Xp8FtBoi49kyfpBw G3Zr5tYjQSdnG+ce03pdD4TnkcMx0V5G1VNZYRnPamEM/geeTJCf7csB903qjBUnzQ8r dfaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HVcboc+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a1709062a5200b006df76385e1esi12398693eje.702.2022.03.23.08.45.12; Wed, 23 Mar 2022 08:45:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HVcboc+Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235759AbiCVViX (ORCPT + 99 others); Tue, 22 Mar 2022 17:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiCVViW (ORCPT ); Tue, 22 Mar 2022 17:38:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51D616252; Tue, 22 Mar 2022 14:36:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DA67561749; Tue, 22 Mar 2022 21:36:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17E01C340EC; Tue, 22 Mar 2022 21:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647985013; bh=xsxczdu0hsS3aRebxYXBIx2vI0JCWxkg6df2LNuNEEQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HVcboc+Y6NhYdxSAJ0/p/RYHJqaE8j05xgeLLHuSoSGTnCG26IwvN+m60IZ879p2c kKg/jtKi6Q7DmhW9H/fCV02qiW0cyDMQGz6aoLJxnRKFiyfjPYgr1r3zevtDfyiyYK Rvx6UNJaH5Wn6q0PQgc7LU+IeuES9q/IPbUhhLZQ6rq6AwBxN6i0U3aU0TRFXLsoUA fDrSqC5c47JKOHQSiqiOsrZ+GgVX88GgolGWhw+1B6nIYYpgepP/2f2PzXh8ljeT08 S7YanT8WulzBw0O+xw1NzmiShF7ncyj38zo7YsYNQC12eLaQJvt5kU6PSC2sq/JlEJ 61ege9VC5oQDg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 71A3240407; Tue, 22 Mar 2022 18:36:50 -0300 (-03) Date: Tue, 22 Mar 2022 18:36:50 -0300 From: Arnaldo Carvalho de Melo To: kajoljain Cc: Kim Phillips , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Alexander Shishkin , Boris Ostrovsky , Ian Rogers , Ingo Molnar , Jiri Olsa , Joao Martins , Konrad Rzeszutek Wilk , Mark Rutland , Michael Petlan , Namhyung Kim , Peter Zijlstra , Robert Richter , Stephane Eranian Subject: Re: [PATCH 1/2] perf evsel: Make evsel__env always return a valid env Message-ID: References: <20211004214114.188477-1-kim.phillips@amd.com> <00c83305-7654-132d-a734-1746dd9f34f2@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00c83305-7654-132d-a734-1746dd9f34f2@linux.ibm.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Nov 23, 2021 at 01:56:38PM +0530, kajoljain escreveu: > > > On 10/5/21 3:11 AM, Kim Phillips wrote: > > It's possible to have an evsel and evsel->evlist populated without > > an evsel->evlist->env, when, e.g., cmd_record is in its error path. > > > > Future patches will add support for evsel__open_strerror to be able > > to customize error messaging based on perf_env__{arch,cpuid}, so > > let's have evsel__env return &perf_env instead of NULL in that case. > > > > Patch looks good to me. > > Reviewed-by: Kajol Jain Collecting this one now, found it thru the cracks. - Arnaldo > Thanks, > Kajol Jain > > > Signed-off-by: Kim Phillips > > Cc: Arnaldo Carvalho de Melo > > Cc: Alexander Shishkin > > Cc: Boris Ostrovsky > > Cc: Ian Rogers > > Cc: Ingo Molnar > > Cc: Jiri Olsa > > Cc: Joao Martins > > Cc: Konrad Rzeszutek Wilk > > Cc: Mark Rutland > > Cc: Michael Petlan > > Cc: Namhyung Kim > > Cc: Peter Zijlstra > > Cc: Robert Richter > > Cc: Stephane Eranian > > --- > > tools/perf/util/evsel.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > > index dbfeceb2546c..b915840690d4 100644 > > --- a/tools/perf/util/evsel.c > > +++ b/tools/perf/util/evsel.c > > @@ -2857,7 +2857,7 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target, > > > > struct perf_env *evsel__env(struct evsel *evsel) > > { > > - if (evsel && evsel->evlist) > > + if (evsel && evsel->evlist && evsel->evlist->env) > > return evsel->evlist->env; > > return &perf_env; > > } > > -- - Arnaldo