Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp271063ybj; Wed, 6 May 2020 17:15:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJcKSMtcVAdqaaBFxQpxYFUDyn4qQtuVkQK0To5jY7xEnwOgRc1ZcMK9vvV6rvA+rU1IvfE X-Received: by 2002:a05:6402:2076:: with SMTP id bd22mr9759968edb.334.1588810522777; Wed, 06 May 2020 17:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588810522; cv=none; d=google.com; s=arc-20160816; b=wE/S/jivZ+uPbxBwNk3UtiZ+x6dGtoxAEzyl4+wAKQ4HjpMDe2auqFmyq3HVajNjfG DsKbESRP6SPQdI6RoTE0dT8i5Pj0OjY+t72lzDfuHHholN22OvRt0NDzMVw8+drDhH6E EcJVYyhYOsNlOtzw35vKzUC7xyN351UF0MskgrUqsrHsdfv30hHgaSFTj7HOnNI1dmJt i1TRYqbvyxskn+fvF0uNIPihS/O94wWk2sLbsj40VAfZ9uKX5eBVW31IovXTF6HU/30g xL2xFfwcvzgOIv9Mp7YV/wm4i4sgZXU55nUKko/Of0L3PU1ECXCx5WYIhNMgpoQYDjep +I8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=laSmCS31gEA41tuA8ZNrSPpS46j8yRqPinu80CqMU88=; b=mxPWZZqiI+t0b7FXicb0NKgQrM9Trv/c+YddUvBgacBu3Lay5RNjNoosFSBRLLa+2V a6ySf2UUNCNHhs1ofBZyshza8HQqoq/7hHIvXWRgdvOjWn7HkCTqrsHJe2GSfflqjoj6 kRQjUYapaklekmxLxZRpHef9h9vqgB5ilAhMM2RQRbBHX4/MjX74SAw/uQbSl/QLd/rf s4W88D7w2ykmCciTuWcpxB6kyayUT1DSQAxY2ZKW1KlDHMSU06kWe9nXw8CaG99dG42r 3iWgG0IMg3iYy4L/Y+DN0AMRgF5TsV2yUb1WEfFF+Xod1Ms9SDCKpklofNH/dlk5NyuH ZH3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="R/3mxwsp"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si2092716edv.257.2020.05.06.17.14.59; Wed, 06 May 2020 17:15:22 -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=@gmail.com header.s=20161025 header.b="R/3mxwsp"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728228AbgEFXqk (ORCPT + 99 others); Wed, 6 May 2020 19:46:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgEFXqk (ORCPT ); Wed, 6 May 2020 19:46:40 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C4EFC061A0F for ; Wed, 6 May 2020 16:46:40 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id c4so1796229qvi.6 for ; Wed, 06 May 2020 16:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=laSmCS31gEA41tuA8ZNrSPpS46j8yRqPinu80CqMU88=; b=R/3mxwspz3FlVkn3zYKAGxLVg5EDpiBtfT/ixr0OZqIy6VbW3btZKgRbSdMo457C9w 27pNqYmZieLkjiipA70j/IZSXluimwiVZCjzGmYGMTjXvILQZvN+FR1KVVCBdX+Y5rO7 1W5YoL0yrjWACfvXr/easyyyWHYgXEx6/1Y4yvhs5wVYg7z4DVw9IYgawInDa5XanqYt e5JktoOh9TXXYeY0p8cMMH9kI3xQmobzrCl53jtD6vHdLE6x4NwsacTdn9nqWfzeQeGk A3DBSNiTetuFsjXdWs8hOc4loJ7CxDY7INCenp76lXNnYqE5+JTHCUMCE9t/yqMBn6sF iiPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=laSmCS31gEA41tuA8ZNrSPpS46j8yRqPinu80CqMU88=; b=P6huYnOo1oOwYA151oedOzjGITKq8tQeaIFnoQ9MtbyYV42z/idGRE0vR96vHR/Hnp aAF+qnvDvrsOeIW/wDMhQqmPTioPag5OHK+K458a7balC3PLa8qRcS2cWxUBORSZOz+g UA75Hm0Tda5IpOju9OJeijkdfBDkpBYo2rihLGGCswqIcBqC9yWWhLwoQpp966MIAeSh qnnEOkIoJZp5B40CsvrIndhJoaXEs4ws6XTY8fXN7i1xBcW6RFYCaUx8C4cvfbXBJ0+9 1v0OewQaQ/8uId0ZWuMrOztL7pKS/Dd/fuhCksF+S7/VrGC1OZNe0NS8Tfe3ZSGZJlBM wtFA== X-Gm-Message-State: AGi0PuYXB+qK90DU6haj9UXRwj46gHWY9XjiB7Y0n2C0sVRDP4ifZXWF zcPjR5W+LLHrsBtYmCBXfTA= X-Received: by 2002:a0c:b5dd:: with SMTP id o29mr11130452qvf.87.1588808799130; Wed, 06 May 2020 16:46:39 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id e23sm2952077qkm.63.2020.05.06.16.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 16:46:38 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 64D7F409A3; Wed, 6 May 2020 20:46:36 -0300 (-03) Date: Wed, 6 May 2020 20:46:36 -0300 To: Ian Rogers Cc: Jiri Olsa , "Jin, Yao" , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , LKML , Andi Kleen , kan.liang@intel.com, yao.jin@intel.com, John Garry Subject: Re: [PATCH] perf parse-events: Use strcmp to compare the PMU name Message-ID: <20200506234636.GC5377@kernel.org> References: <20200430003618.17002-1-yao.jin@linux.intel.com> <20200430084529.GC1681583@krava> <20200430153253.GF1694693@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, May 06, 2020 at 03:45:59PM -0700, Ian Rogers escreveu: > On Thu, Apr 30, 2020 at 8:33 AM Jiri Olsa wrote: > > > > On Thu, Apr 30, 2020 at 09:45:14PM +0800, Jin, Yao wrote: > > > Hi Jiri, > > > > > > On 4/30/2020 4:45 PM, Jiri Olsa wrote: > > > > On Thu, Apr 30, 2020 at 08:36:18AM +0800, Jin Yao wrote: > > > > > A big uncore event group is split into multiple small groups which > > > > > only include the uncore events from the same PMU. This has been > > > > > supported in the commit 3cdc5c2cb924a ("perf parse-events: Handle > > > > > uncore event aliases in small groups properly"). > > > > > > > > > > If the event's PMU name starts to repeat, it must be a new event. > > > > > That can be used to distinguish the leader from other members. > > > > > But now it only compares the pointer of pmu_name > > > > > (leader->pmu_name == evsel->pmu_name). > > > > > > > > > > If we use "perf stat -M LLC_MISSES.PCIE_WRITE -a" on cascadelakex, > > > > > the event list is: > > > > > > > > > > evsel->name evsel->pmu_name > > > > > --------------------------------------------------------------- > > > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_4 (as leader) > > > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_2 > > > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_0 > > > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_5 > > > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_3 > > > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_1 > > > > > unc_iio_data_req_of_cpu.mem_write.part1 uncore_iio_4 > > > > > ...... > > > > > > > > > > For the event "unc_iio_data_req_of_cpu.mem_write.part1" with > > > > > "uncore_iio_4", it should be the event from PMU "uncore_iio_4". > > > > > It's not a new leader for this PMU. > > > > > > > > > > But if we use "(leader->pmu_name == evsel->pmu_name)", the check > > > > > would be failed and the event is stored to leaders[] as a new > > > > > PMU leader. > > > > > > > > > > So this patch uses strcmp to compare the PMU name between events. > > > > > > > > > > Fixes: 3cdc5c2cb924a ("perf parse-events: Handle uncore event aliases in small groups properly") > > > > > Signed-off-by: Jin Yao > > > > > > > > looks good, any chance we could have automated test > > > > for this uncore leader setup logic? like maybe the way > > > > John did the pmu-events tests? like test will trigger > > > > only when there's the pmu/events in the system > > > > > > > > Acked-by: Jiri Olsa > > > > > > > > thanks, > > > > jirka > > > > > > > > > > > > > > I'm considering to use LKP to do the sanity tests for all perf events > > > (core/uncore) and perf metrics periodically. It may help us to find the > > > regressions on time. > > > > sounds good ;) thanks > > > > jirka > > I've tested this and would be happy to see this merged. John's bisect > found a memory leak fix of mine as the culprit. > > Wrt testing, libbpf is using github/travis CI: > https://github.com/libbpf/libbpf > https://travis-ci.org/libbpf/libbpf > Perhaps that kind of set up can automate testing and lower the > reviewer burden - but there's upfront cost in setting it up. Well, if someone wants to bear this upfront cost, I can provide all the Dockerfiles + scripts I have to build those images, etc, I just don't have the time right now to invest in learning about travis, etc. That would be awesome. But if people run: make -C tools/perf build-test And: perf test Before sending pull requests, that would as well be fantastic :) - Arnaldo