Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp222011ybj; Wed, 6 May 2020 15:49:55 -0700 (PDT) X-Google-Smtp-Source: APiQypJIX1y6WDH6XwDOaFCzzxLj+v+9CQCSBE3jIwN67iAEQ1clZmLMb/YQHqp9UukKscMaBe8V X-Received: by 2002:a17:906:d926:: with SMTP id rn6mr9122497ejb.169.1588805395727; Wed, 06 May 2020 15:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588805395; cv=none; d=google.com; s=arc-20160816; b=b51HCxGtglFRuLWgi43HIyM+XRVKnGthxRJzL2UrvETriiEE3P46XnxwhpOsEXXdXg 3Sg5LmH8nAfXWfz+v6EiPT3bOhaQu8O7RMowBZnpwNtUwlnTx4kXfw41eG4nTXUiBYoY UDFL7sg6mkQQ+JO1kd8R+IZJNVSYeI9LgtjXxkGMxA9natT28ZyQUZa5Imo+h2ESrJZy +NBo31uOQ+o3smEjNw3R+YiaOecxj3lkZnet8KZ0NrH+3hEtBUYk5P/Kbs0Tfc5hRI/A OZA/z5rBYXc3SJ0xv3NehUlkFUIiMeL4IGm618GWPMIpAudFTM2q2t1h3l4f1d0ka9Ms EqJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LjRTwHggWiwM4X6xKecNjuKevakeacekowAHtGUdnQA=; b=Kt/bIoc2APRGf0/NrPgtx/49y4D+T0+o30LktowdXWYGSCsy8VnwbvP1OsFGtVVSOq IrQ55z76wCig25Jdz9LJFpjaVjQM0g4kR+BnmMJ7EMuB9Lczl0WwbKyEWOPO8NEmzRo1 UPMVnq/a2Czf5XBybJ/VES+d4ZP2uVY8DpsnPrsCcENh8jvEokjKcpst7wgN/pJgwxPf JbYhmlsE3209hsB4xFZ3xGcUvgT2ZLAzXOkIpOeu/5PUq2NtOdzrhx+HVVKBv/LEKl2d RN60/S1P3VNhxiMALtxZvpqfxMGISg0v3QTxh6rGOwu06y0beo/5hoq7XDSvI7ODHJaD UJpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JWi1lrV3; 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 g6si2020660edv.588.2020.05.06.15.49.32; Wed, 06 May 2020 15:49:55 -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=JWi1lrV3; 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 S1730377AbgEFWqL (ORCPT + 99 others); Wed, 6 May 2020 18:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728888AbgEFWqL (ORCPT ); Wed, 6 May 2020 18:46:11 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51DE5C061A0F for ; Wed, 6 May 2020 15:46:11 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id o198so1861330ybg.10 for ; Wed, 06 May 2020 15:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LjRTwHggWiwM4X6xKecNjuKevakeacekowAHtGUdnQA=; b=JWi1lrV3wsChCcXjeiJ9huwyv/r4heBAPZrWDMYxhSgeHd5ZZzrrtl8TNlel24DLAP 054FlgpJh8j1sN6zGPdA7bglW+0GBhjtMdPgLXc6ofVrIqZUGdrOx9GrohoH6u2IBAPL rm/ca62Q5PCukvsthFMRjNYrdZLuDs6+ACDWbKtB4tVHTWZ8eQkYbDuYzBhmZJSJMCVu Oug3pOYyt3PMl97Kd8/RCNx2vudi43bI/vSiD+gmf5d6mSl3mjwBsnbyf6PmOlJlWnfW upwS/BIqcl6lhveO/VGvt6acPoz2KlGCvh3UD+skLtSCOKWyippdzkqd46R6lFd91B0l TMCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LjRTwHggWiwM4X6xKecNjuKevakeacekowAHtGUdnQA=; b=Lz1DMxpzI4sczu12EO2siqmtDcQIlN7IiE0L0KN5IByXLTipgXQ0BAKfknNIt0S7cM iXcQiKnntoomgtw9hYR7JiWUtRBxWzx5zIrH4wtAmSuDVSpKxhEIwOZOl5f6BDkNIFYm TCsLFJEm0vc5fx3p/6BdArB61NSXg4lSpx2gXclbsGODHHbbxHgiA/gcbPb3tvhuA9yq PhQaF00p/rLckTWs9pXqh7MPEvVPYe400rvV5vCuQHfmEqQkJ9g6SleQjcjGFHQC2z3T xeATZIAv/uk2W+4jiQAtJ/np+w6lfxxaeH1pximvnrN85x2m0EcIQDovCCfwQpDmrOIT WJaQ== X-Gm-Message-State: AGi0PuZc7iaOOP2ZJUshzkbjqlf/Icj+sEQBzTpe9IQ9XgvDJh4dTQDN 8YWZKQHh8/80fGtAwOHGy4QprK0kGEv3sl0Gubpl0w== X-Received: by 2002:a25:77d8:: with SMTP id s207mr16003960ybc.47.1588805170245; Wed, 06 May 2020 15:46:10 -0700 (PDT) MIME-Version: 1.0 References: <20200430003618.17002-1-yao.jin@linux.intel.com> <20200430084529.GC1681583@krava> <20200430153253.GF1694693@krava> In-Reply-To: <20200430153253.GF1694693@krava> From: Ian Rogers Date: Wed, 6 May 2020 15:45:59 -0700 Message-ID: Subject: Re: [PATCH] perf parse-events: Use strcmp to compare the PMU name To: Jiri Olsa Cc: "Jin, Yao" , Arnaldo Carvalho de Melo , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , LKML , Andi Kleen , kan.liang@intel.com, yao.jin@intel.com, John Garry 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 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. Thanks, Ian