Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5226962ybl; Tue, 14 Jan 2020 05:41:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzXR7fCAo2RVaVt7n2F7HNJ3Sjr3aEVVbEvB+KJrZEZdh8a65hdnPaQp0ahQRTcYvy93ePx X-Received: by 2002:aca:fcd0:: with SMTP id a199mr16022068oii.143.1579009287357; Tue, 14 Jan 2020 05:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579009287; cv=none; d=google.com; s=arc-20160816; b=Bqci2uuuWeGrTU21RU6TVlVn+8sHUkq8nCRJc5Kp9+Vu0XdWb1Nq6cvHC069mkjgW6 QvVjuZVYXhM9LFNeOgDdgaKyl65hjc0Zyi6IV29to3KICqA6DxXjArVbyG3vYVtkbo/W 0Bv0Wxa7ehKsAB6uYeLmeU/4cT9Zy1p3tGAEaUHPAWCDrG2e5QLdWgIGOERWu0LpPpWR 9pCobkBPKCNSzr9pc8KSQQdiIYY5oPlzFrS92PasjH5JjHWpitWrGE1a74HWxiBN1Rr2 C9jLMD4MLqncAkyxEYX088tO2/8ROJHLlQNmrRCNM+xwVFSqC2X45SYDjgzE8PfLMfZ7 8mWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3/OUNp+8eiwyelLTvZ+VWbwPArDWt2E+tZJCkFYGzyI=; b=cWXuM+ruAbPVV4hP3+fhBnBtdTSYaqpLiAnzX636OWYjlUZjJtT76Li/6/kpNES47G nmMauS2MvH1laEvulWdnOHUNz/MU6DNXs14nhOXR4dZ7ZeYvQfij29mFT5kThMEIEzXI lH6ZdmpAhG6ZgEmR9GHbOIpTY7dnKTum0pkzW6RAxd9lLw9IvIJQmKfU1EK1GLuY4Nd7 CZZucvxvKqpSzo0TI1WZXPponNw0MHFAJ0p3TcVyo8eB+mBJRSimiS2P/K0X6DpL713h 1gVVUxRnfLeY0ghGvQVvaCWmKGeG8rFzSS39kZwwywTABti1kjLu4wy2TMesJ/xSsUwd 0HdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DlLo+h70; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si8707850otr.190.2020.01.14.05.41.15; Tue, 14 Jan 2020 05:41:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DlLo+h70; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728755AbgANNkP (ORCPT + 99 others); Tue, 14 Jan 2020 08:40:15 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:59879 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726106AbgANNkP (ORCPT ); Tue, 14 Jan 2020 08:40:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579009213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3/OUNp+8eiwyelLTvZ+VWbwPArDWt2E+tZJCkFYGzyI=; b=DlLo+h70F5LbBFuSDSw9pI7MViebRH/hppymEwhLChpQqhDM3b2GjYqtSFKuvyye3fT5cZ PCY6HKnc+JGTt8Arydqhp0bC2Svmf49uKqn3LNr1me0iVyqCIxOmO3GrqRjphHQ6B5tiqn 0pLBw5zFvvcFHlM7CpQ4nj9mgJbN9S4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-PEUzUONqOYWMl4g-bG-mTA-1; Tue, 14 Jan 2020 08:40:08 -0500 X-MC-Unique: PEUzUONqOYWMl4g-bG-mTA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 71285A0689; Tue, 14 Jan 2020 13:40:06 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2991C5DA70; Tue, 14 Jan 2020 13:40:00 +0000 (UTC) Date: Tue, 14 Jan 2020 14:39:58 +0100 From: Jiri Olsa To: "Sudarikov, Roman" Cc: Greg KH , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, eranian@google.com, bgregg@netflix.com, ak@linux.intel.com, kan.liang@linux.intel.com, alexander.antonov@intel.com Subject: Re: [PATCH v3 1/2] perf x86: Infrastructure for exposing an Uncore unit to PMON mapping Message-ID: <20200114133958.GE170376@krava> References: <20200113135444.12027-1-roman.sudarikov@linux.intel.com> <20200113135444.12027-2-roman.sudarikov@linux.intel.com> <20200113143430.GA390411@kroah.com> <9bfcc058-8fde-9b24-3d82-255004e7f057@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bfcc058-8fde-9b24-3d82-255004e7f057@linux.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 04:24:34PM +0300, Sudarikov, Roman wrote: SNIP > > > { > > > struct intel_uncore_pmu *pmus; > > > @@ -950,10 +976,19 @@ static int __init uncore_type_init(struct intel_uncore_type *type, bool setid) > > > attr_group->attrs[j] = &type->event_descs[j].attr.attr; > > > type->events_group = &attr_group->group; > > > - } > > > + } else > > > + type->events_group = &empty_group; > > Why??? > Hi Greg, > > Technically, what I'm trying to do is to add an attribute which depends on > the uncore pmu type and BIOS support. New attribute is added to the end of > the attribute groups array. It appears that the events attribute group is > optional for most of the uncore pmus for x86/intel, i.e. events_group = > NULL. > > NULL element in the middle of the attribute groups array "hides" all others > attribute groups which follows that element. > > To work around it, embedded NULL elements should be either removed from > the attribute groups array [1] or replaced with empty attribute; see > implementation above. > > If both approaches are incorrect then please advice what would be correct > solution for that case. hi, I think Greg is reffering to the recent cleanup where we used attribute groups with is_vissible callbacks, you can check changes below: b7c9b3927337 perf/x86/intel: Use ->is_visible callback for default group 6a9f4efe78af perf/x86: Use update attribute groups for default attributes b657688069a2 perf/x86/intel: Use update attributes for skylake format 3ea40ac77261 perf/x86: Use update attribute groups for extra format 1f157286829c perf/x86: Use update attribute groups for caps baa0c83363c7 perf/x86: Use the new pmu::update_attrs attribute group jirka > > [1] https://lore.kernel.org/lkml/20191210091451.6054-3-roman.sudarikov@linux.intel.com/ > > Thanks, > Roman > > Didn't we fix up the x86 attributes to work properly and not mess around > > with trying to merge groups and the like? Please don't perpetuate that > > more... > > > > thanks, > > > > greg k-h > >