Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2263971rdb; Mon, 20 Nov 2023 06:39:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFP/Vz11vomXmFfnpfVDgkzQznavOV9Iv6G04kPZWNgvGgDEOjLQ9mYNznYW/jTk9gthEeB X-Received: by 2002:a05:6a20:2587:b0:17b:1f76:86ee with SMTP id k7-20020a056a20258700b0017b1f7686eemr9421115pzd.16.1700491194758; Mon, 20 Nov 2023 06:39:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700491194; cv=none; d=google.com; s=arc-20160816; b=JWWTM5STS67HZ06WR78r+guOBjlYqcse1RwdsZsEZONoXVYoZvjgUcqz3lWsAI24fQ cFZjQUM23zmMWfct/X9PElyR/9jYQL4haNI7PYzsedIGLtxuXty5otPpOkjpnCwk0tUh lzVv1+444ceQr3YKGdLPaTXDi0jdKaxhMx3zYIcAHmYvgEwB2aubEx6sD5Oqahqlm9iP 5/K1wlmIPh68fJRWcU26mNigXX2A2rEriYn24Yv5x78eKkCfa92tU9kwX5yUlmQSFEoR IHeHAzC6ZFcVZtEW1BmatsxIesbzeWuK4wM+qnwa6PzbHgij2QNzeC6umyteBjqQ017m +DUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=9M6sdiqGCwinQGMULaQmGbucsy2SVfpdAMoCHNBDpF0=; fh=hNrfQAbYh3Z2DJEENGJHk2DI4zZ1Z/35CV7+DFUZfaE=; b=KpU/bErQxW783PDSwXr4c4Ux9aj7xxNtwEu+KZMJw2JJ3JdZ4cT2TtbcOCK+qJf2T4 PgKhqpJ9BVahkgLxhH/UXqV17waBlBfcQ+BQc7A44+B9nYtkmaeipZn+fgQ1gMJC/4eY 8vAImX+q8T2Q5IYiPS+A8zQKmuWN2KeIDl4nVhXE+xnjBXAlYaiyJPIPgeHckf0YLaOp HV7EeI4j1d2jtTn4Ee1r91/H4qQEaFtMNHpK1LrO2FzXL5b5reTeH95MZzqn5sQQdE2A DHQmoKaOam/gDyrN+WjDdtOpQgVKBETAFPHHBtJqARfEZtrjP3/0jFzjXaQH7V91qhJR fteg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SbV8qGCS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w10-20020a63d74a000000b005be03f0da78si7972625pgi.157.2023.11.20.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:39:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SbV8qGCS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 01D0B8070654; Mon, 20 Nov 2023 06:36:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233576AbjKTOfv (ORCPT + 99 others); Mon, 20 Nov 2023 09:35:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233483AbjKTOfp (ORCPT ); Mon, 20 Nov 2023 09:35:45 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D34B8131; Mon, 20 Nov 2023 06:35:41 -0800 (PST) Date: Mon, 20 Nov 2023 14:35:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1700490940; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9M6sdiqGCwinQGMULaQmGbucsy2SVfpdAMoCHNBDpF0=; b=SbV8qGCSJ60aoBfUWO8zvv/w1riknKDbj9z7udbfzyUOpcTGcnp9lYORiwmu8O9McbEuFa 00uMxrq9j8uyojzgAVZVYjUiI6L+JXET/SgulN2V5onjD551FmGdBp4hUOzIYNxQXUrr43 i1WpCeyE2k5P30zjJjetuEpjBkMT0EJVdB7XmGrbxzYwJqMFwg5uf3/aOvWWxvPx+h1YNw Nbblpbv8ZZ4VbTFakOZyt2bqxlPOo5l6Buu/SZodUgaSD2tkbb4Kq39uaJNavwbxtwJomG DdBrwBSsV/p8Ru/Beg3N8/aPaGimEI0BmqkupvXLGiHjk5Od3jyTGZfqCYCdEA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1700490940; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9M6sdiqGCwinQGMULaQmGbucsy2SVfpdAMoCHNBDpF0=; b=Q/zvfwnqv+DNYVXrNV9sr0nIJIvHWnUuwYHh2XYRnHmGFadX/CWeiin8w2Btiy1Ozl0fDO m/Rshz/7w7xyefAw== From: "tip-bot2 for Kan Liang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/intel/cstate: Cleanup duplicate attr_groups Cc: Kan Liang , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231116142245.1233485-1-kan.liang@linux.intel.com> References: <20231116142245.1233485-1-kan.liang@linux.intel.com> MIME-Version: 1.0 Message-ID: <170049093988.398.3710895579013151635.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:36:03 -0800 (PST) The following commit has been merged into the perf/core branch of tip: Commit-ID: 243218ca93037631f0224fdbefea045912cb761a Gitweb: https://git.kernel.org/tip/243218ca93037631f0224fdbefea045912cb761a Author: Kan Liang AuthorDate: Thu, 16 Nov 2023 06:22:42 -08:00 Committer: Peter Zijlstra CommitterDate: Fri, 17 Nov 2023 10:54:52 +01:00 perf/x86/intel/cstate: Cleanup duplicate attr_groups The events of the cstate_core and cstate_pkg PMU have the same format. They both need to create a "events" group (with empty attrs). The attr_groups can be shared. Remove the dedicated attr_groups for each cstate PMU. Use the shared cstate_attr_groups to replace. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20231116142245.1233485-1-kan.liang@linux.intel.com --- arch/x86/events/intel/cstate.c | 44 ++++++++------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c index cbeb6d2..693bdcd 100644 --- a/arch/x86/events/intel/cstate.c +++ b/arch/x86/events/intel/cstate.c @@ -189,20 +189,20 @@ static struct attribute *attrs_empty[] = { * "events" group (with empty attrs) before updating * it with detected events. */ -static struct attribute_group core_events_attr_group = { +static struct attribute_group cstate_events_attr_group = { .name = "events", .attrs = attrs_empty, }; -DEFINE_CSTATE_FORMAT_ATTR(core_event, event, "config:0-63"); -static struct attribute *core_format_attrs[] = { - &format_attr_core_event.attr, +DEFINE_CSTATE_FORMAT_ATTR(cstate_event, event, "config:0-63"); +static struct attribute *cstate_format_attrs[] = { + &format_attr_cstate_event.attr, NULL, }; -static struct attribute_group core_format_attr_group = { +static struct attribute_group cstate_format_attr_group = { .name = "format", - .attrs = core_format_attrs, + .attrs = cstate_format_attrs, }; static cpumask_t cstate_core_cpu_mask; @@ -217,9 +217,9 @@ static struct attribute_group cpumask_attr_group = { .attrs = cstate_cpumask_attrs, }; -static const struct attribute_group *core_attr_groups[] = { - &core_events_attr_group, - &core_format_attr_group, +static const struct attribute_group *cstate_attr_groups[] = { + &cstate_events_attr_group, + &cstate_format_attr_group, &cpumask_attr_group, NULL, }; @@ -268,30 +268,8 @@ static struct perf_msr pkg_msr[] = { [PERF_CSTATE_PKG_C10_RES] = { MSR_PKG_C10_RESIDENCY, &group_cstate_pkg_c10, test_msr }, }; -static struct attribute_group pkg_events_attr_group = { - .name = "events", - .attrs = attrs_empty, -}; - -DEFINE_CSTATE_FORMAT_ATTR(pkg_event, event, "config:0-63"); -static struct attribute *pkg_format_attrs[] = { - &format_attr_pkg_event.attr, - NULL, -}; -static struct attribute_group pkg_format_attr_group = { - .name = "format", - .attrs = pkg_format_attrs, -}; - static cpumask_t cstate_pkg_cpu_mask; -static const struct attribute_group *pkg_attr_groups[] = { - &pkg_events_attr_group, - &pkg_format_attr_group, - &cpumask_attr_group, - NULL, -}; - static ssize_t cstate_get_attr_cpumask(struct device *dev, struct device_attribute *attr, char *buf) @@ -478,7 +456,7 @@ static const struct attribute_group *pkg_attr_update[] = { }; static struct pmu cstate_core_pmu = { - .attr_groups = core_attr_groups, + .attr_groups = cstate_attr_groups, .attr_update = core_attr_update, .name = "cstate_core", .task_ctx_nr = perf_invalid_context, @@ -493,7 +471,7 @@ static struct pmu cstate_core_pmu = { }; static struct pmu cstate_pkg_pmu = { - .attr_groups = pkg_attr_groups, + .attr_groups = cstate_attr_groups, .attr_update = pkg_attr_update, .name = "cstate_pkg", .task_ctx_nr = perf_invalid_context,