Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4315503imm; Mon, 25 Jun 2018 13:35:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK4qCYyX9lV+1GHblEs1WwyxJBywAC4HM4KlB3ZTkJCZQw9wY/CiZZLFYs7U39FRnZUSG0f X-Received: by 2002:a17:902:8b86:: with SMTP id ay6-v6mr13919302plb.295.1529958901220; Mon, 25 Jun 2018 13:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529958901; cv=none; d=google.com; s=arc-20160816; b=XYlEqoLUpXVZe4B3ApCu9BayXEKkSDMpf1+4y/ymNN2cq1rhfJvpPvcrsJ6S8qiUJt qX6hLzNvDLQflp+rIjAlNL7qXptOTWF7Zhx2s2WHC964mIQctHSsDV60QIetvOxuhDjc N/ov7tRHlryPCFypNyFjwbQ+gAL1SN802qZRiTyn0lbcF5zTTk23uPWIv3z9JLoR9YAl 3yjIRiXW+JXVrhmgWaIx7OpHwGN0hDoUIFIi18+uoenS3Wr0gkCPr+ZIn+YIi/k0O21a Hw/yXU2LV1ofyAEZ0fsI9fmmgkdiHe2FJ5l2qP6vuD5Gq57MuOfYFFGQWveZZjyxxtcJ 79og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=rtLSbWacldS46G2MX1Wio9z2V42W5b6fV6Aog4bNPk8=; b=rmpjeB1EsC43X6tqsCoJFKpHWJjci5K5ba1ZQQ9gUtRodxS/J8bZRPOsf31IYEfIy+ fjIjEm4UhhatojzVxYVhrAtf9W5J7+YFVSwoVphsXpTnpoe5dRKdezFFjLdEhtq3zuIL FhENHzqWEq7xK5F9uk/uBzzxa+MbXbIGa15zs2SZ8aKcIYINp7XDSfve3nLdqh1bFv0O M5QJiwqMkb4pOue06r5jc7AS7pzrBt9oe5sNiS6k5lgz8TQGO1fl0cgVWdBOfotQPr2a wOzkybCq0/H1G6Ukl6E90txRurrLUzO9BpddRFjxpOIWXYuMOU3BfWDS5IwdV3pMkMp3 LChQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7-v6si12230296pgp.168.2018.06.25.13.34.47; Mon, 25 Jun 2018 13:35:01 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755726AbeFYUdz (ORCPT + 99 others); Mon, 25 Jun 2018 16:33:55 -0400 Received: from mga04.intel.com ([192.55.52.120]:59905 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbeFYUdy (ORCPT ); Mon, 25 Jun 2018 16:33:54 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 13:33:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,271,1526367600"; d="scan'208";a="52817891" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by orsmga006.jf.intel.com with ESMTP; 25 Jun 2018 13:33:53 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 3C2BC300D79; Mon, 25 Jun 2018 13:33:53 -0700 (PDT) Date: Mon, 25 Jun 2018 13:33:53 -0700 From: Andi Kleen To: Arnaldo Carvalho de Melo Cc: Thomas Richter , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, Jiri Olsa , Namhyung Kim Subject: Re: [PATCH 4/4 v3] perf stat: Add transaction flag (-T) support for s390 Message-ID: <20180625203353.GC19456@tassilo.jf.intel.com> References: <20180625125856.20262-1-tmricht@linux.ibm.com> <20180625145247.GY20477@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180625145247.GY20477@kernel.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +bool metricgroup__has_metric(const char *metric) > > +{ > > + struct pmu_events_map *map = perf_pmu__find_map(NULL); > > + struct pmu_event *pe; > > + int i; > > + > > + if (!map) > > + return false; > > + > > + for (i = 0; ; i++) { > > + pe = &map->table[i]; > > + > > + if (!pe->name && !pe->metric_group && !pe->metric_name) > > + break; > > + if (!pe->metric_expr) > > + continue; > > + if (match_metric(pe->metric_group, metric) || > > + match_metric(pe->metric_name, metric)) Why both the group and the metric? I would just match the metric_name Otherwise it's impossible to have a group called "transaction" With that fixed it's ok for me. Acked-by: Andi Kleen -Andi