Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp127259pxf; Wed, 10 Mar 2021 23:10:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFG5VMgT/Qqh6Zh+0Lus8E9ICK6OWLM0UvrCOEFXX/sHZtBud/aJ+wZjMu7+YCXG0jr0Tr X-Received: by 2002:a17:907:2054:: with SMTP id pg20mr1661226ejb.213.1615446613098; Wed, 10 Mar 2021 23:10:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615446613; cv=none; d=google.com; s=arc-20160816; b=hudlzC9RwPlkT5W3p1WgXxt+tiP0fgEkti/CiuMz1PLK78R5q2pcYBbWIgJkfXmlJk 43GXVzVuPZd87jaIAMYC1On7ASaxaA9OxSPy56pA/RmM4hkT9ISnZBPv6Vkdmke6fpuQ 4vqxi4Z5uOMtn7KgioYxRG1THmLw5AXKKiLn14rA3YAVYkk13cev9lRGdM6QLel0Wp7Z d188xwXQwQQLyInLrey4uoo9+arg8GYd/H1okxdxyDJZkImTz0NQMuQl/GSHWSLbmnV4 Kpa7r3Dw/oXwXO+Lt1TGprMhwAowGW+DgHYVhAfektPoFdbYj6X/mZUzc5BiFE9j5y9d KMEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=916NZWenslkDWj4OlhuxIa7krhHOdmSNRPnLHeio1Vo=; b=RbyN73WLPfx1XfcI/RMU7+td7VLt+/Bb4hI8MaoZbPt5GsIZSL1AzBpBwlkU+cAT6E N5M71m/E3nCevNfeCNsV24HgmxlaRbD7QDWi7x0yUmgFPBXyMcQ+xdfIl+eImsXZmCiW jJuqAbB71IJqJY2FMQXOiWiZpHd6SQkBKHOgFBgVU6LKksZfbP0GW8DAa7VOLT8FZ5/G QBgS98rhxXp0H3w1Y9IQHAv7V2rYFHBvGlZhBJ0Bnrte0qRaYYC0hhB/w2HeuH5HWZhN fu9BCeQ9AIn9kBhEOUv+11UGDy//jI6ffLToVA33swnWhEHfH2mpOJPi8e1hzw0efczI 0TfA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si1189219ejf.438.2021.03.10.23.09.49; Wed, 10 Mar 2021 23:10:13 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231264AbhCKHIy (ORCPT + 99 others); Thu, 11 Mar 2021 02:08:54 -0500 Received: from mga04.intel.com ([192.55.52.120]:22599 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231571AbhCKHIW (ORCPT ); Thu, 11 Mar 2021 02:08:22 -0500 IronPort-SDR: p1STqJQPR/umqlqvpEIA1PreadW9sPEP3/t8rq7qRR51rwLvJgALGsXjy/hEEkagpiGRrSemsN SXiIGHh/g9YQ== X-IronPort-AV: E=McAfee;i="6000,8403,9919"; a="186246011" X-IronPort-AV: E=Sophos;i="5.81,239,1610438400"; d="scan'208";a="186246011" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2021 23:08:22 -0800 IronPort-SDR: KdRWcfyNh+JGineDHHudWV3wXdmpRRgCIyYreZjlZSi4HJMdo1s3zyWsGKnhcFF8hHRWHIZTkm DRp7kQbag3dw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,239,1610438400"; d="scan'208";a="509937803" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga001.fm.intel.com with ESMTP; 10 Mar 2021 23:08:19 -0800 From: Jin Yao To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Jin Yao Subject: [PATCH v2 01/27] tools headers uapi: Update tools's copy of linux/perf_event.h Date: Thu, 11 Mar 2021 15:07:16 +0800 Message-Id: <20210311070742.9318-2-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210311070742.9318-1-yao.jin@linux.intel.com> References: <20210311070742.9318-1-yao.jin@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To get the changes in: Liang Kan's patch ("perf: Introduce PERF_TYPE_HARDWARE_PMU and PERF_TYPE_HW_CACHE_PMU") Kan's patch is in review at the moment, but the following perf tool patches need this interface for hybrid support. This patch can be removed after Kan's patch is upstreamed. Signed-off-by: Jin Yao --- tools/include/uapi/linux/perf_event.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index ad15e40d7f5d..c0a511eea498 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h @@ -33,6 +33,8 @@ enum perf_type_id { PERF_TYPE_HW_CACHE = 3, PERF_TYPE_RAW = 4, PERF_TYPE_BREAKPOINT = 5, + PERF_TYPE_HARDWARE_PMU = 6, + PERF_TYPE_HW_CACHE_PMU = 7, PERF_TYPE_MAX, /* non-ABI */ }; @@ -94,6 +96,30 @@ enum perf_hw_cache_op_result_id { PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */ }; +/* + * attr.config layout for type PERF_TYPE_HARDWARE* and PERF_TYPE_HW_CACHE* + * PERF_TYPE_HARDWARE: 0xAA + * AA: hardware event ID + * PERF_TYPE_HW_CACHE: 0xCCBBAA + * AA: hardware cache ID + * BB: hardware cache op ID + * CC: hardware cache op result ID + * PERF_TYPE_HARDWARE_PMU: 0xDD000000AA + * AA: hardware event ID + * DD: PMU type ID + * PERF_TYPE_HW_CACHE_PMU: 0xDD00CCBBAA + * AA: hardware cache ID + * BB: hardware cache op ID + * CC: hardware cache op result ID + * DD: PMU type ID + */ +#define PERF_HW_CACHE_ID_SHIFT 0 +#define PERF_HW_CACHE_OP_ID_SHIFT 8 +#define PERF_HW_CACHE_OP_RESULT_ID_SHIFT 16 +#define PERF_HW_CACHE_EVENT_MASK 0xffffff + +#define PERF_PMU_TYPE_SHIFT 32 + /* * Special "software" events provided by the kernel, even if the hardware * does not support performance events. These events measure various -- 2.17.1