Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2349976imm; Thu, 7 Jun 2018 09:10:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKOUs4MymY9ekN43m02La4yG+tIoWyFM9ItfEqkOCJu+CLNen3JGN70v4BHRClrkDhmKaFu X-Received: by 2002:a63:63c4:: with SMTP id x187-v6mr2114963pgb.9.1528387847010; Thu, 07 Jun 2018 09:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528387846; cv=none; d=google.com; s=arc-20160816; b=vK/ZFEs2LDuU4yB2EfJPfk+Dm9aOLCPQyxJaCLEmq8uHfC/iMATuS7Q/9C1d5EEGJo 7aIO7Whae2pHkOXz3nH5WVpYMSbMmpnlffN6kG+ya2hc7vwO9i8eVgMEjUwQJtQXzyi7 W8EpLPzKRg8VopLVXgnf/r9ndkZvmcpO1rGzZBPyNyVXaZba6MubxN+Pf4HeAgRtlERr dJ3c/1ynllP3QI5gT4glcIXGJ7r3zKUNZc0qcC3+OqBliSGTpF7rI5uWX11Yxg+7/pJk Jk6xWdD2G+A+t7+p0ht9tPgJsqm1xU+AHleB4zZumO6jwFJp0jM4H7gu3fL7V2rhTuIm Vm+A== 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 :arc-authentication-results; bh=DRd+XZNBiL4kJav+xhAl2qbYnyToIwNx+iHLrSKX+00=; b=GJBOOr7i6s+B04G9jtjrSby5HIHg2envkshPrci/x/EYjvTQgjd/GVB9iO0U9SRs1i ecQqDqa3QN+8WDQ7wWFl5iR4G7S5Jzg1mI5iMni9VffJPlq3JpJLJ+sU4qOpBQexINq7 /cQud238ii+gD8shDLKU0S3ROUwSHTR2V5sAsCvwvmXIsWstTZrFwM1rJ8vgC6YtN1pj sAafc8vMWohD0h8mwNvOcuBrWr02osfHnzw4U++uswkcVi3aYWlPmrH1cseXIrPy7je5 tdozIzCBY5L8+q5FZF1kXH66ewQFgal50fe9tQBWJvBQjEarRRsOf3RwYIHN7vm1m+dE K+7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OzHsAj8T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si4616074pgf.484.2018.06.07.09.10.32; Thu, 07 Jun 2018 09:10:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OzHsAj8T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S935701AbeFGQJ2 (ORCPT + 99 others); Thu, 7 Jun 2018 12:09:28 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:43795 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935654AbeFGQJM (ORCPT ); Thu, 7 Jun 2018 12:09:12 -0400 Received: by mail-wr0-f195.google.com with SMTP id d2-v6so10417196wrm.10 for ; Thu, 07 Jun 2018 09:09: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=DRd+XZNBiL4kJav+xhAl2qbYnyToIwNx+iHLrSKX+00=; b=OzHsAj8ThqF2R90BCSy7tF5CLjZhr1B8sZ+lcWHw4VIyR7u23l2+cMlmvPS0iIG1RW cuy1ZrDEYBvp4iOJPuDn9Y5eyYKIpJy1Uy4ALo8n1GqVXoE01eFmFugPPx8T/BCi23sD PW7IwkPW2LOODERSR34v+9ai0ASZ/J0I5O3LDCzjOYN5Ce0yn4c41XmgbeFW/vXaJuoV KsLRm9f/hbuwHrrxW2O4beW7YW43+mhd7gJE1zPFagJ2CZFSaWfiJkoXBHbed21Az9CY Bku90dgjMSwmiHjtpMxZHUVUYPLc9FD4ZfTc6FLYF+7doz+X4dPXw5vX/jPn/wg4Lidm JNRA== 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=DRd+XZNBiL4kJav+xhAl2qbYnyToIwNx+iHLrSKX+00=; b=BiK27hvFc8wGV3AZD+1osIii4VCunY5hfWmvAFH6rSvYrwovDVKwGS6HExjM122oTI LI0BZX/pb05wDjcqHtap0peRVgNuqc35nLmaOHF/+IjNxMLmOKoaJWmH0xVWNzQsji7Y WN3LgaX9f+GUIRLNZ5XHd0F7/8bhers/YVYsZIFTidaC8DMgCfEOU/kzwRj74RKWD8Oa 8CorByJvAIyue38x7TdhTR13LATUHSGxB017V2tLnUp6c5CdEYETZvMs+jCLiWn2HX0t 3fBkz7FeVzc9udskk5Bxpt96sUpiQb1lgydLxbfHj3hRdU74817Crvx0okgd6zXBPWHm 0K6w== X-Gm-Message-State: APt69E0cKzvTe8mW06lbwxbR036LGu7PcWv8T6NJeXyGlzWIFSY5PLAI wc9X+ApSEr+UkYuQdr3U2K+W/mn2CGI5y+dppbXYgA== X-Received: by 2002:adf:a0ee:: with SMTP id n43-v6mr2329183wrn.23.1528387751069; Thu, 07 Jun 2018 09:09:11 -0700 (PDT) MIME-Version: 1.0 References: <20180606221513.11302-1-jolsa@kernel.org> <20180606221513.11302-2-jolsa@kernel.org> <20180606231902.GE7220@tassilo.jf.intel.com> <20180607062239.GA18436@krava> In-Reply-To: <20180607062239.GA18436@krava> From: Stephane Eranian Date: Thu, 7 Jun 2018 09:09:10 -0700 Message-ID: Subject: Re: [PATCH 01/10] perf tools: Uniquify the event name if there's no other matched event To: Jiri Olsa Cc: Andi Kleen , Jiri Olsa , Arnaldo Carvalho de Melo , Peter Zijlstra , "Liang, Kan" , agustinv@codeaurora.org, LKML , Ingo Molnar , Namhyung Kim , David Ahern , Alexander Shishkin , Milian Wolff , Andi Kleen , frederic@kernel.org 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 Wed, Jun 6, 2018 at 11:22 PM Jiri Olsa wrote: > > On Wed, Jun 06, 2018 at 04:19:02PM -0700, Andi Kleen wrote: > > On Thu, Jun 07, 2018 at 12:15:04AM +0200, Jiri Olsa wrote: > > > Currently by default we try to match the user specified PMU > > > name to all PMU units available and use them to aggregate > > > all matched PMUs event counts into one 'pattern' event. > > > > > > While this is useful for uncore events, it screws up names > > > for other events, where this is not desirable, like: > > > > > > Before: > > > # perf stat -e cp/cpu-cycles/ kill > > > > I assume you mean cpU/cpu-cycles/ > > > > > > Performance counter stats for 'kill': > > > > > > 1,573,757 cp/cpu-cycles/ > > > > > > Keeping the pattern matching logic, but making the name unique > > > in case there's no other match found. That fixes the example > > > above and hopefully does not screw up anything else. > > > And the problem I have with this approach, is that you do not really know what you are measuring. You have not way of knowing that the count comes from multiple PMU instances: perf stat -a -e uncore_cb/clockticks/ kill 0 uncore_cb/clockticks/ I think you need to report that this is aggregated from uncore_cbox_0 and uncore_cbox_1. Otherwise it is not clear what I am monitoring. And you hope that what you match in the regex is related. In my example should say: 0 uncore_cbox[0-1]/clockticks/ then it is clear what happened. > > > After: > > > # perf stat -e cp/cpu-cycles/ kill > > > > > > Performance counter stats for 'kill': > > > > > > 1,573,757 cpu/cpu-cycles/ > > > > > > The output is 100% identical? > > nope, the U is actualy missing.. that's the thing, the patern > matching allows you to put 'cp' instead of 'cpu' and the final > output is screwed.. also the metrics won't match the proper event > > jirka