Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp829518ybk; Fri, 15 May 2020 14:59:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgPgz5CgT3Ryi94hRuV+6ljtPC9zGdQiphe73oFBSwmipGHjUSlZlbx0QwjVgBD2DI2xq5 X-Received: by 2002:a50:e3cb:: with SMTP id c11mr4930343edm.105.1589579997667; Fri, 15 May 2020 14:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589579997; cv=none; d=google.com; s=arc-20160816; b=GoJbtClQdj1I68+AK+7598UVb3koD7nlUqOR8boUA5UDfGWM8kSnbFaRjECumxgdj3 ZSxxTurUR4JEpq89LeRCLWC8ud4syNgnwogfWwHzTv+nqBky4Kr+I06n61N9GgfD2afY ppqcxw8NJyaS+4XhwfMJga0xMNiOQ+9BtBv5pApALxgI6ZXP6mEH0xz35w29BuRuMofi YZzl8yrS6VzhcVYuOD7m5V7+neZN0xn4hBDq9nHRtMAK1Aa9TkEht7XSnVgObcbUJwp/ yYdO3WQOa6LTK6LNioeeBQE/JRhKE3BUlCq423JSR6DubSSgn18ffZb4BRFKGU2jX7c2 5hzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=kkSiaJvog94/aYOcgzYy16QWa/dLPfi5rMQqLSVlixs=; b=ONoyarOtGohcLK2QU/9KGQobkFjIep5bok+6ljc/CgVh8uwOtfrA9l8auRZquZzvK+ CaxQczPDOISBaUTcms2M1+dFQkBVtSSTZ0bcYZNFD1WojVWOdmpIGC6WyVeZSIpRpv5d y9fNADae9cb6IYmK8FqLw4hCToUcHnyUcMg/wkY+JrZZYVMTdkrnSUUNuwdy9Cio/hlZ olfPjSnEGRQniqeftGQGK5m6KWvx1qCQKyvbWugBWX/ByILXDEGgB2MjK4Kzo/qAVV2Z RXvMSt/eTq8xETqt9wxIEpB/s4doLFU9PvE3RtKswbm7B/aiIn9ap3KS3N61SyvdI/dC b34w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VLE+HX5x; 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 y31si2218274ede.507.2020.05.15.14.59.33; Fri, 15 May 2020 14:59:57 -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=VLE+HX5x; 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 S1727033AbgEOV6D (ORCPT + 99 others); Fri, 15 May 2020 17:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726261AbgEOV6C (ORCPT ); Fri, 15 May 2020 17:58:02 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25768C061A0C for ; Fri, 15 May 2020 14:58:02 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id g6so4057195qvn.3 for ; Fri, 15 May 2020 14:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=kkSiaJvog94/aYOcgzYy16QWa/dLPfi5rMQqLSVlixs=; b=VLE+HX5xG/MszCohlrtmOoUjX0QLWfFlKaiTQmZL08YQirgkZ4zeQ5/GMf1kKemxZM d1474CJ+MVc0mS+YBXdwVNpSd80PVTIdI0dNN52YsJzDVFAVHYhwI5zEdXjgfh8+TZXU gmWyuiCHQ8AX8vJ3Bsl4GiTe+ejqZHwOBcrcrJUoIPz087w84+qNUYhO7mv1SBwpuNmg S2lwGwzXX2I14Cuu1VTro2FIztctotjk4lHPNtVGv/GqQAmFPbmplDFRll9eBP2E0n4k HnK8E6LFPJnYYikuZbvDfNAiWwECI/gF3HYisG0DCWHGxM+IGP3aZZNKDiB7E3CZqYZ5 zLIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=kkSiaJvog94/aYOcgzYy16QWa/dLPfi5rMQqLSVlixs=; b=DMPx6Hy6suhJVU9n4tfkrxNRPkd4WJUiTH3zag1MC3MUZrZn4tJTHzLdRjp9+iy5Fq OD9CjbQ73bhW1WuttKI3LBqXxEENZQqYwUErd1dHbzpVVfv2Y1ohc0lUy+Dswaol0Wol tCL/fNJ/Prr2VUJPYoQ8XWgXL+HW9TZCzjcGfeEpmeZr+U8LyOQfM/ZDYd0t/fgXFOly ZkVcNvOKYk9GOvZ2KZzy2E+ov/+XGV2Ic3WLjK1FKgLrpZc6lodBy1mDgcXMhEyBj+yV nx8TCIKnmMaYEv01RHawcYA2fa0nSJOJ/K5I74C6pQCcmUNTXLRy5vu1+fJfFk18MG/5 t2zQ== X-Gm-Message-State: AOAM533e7yeqIQqa2vjOSS32wxacBlpX6Hgvt1t9kFkXH3A2hZWpZhqq mIooDzZpUziUwSPtNuyAND0GwK5qnSSbiulzTS4/rmru/3BXam4TCYgfaqhuHec2WhB7PE0sP6w HK/jyCRGNldOIeAmq/s90G7vsbi3mNwL5fuEHJ5A82jcepFTzS3OUAqvzoM8/rULMUrQjqu9k X-Received: by 2002:a0c:b44c:: with SMTP id e12mr5551641qvf.30.1589579880899; Fri, 15 May 2020 14:58:00 -0700 (PDT) Date: Fri, 15 May 2020 14:57:30 -0700 Message-Id: <20200515215733.20647-1-eranian@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.26.2.761.g0e0b3e54be-goog Subject: [PATCH 0/3] perf/x86/rapl: Enable RAPL for AMD Fam17h From: Stephane Eranian To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@elte.hu, irogers@google.com, kim.phillips@amd.com, jolsa@redhat.com 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 This patch series adds support for AMD Fam17h RAPL counters. As per AMD PPR, Fam17h support Package RAPL counters to monitor power usage. The RAPL counter operates as with Intel RAPL. As such, it is beneficial to share the code. The series first moves the rapl.c file to common perf_events x86 and then adds the support. From the user's point of view, the interface is identical with /sys/devices/power. The energy-pkg event is the only one supported. $ perf stat -a --per-socket -I 1000 -e power/energy-pkg/ Signed-off-by: Stephane Eranian Stephane Eranian (3): perf/x86/rapl: move RAPL support to common x86 code perf/x86/rapl: refactor code for Intel/AMD sharing perf/x86/rapl: add AMD Fam17h RAPL support arch/x86/events/Kconfig | 8 ++--- arch/x86/events/Makefile | 1 + arch/x86/events/intel/Makefile | 2 -- arch/x86/events/probe.c | 4 +++ arch/x86/events/{intel => }/rapl.c | 55 +++++++++++++++++++++++++----- arch/x86/include/asm/msr-index.h | 3 ++ 6 files changed, 58 insertions(+), 15 deletions(-) rename arch/x86/events/{intel => }/rapl.c (92%) -- 2.26.2.761.g0e0b3e54be-goog