Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp371687rwb; Tue, 6 Dec 2022 22:53:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5pfjc9lWBT6V7X9ZAMBh9NvA1rhH2Rrg4N0Z1WM0pFXNaQIWQ5Q7S6LIByCJDPRMXi6K+b X-Received: by 2002:aa7:c90a:0:b0:46c:a9ce:9800 with SMTP id b10-20020aa7c90a000000b0046ca9ce9800mr11820723edt.218.1670396034879; Tue, 06 Dec 2022 22:53:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670396034; cv=none; d=google.com; s=arc-20160816; b=V9SJU/+4C5II7WS6aktSfri3M+mJkY54kwajvrmKxUcBC47zkKLq5eDFhoUjANYXc6 FP6Rhv4ZgE5BlsVh1AZv01oVmymC4uZnfGZxUZv1uiq5GqM4E9Z4DZ8oSaUa5EqivC5f 0cKxRx1s79wKt67BHcQz6/f0YpjZuvidLPX5CpCjm518VHan4yp8jfPknEH6vLJlsb/5 Yx0Rog1uOb/5CzlaBTmIMka56mUw6Fb5ls2biI1CkD5vbgfyCTbL+xACaKIjzbCTWcqa 0kkiy8+ZKtS4OWIX/B8cYWPyAmwHg0aimxUJYAVp8ZKNfbQJB4gBhnrk/4NSiPFWhhdS 9/Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6+j+cskD4HTAaN8ItrN4IUmM0V8Z1VFX4R/8vqJuw+g=; b=YAZgxsotUYQSa+Meo7E9eTWQQCXPvGLAxCDVl9QNoSTpif1mcJwjctU35tMxKrojGq KHnO2lJ/hea87Bex3VJkmw0/VYOsqviAOLigtssMjmRkfdl7iTnG9HV7uz/ePXqtjqja 2gx0ZXO8V23kX0uRhxvQH7+uhBF22/dgYhGgEDLhEGhSHiOEaCE7QslufoRbxYbkU2nX FbWTXtFgZlv48NeXfywsXw8CQn3w65sW5v6JmvHo0IrN3YlUNSw/JQe+/K8jGBmFLlIH wvtyuNRtZtAP34Hue0vqT5xl9OGOHYK5PvAIfgKqhg7mBIjUC4FnyR5FZ6PciGc8j7h1 j0vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oD3fisdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a50ee88000000b0046b1827eda2si3274385edr.74.2022.12.06.22.53.35; Tue, 06 Dec 2022 22:53:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oD3fisdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229592AbiLGFhL (ORCPT + 76 others); Wed, 7 Dec 2022 00:37:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbiLGFhG (ORCPT ); Wed, 7 Dec 2022 00:37:06 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE4758008; Tue, 6 Dec 2022 21:37:05 -0800 (PST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B75Ucol025934; Wed, 7 Dec 2022 05:36:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=6+j+cskD4HTAaN8ItrN4IUmM0V8Z1VFX4R/8vqJuw+g=; b=oD3fisdtUc0pYNKbCAEkyKXZuu7OisvLcNnXBaNV/35RsQLN8+3VFm3p2pqss5dSqzgA TvelEeoGwFKiJVj4uTPo2csg16E6dPZ/6oIP+Ym93yIan2nGxKwcP2mQkkzdQQayZSGP 5ObddOJvEnRReqrDLXQfzSSyhCWWf3K3UqSJN7dPnb/P/qVds+502R9FqpwWrLCmHUVT pfZsT4cvJlPcEvsqzfLw8qYS2QI14HzzlB3LsvXmlGE1HJVxoOpInvX1wnbaoe9MX55b Zq7sFNPA2ZpRebsVSzoMZTyLn30w8kzElF3nfk+mvUB18hEkNHQInwoK4UMBg4tjFpjc tA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mamreg44x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Dec 2022 05:36:49 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2B75UmUX026288; Wed, 7 Dec 2022 05:36:48 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mamreg448-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Dec 2022 05:36:48 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.16.1.2) with ESMTP id 2B6DMVUe016460; Wed, 7 Dec 2022 05:31:45 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3m9m6y1s8f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Dec 2022 05:31:45 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B75Vg2p19792570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Dec 2022 05:31:42 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 240B520040; Wed, 7 Dec 2022 05:31:42 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 04FCF20043; Wed, 7 Dec 2022 05:31:37 +0000 (GMT) Received: from [9.43.83.42] (unknown [9.43.83.42]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 7 Dec 2022 05:31:36 +0000 (GMT) Message-ID: <2f0f83f3-91a9-a719-c36e-ca1ff5c9b6f8@linux.ibm.com> Date: Wed, 7 Dec 2022 11:01:35 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v3 2/2] perf test: Add event group test To: Ravi Bangoria , Athira Rajeev Cc: Arnaldo Carvalho de Melo , Kan Liang , Ian Rogers , Jiri Olsa , Namhyung Kim , Peter Zijlstra , Mark Rutland , Adrian Hunter , Alexander Shishkin , carsten.haitzler@arm.com, Leo Yan , Kajol Jain , Thomas Richter , linux-perf-users@vger.kernel.org, LKML , sandipan.das@amd.com, ananth.narayan@amd.com, santosh.shukla@amd.com References: <20221206043237.12159-1-ravi.bangoria@amd.com> <20221206043237.12159-3-ravi.bangoria@amd.com> <2e45a93d-56fd-b18e-de61-51ceccfee8a3@amd.com> Content-Language: en-US From: Madhavan Srinivasan In-Reply-To: <2e45a93d-56fd-b18e-de61-51ceccfee8a3@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: V7Xzhf7WfmIbbq3-ysEezoggGeaO1SfN X-Proofpoint-GUID: szfonUSxKYe21_Q_vdNfrcZ6CNsMIiW8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-07_02,2022-12-06_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212070043 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS 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 On 12/7/22 9:56 AM, Ravi Bangoria wrote: > Hi Athira, > >>> +static int setup_uncore_event(void) >>> +{ >>> + struct perf_pmu *pmu; >>> + int i; >>> + >>> + if (list_empty(&pmus)) >>> + perf_pmu__scan(NULL); >>> + >>> + perf_pmus__for_each_pmu(pmu) { >>> + for (i = 0; i < NR_UNCORE_PMUS; i++) { >>> + if (!strcmp(uncore_pmus[i].name, pmu->name)) { >>> + pr_debug("Using %s for uncore pmu event\n", pmu->name); >>> + types[2] = pmu->type; >>> + configs[2] = uncore_pmus[i].config; >> Hi Ravi, >> >> Observed failure while running the test on powerpc. It is because the uncore PMU ie hv_24x7 needs >> performance monitoring to be enabled in powerpc. So to handle such cases, can we add an “event_open" check before >> proceeding with the test. Below is the change on top of “tmp.perf/core” . >> >> >> From 8b33fb900c26beafc28f75b6f64631f8fdd045c2 Mon Sep 17 00:00:00 2001 >> From: Athira Rajeev >> Date: Tue, 6 Dec 2022 20:17:25 +0530 >> Subject: [PATCH] perf test: Update event group check for support of uncore >> event >> >> Event group test checks group creation for combinations of >> hw, sw and uncore PMU events. Some of the uncore pmu event >> requires performance enablement explicitly. > You need to open an event to activate hv_24x7 pmu? hv_24x7 pmu supports events which can also provide system-wide resource data and partition should have permissions to access those, hence the check. Maddy > >> Example, hv_24x7 >> event in powerpc. Hence add a check to see if event_open >> succeeds before proceeding. >> >> Fixes: 5c88101b797d ("perf test: Add event group test for events in multiple PMUs") >> Signed-off-by: Athira Rajeev >> --- >> tools/perf/tests/event_groups.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/tools/perf/tests/event_groups.c b/tools/perf/tests/event_groups.c >> index 612c0444aaa8..ad52e1da259a 100644 >> --- a/tools/perf/tests/event_groups.c >> +++ b/tools/perf/tests/event_groups.c >> @@ -51,7 +51,7 @@ static int event_open(int type, unsigned long config, int group_fd) >> static int setup_uncore_event(void) >> { >> struct perf_pmu *pmu; >> - int i; >> + int i, fd; >> >> if (list_empty(&pmus)) >> perf_pmu__scan(NULL); >> @@ -62,6 +62,10 @@ static int setup_uncore_event(void) >> pr_debug("Using %s for uncore pmu event\n", pmu->name); >> types[2] = pmu->type; >> configs[2] = uncore_pmus[i].config; > Sure. Just add a comment here to explain why are we opening a > standalone event here. > >> + fd = event_open(types[2], configs[2], -1); >> + if (fd < 0) >> + return -1; >> + close(fd); >> return 0; >> } >> } > Thanks, > Ravi