Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3003513ybk; Mon, 18 May 2020 13:19:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcCgycSsX0ozLr6/TUSI9X9pIWADTdPs8vZRGh6/Sk2eHdGXPiv9R9QGw+r5SAEzukWX/X X-Received: by 2002:a17:907:1002:: with SMTP id ox2mr3849684ejb.189.1589833164120; Mon, 18 May 2020 13:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589833164; cv=none; d=google.com; s=arc-20160816; b=g5+ZpttKKUwGm6NozB1kmD+yMPgk068QYqxIeDnd9eI4ynB4Y1BxGCPbPstbpuaL2S QKTsrpFj0inurh4liQyU79XlKlsjwMIBx/Il0n/KEvLL+JHOYCFwdtnpnxym0wpiK45B O6n0Tm2j9t/sbeABgAiIiONwvm8bAfhQcsoPgOiVCXoVPc491pKpQFNMYEevWOh4AGOw umepnBpk53nnxeTTb6qeyf69hstmzBMweNn6yJ9H/ShDOV7jBdIJGhISQxxB7Ho5HoZs CMKRTLKvKxeqSbmcFqJjn3NtPTV+g7dlKvYjDmdad/UqoikkeuSjxV+RqDdt+t7MTOoR BINA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2L5t1Sp95sqTVtR6AkRUlfVW8JMFNazZ3b7/dWgmdc8=; b=nNj6EU2RuabYzO3k2n0znFvsy6BM34+oUCxNLPNEU9+VLOeti/pDxhROr+/iZsl0E0 nKrhg254+0Dox0W6vKtqn5s0WgXcFarY29s0O/+/7PLRwsB8tGs7Dldoa1/zV8A6QFfP Lr7w8l11sPSsTgz/9C6TXZOGHt1E70P3G/AZkTY4Ab3mnfLtWzAFe/1fERKdZmRqI6Ce H1F5NQFvVoWSIBcKg+sac14YAON8oxD9Q3zeQXCC4yeBE4jbMRkSdnLlrXe1mgS81as2 1iYZ/ogE8W8BrWNAFEVS8hJt0erCTAeWDJQEXNy58XIbLti5Y7vQDeUa5hoZyJRKgwp3 Ffsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lRN84o1P; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd6si2905679edb.305.2020.05.18.13.19.00; Mon, 18 May 2020 13:19:24 -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=@google.com header.s=20161025 header.b=lRN84o1P; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbgERUQz (ORCPT + 99 others); Mon, 18 May 2020 16:16:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726367AbgERUQx (ORCPT ); Mon, 18 May 2020 16:16:53 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B836C061A0C for ; Mon, 18 May 2020 13:16:53 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id v26so6433077vsa.1 for ; Mon, 18 May 2020 13:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2L5t1Sp95sqTVtR6AkRUlfVW8JMFNazZ3b7/dWgmdc8=; b=lRN84o1P2f4cfUorpdVHKEFMmmGBZQXD3/THcziCpkhwowpSJz9mGQ2ehXmxCkh8oc pOW86mIRYwu+9fWgatuAJwruTnN2l5B5fxBv5tktzAmD4GKJWx8s3aWb8Bec1zsYZRV9 s/glNUkXcauOZiJ6R4rPMaMSd386/y7VGOh3GZvhdJwEQLOM/lwFcRWGA1Nue1iuI/Jy ILQDFIMUphst8PxHU2lyktW3i19RyvKdNN06v/8ej1Lnm4kRDBarQO5FoIz2dZ8SLphK mZy3gOu8rxCusU8vVTwsigC3qdMnHKKSSQXh+O6X0g36Zl428GSRiM/Ya+zDJbbGToEx boZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2L5t1Sp95sqTVtR6AkRUlfVW8JMFNazZ3b7/dWgmdc8=; b=H4Btoj/3de87Sdq6jw9a6rIUvXRfMEq4oXnL7j6VHq4HS5/CJo1HTsjq4FA3v+6PTU XgBquAe+Dlpe88iIs4WLDHWkga2+uSNv6ajjxoA986oZaKhG5S8FGdcbqCU463j3qk/L +1tHQkH2XRuZtlJWXRgYNLDXEvjtN6RhFXPoe2U5/Dh2af4zqoHC7583erIJfBOLz7pS /0Ob7hK6JRnDmCRHp1SEWnQy5E4hmTkEZ10+/R947Mj8ye8utyk9Momt3NVAUoe4XlhP ZUXOSQpfueXTtzHXDPNGqPrKxqHLNp7wEoVvW0XnelXDZF3Al5kNiEUlGdxufdRrrJRV EwUw== X-Gm-Message-State: AOAM530WOwLRxx3zzcU4joFrwSLVyHO72QSATjrGqPbWI3hggCHLRfXf p6V70gde8zJfjXLv3IyquFbZ6tnNfJPzjfc+dCpNTg== X-Received: by 2002:a67:d981:: with SMTP id u1mr648823vsj.240.1589833012258; Mon, 18 May 2020 13:16:52 -0700 (PDT) MIME-Version: 1.0 References: <20200515215733.20647-1-eranian@google.com> <20200515215733.20647-4-eranian@google.com> <20200518093402.GB277222@hirez.programming.kicks-ass.net> In-Reply-To: <20200518093402.GB277222@hirez.programming.kicks-ass.net> From: Stephane Eranian Date: Mon, 18 May 2020 13:16:41 -0700 Message-ID: Subject: Re: [PATCH 3/3] perf/x86/rapl: add AMD Fam17h RAPL support To: Peter Zijlstra Cc: LKML , mingo@elte.hu, Ian Rogers , "Phillips, Kim" , Jiri Olsa Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 18, 2020 at 2:34 AM Peter Zijlstra wrote: > > On Fri, May 15, 2020 at 02:57:33PM -0700, Stephane Eranian wrote: > > > +static struct perf_msr amd_rapl_msrs[] = { > > + [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, NULL}, > > + [PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr }, > > + [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, NULL}, > > + [PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, NULL}, > > + [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, NULL}, > > +}; > > Why have those !PKG things initialized? Wouldn't they default to 0 > anyway? If not, surely { 0, } is sufficient. Yes, but that assumes that perf_msr_probe() is fixed to not expect a grp. I think it is best to fix perf_msr_probe(). I already fixed one problem, I'll fix this one as well.