Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1501361pxb; Fri, 10 Sep 2021 07:20:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7tdCXh0b1sef4FlwVNmrHECbYmd72a/UM8IDvwh7ZqfAb7EyMTCHNLQveXVf5aKGbK08C X-Received: by 2002:aa7:d51a:: with SMTP id y26mr9343267edq.163.1631283658288; Fri, 10 Sep 2021 07:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631283658; cv=none; d=google.com; s=arc-20160816; b=p8kma1q9z1RsOZoSf30ShCKDGIvi/GJ0k1yAuXRRg9K+hVkdhKlnFrOBrz9s9yRY62 sPjmnkQfbDRDGUfrUOS7MLKc02wLjOrdre0tI7BchOe/pSuxm8r5Ee3KYPRM45V/hjWM 9GzPW6CcAf/WznEca0abM4AXr0YN/BCpF4jBO4zRIRSh8Hg7bZaRw+FFRLc23Hc3K1eJ iiBFCzHOXLWVFaNaK5kINt+a4vHI7gpqS3LDofn/XkfdMMiyZaxE3h1pR7a5ksJH+M38 IFSnuOFyiXqs9DPgbR7pI054W9S4DgErkPbV2i/3UNdgkxqdQqRDaQDj8B0mPbDc+bt0 BvJw== 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=2C6XbU3KDpHyJt8b7245XhaI4Cq+7ppbxCrREf2MJP0=; b=gS4C0m/X2QB/otYsGCRiR/LpVYWtMZjoj+9eGrA75DCL9c3qmvuavHqNF4qqZnoVE2 Oz8CmL32d7nnCYFa/TMaOFviKYJzTmDaWKh8BxPdhEpANS5/HrUPZmjNkhYU7YdAZ2Bg pNvYiI6RtLWhuANzfpX0q5VV3DKcW0DoAdGow5ThKG8vaNtQgEr1J1AlmpNMVIWl8O0G zwIIVPLqXGwyyTkinQ1epwHsBPx+WQ15JpSPRSJVemTqJAcyp5DJukH9sWzbQBkcZneP ht4iRGn9IkzUeONG5blpnDmfDGvJMNXhRjq9D8VqfTcHfzWHDHMD2LjxKMnT1CvpVtDW wPuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=alhM4CKR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si5758600edi.48.2021.09.10.07.20.34; Fri, 10 Sep 2021 07:20:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=alhM4CKR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234019AbhIJOUS (ORCPT + 99 others); Fri, 10 Sep 2021 10:20:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:33880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233952AbhIJOUQ (ORCPT ); Fri, 10 Sep 2021 10:20:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E7AB561026; Fri, 10 Sep 2021 14:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631283545; bh=i6M0iOLrjNvAS8282FvsD30z58/M3IiYRbF0ZxjnaSU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=alhM4CKRWKUCoOGJYCkIp8kgoQlSnvxGHjuF4yHPFDlHTBUPzjtiO2dCSObASqIMb XOyOxteJLhrpUXnEkQCUbr7KmZ4+2ZDkb0O/Zq939QYu+YaWmFDHO7uTxCtvK7AzjE X2ASN96cMo4bHVIKSpELEjY1OKI+rkv6lbmEBmo3aozGw7q1+d5g9mhqBwxJo3u0+e tdcB78c5etBQ3TOiTFUgUAFicspFp3Xor+clJtulkyQaef5yIlA65ZOWvqx8o3rIhz abhkRDEkcYp2Y8xgEdRuC4ufImwTl2O6BKV3enrBKirC/48fLLKwqdsxhUY8yQ87mT 1XbDcikcI/lkA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 0EA204038F; Fri, 10 Sep 2021 11:19:02 -0300 (-03) Date: Fri, 10 Sep 2021 11:19:02 -0300 From: Arnaldo Carvalho de Melo To: Ravi Bangoria Cc: mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, yao.jin@linux.intel.com, namhyung@kernel.org, kim.phillips@amd.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] perf annotate: Add fusion logic for AMD microarchs Message-ID: References: <20210906105640.1040-1-ravi.bangoria@amd.com> <20210906105640.1040-2-ravi.bangoria@amd.com> <6a987cad-6c46-280e-f791-6c59b6628a45@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a987cad-6c46-280e-f791-6c59b6628a45@amd.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Sep 10, 2021 at 04:47:31PM +0530, Ravi Bangoria escreveu: > > >> +static bool x86__ins_is_fused(struct arch *arch, const char *ins1, > >> + const char *ins2) > >> +{ > >> + if (strstarts(arch->vendor, "AuthenticAMD")) > >> + return amd__ins_is_fused(arch, ins1, ins2); > >> + > >> + return intel__ins_is_fused(arch, ins1, ins2); > >> +} > >> + > > > > Can we instead make x86__ins_is_fused be a pointer and instead of > > storing arch->vendor we set it to one of amd__ins_is_fused() or > > intel__ins_is_fused()? > > > > I.e. here: > > > >> static int x86__cpuid_parse(struct arch *arch, char *cpuid) > >> { > >> unsigned int family, model, stepping; > >> @@ -184,6 +216,9 @@ static int x86__cpuid_parse(struct arch *arch, char *cpuid) > >> if (ret == 3) { > >> arch->family = family; > >> arch->model = model; > >> + arch->vendor = strndup(cpuid, 12); > > > > x86__ins_is_fused = strstarts(cpuid, "AuthenticAMD") ? > > amd__ins_is_fused : > > intel__ins_is_fused; > > Sure. Will post v2. Thanks, if you're quick we may get this into this merge window :-) > Thanks for the review Arnaldo, - Arnaldo