From patchwork Thu May 17 11:06:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Dufour X-Patchwork-Id: 10406423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3AA66602C2 for ; Thu, 17 May 2018 11:08:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B14F287E2 for ; Thu, 17 May 2018 11:08:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F3A728877; Thu, 17 May 2018 11:08:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEBD7287E2 for ; Thu, 17 May 2018 11:08:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2D1776B04C1; Thu, 17 May 2018 07:07:41 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 259206B04C2; Thu, 17 May 2018 07:07:41 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0883B6B04C3; Thu, 17 May 2018 07:07:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 985256B04C1 for ; Thu, 17 May 2018 07:07:40 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id 70-v6so1739306wmb.2 for ; Thu, 17 May 2018 04:07:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=It3YIY0rl5SMiUGMwNnBcuerwTbysIfvkEVAWxpvc48=; b=nSXzeoScfMsWncIl6PyjRTrkrOZ79/LpMqMnkfXeuJOpvIUxySCOG5trcXwbjVw1jm gExyZ+CTZKC0zoHbnEfN/EarOVKqc/MxilWuoJwf2VABuffOvoVu6/ItdLSfPmSjJRMs YS6Rm2b2SPH9k+/FSh84nqIfc5PsFHWjCtHPLm7XZ7smwHO4JTzsnx0VfRTTthZVg+Up bc6VLTH/61uOApGLWvYqOAK0a6BwoutKJ7hsqvAk6WnGQHdn2a6BP0+xidpx7x4QiY/R mg0T82xdCL+7sts3CG9zUFM0srYgkXV6IhtKrU6j0yCRwhBnbcKEc6gJQBfkDb1Dhr43 YQuw== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) smtp.mailfrom=ldufour@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: ALKqPwdNSl0VhYvZ6ILiFMUb9/qmgOjA6xOQIl6cB4Zs1WBiPFbGlCso Zw+KYVkJX3l2XQC+dDnYEyrhW7zXzEMtazOyEAYr8catNl2ShF3S0n+JHvplcORyNZyNeDSxtj4 oiP6BMOVAIyCxkquI3cnw8Id08omxMoVo6gFS8tozytWYBb4HoI9WtqTVbWYF2iw= X-Received: by 2002:a50:f742:: with SMTP id j2-v6mr6412744edn.37.1526555260191; Thu, 17 May 2018 04:07:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZox+vzGRMGPLTlrP9+vrvC9wd+XcgzClTk3kyB4ZTrpNTjSbqCGVh+qYQ2QLcC6DqOx2WC/ X-Received: by 2002:a50:f742:: with SMTP id j2-v6mr6412697edn.37.1526555259553; Thu, 17 May 2018 04:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526555259; cv=none; d=google.com; s=arc-20160816; b=XasfehbJApr6ov8NYayRod2X0HFCU2bDjIBs0Bu5Aato+QqxyXt8uGN+appWDDe9rS dlmF/6l8hu7b4YIzyHxlLeShZ55Nxj/RvpSgOCGxR2+VKWaFf6dITYXjM3Yg6r5tx2Jq Z8THvAXQ3Qqag8ci48Vg5KvuTCowMiuBq0RSZnj/a3PRxK+a9gbTCrffmkkKymWmbgAR mU8E7CqmPPu0f7lVE/udQijELpKZq6keVKP03YwTI7f1ezwLPGm0AHGw70/hGv8LCs9p +CuDszF5dc7AL4yobc+dSFP7Olo7BT9IjK8mmMSeXM0DkukLZWnTaEU3lrWRu2elVwfd EuMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=It3YIY0rl5SMiUGMwNnBcuerwTbysIfvkEVAWxpvc48=; b=Ozox/ill9F0QYZSb1ngu5+B3DElGMhxzAQvN3nRb3yCOLEoFm8Tg1EtQTJ/pQv1tQC GhTzt40caUzRPZNN8NwcsdulX7qyyyAt0UyhaRjlEXmNAYXXBNfsCZRCiBzaCDlP6xMI kgYMdyo8HWF3Ad2c6tYS6dCxr83d9o/DmsoXTY0zEgPVAmsil3mB49Yhb4orq27r32ng mi8NAAaJGAEioD/ouqZqw/+R9b7STf92NZbQSkw8yk5cYkpCnOaA8G0uHf9GhrKaYV/a Fdrpu/Woleu6hJK1r2IT955gtZANDr7dKwOMwRbsFaZw8y5YB0G5Strjrwx6dQRwcLCC UJUw== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) smtp.mailfrom=ldufour@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id b27-v6si2392294edj.120.2018.05.17.04.07.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 04:07:39 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of ldufour@linux.vnet.ibm.com) smtp.mailfrom=ldufour@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4HB4DJE054213 for ; Thu, 17 May 2018 07:07:38 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j17kxax2c-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 May 2018 07:07:37 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 May 2018 12:07:35 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 17 May 2018 12:07:26 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4HB7QRd66781384; Thu, 17 May 2018 11:07:26 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E5E04C05A; Thu, 17 May 2018 11:59:15 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E21184C050; Thu, 17 May 2018 11:59:13 +0100 (BST) Received: from nimbus.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.33]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 17 May 2018 11:59:13 +0100 (BST) From: Laurent Dufour To: akpm@linux-foundation.org, mhocko@kernel.org, peterz@infradead.org, kirill@shutemov.name, ak@linux.intel.com, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Will Deacon , Sergey Senozhatsky , sergey.senozhatsky.work@gmail.com, Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Daniel Jordan , David Rientjes , Jerome Glisse , Ganesh Mahendran , Minchan Kim , Punit Agrawal , vinayak menon , Yang Shi Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, bsingharora@gmail.com, paulmck@linux.vnet.ibm.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: [PATCH v11 22/26] perf tools: add support for the SPF perf event Date: Thu, 17 May 2018 13:06:29 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526555193-7242-1-git-send-email-ldufour@linux.vnet.ibm.com> References: <1526555193-7242-1-git-send-email-ldufour@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18051711-0044-0000-0000-000005537522 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051711-0045-0000-0000-00002894E900 Message-Id: <1526555193-7242-23-git-send-email-ldufour@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-17_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805170100 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Add support for the new speculative faults event. Acked-by: David Rientjes Signed-off-by: Laurent Dufour --- tools/include/uapi/linux/perf_event.h | 1 + tools/perf/util/evsel.c | 1 + tools/perf/util/parse-events.c | 4 ++++ tools/perf/util/parse-events.l | 1 + tools/perf/util/python.c | 1 + 5 files changed, 8 insertions(+) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index b8e288a1f740..e2b74c055f51 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h @@ -112,6 +112,7 @@ enum perf_sw_ids { PERF_COUNT_SW_EMULATION_FAULTS = 8, PERF_COUNT_SW_DUMMY = 9, PERF_COUNT_SW_BPF_OUTPUT = 10, + PERF_COUNT_SW_SPF = 11, PERF_COUNT_SW_MAX, /* non-ABI */ }; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4cd2cf93f726..088ed45c68c1 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -429,6 +429,7 @@ const char *perf_evsel__sw_names[PERF_COUNT_SW_MAX] = { "alignment-faults", "emulation-faults", "dummy", + "speculative-faults", }; static const char *__perf_evsel__sw_name(u64 config) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 2fb0272146d8..54719f566314 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -140,6 +140,10 @@ struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX] = { .symbol = "bpf-output", .alias = "", }, + [PERF_COUNT_SW_SPF] = { + .symbol = "speculative-faults", + .alias = "spf", + }, }; #define __PERF_EVENT_FIELD(config, name) \ diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index a1a01b1ac8b8..86584d3a3068 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -308,6 +308,7 @@ emulation-faults { return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_EM dummy { return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_DUMMY); } duration_time { return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_DUMMY); } bpf-output { return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_BPF_OUTPUT); } +speculative-faults|spf { return sym(yyscanner, PERF_TYPE_SOFTWARE, PERF_COUNT_SW_SPF); } /* * We have to handle the kernel PMU event cycles-ct/cycles-t/mem-loads/mem-stores separately. diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 863b61478edd..df4f7ff9bdff 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -1181,6 +1181,7 @@ static struct { PERF_CONST(COUNT_SW_ALIGNMENT_FAULTS), PERF_CONST(COUNT_SW_EMULATION_FAULTS), PERF_CONST(COUNT_SW_DUMMY), + PERF_CONST(COUNT_SW_SPF), PERF_CONST(SAMPLE_IP), PERF_CONST(SAMPLE_TID),