Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1231776ybg; Tue, 2 Jun 2020 04:53:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcgyFVJBe5Tp9+5mYzvZhGSlmML8UnqLhUmzdskVr5uFi0NUoKbDYCfxcNmBZ4dNqG4SmR X-Received: by 2002:a05:6402:14d7:: with SMTP id f23mr26783481edx.187.1591098801037; Tue, 02 Jun 2020 04:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591098801; cv=none; d=google.com; s=arc-20160816; b=DU65Bwe9SmrnhbOxA6G5G0BIjHwgKLzEI860YHDya0/CSn2KgRqcJ4kudJ83XvPnEe 1aEVPVeLwlinjxl0PSnVGz2zIQWApPNZ67LxPtiImomQHL3tg0UF7wiX7KgAFU6J/ZFz byTNlxVzOsTWHC+jWImkrsvltb3dgHUxZEmyxG2boIkA4LIq5vFriTwXQaIa9BGSJ1JR VcTb4GdNoBGpC1AXFHrnBdCxqhyQoj3Y4a1k4+aRVME6cZUaO1avEUXAdXaUULElJJAA HRtK2ACV3TfT4Qu3FX6zM5Aa4/E3T53e4Kc28XUVy0ZdwjULifCmd1wY/VmHmemMZbA0 5A0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=TDRbrsI5u60J3TWT2OAw4pOBz7RiRMOX66uVNYZW8Sw=; b=koILrmjAJvfVDgo6M40p9huF5H/hwgkC0airUdQEq2Z1xJG9I3poQRmK9Huw/CEuI5 peAPPDTm2jaL6K/aTEmJIOubwU3u9If6in2o8kcjrFOCKBsqiEOJTSU7MsRwaDfZjnyq 5Rh4qHo+hvSodAZjEKtxlQ944aHZ6ERKqi1cVKGOtlwxJXI3cQS0johZYxvitamAEfFf rdlTNHbe1kdIWcbofP/F5fbHB2emb9alklvA3IABkwDQ1fusyndEEQRqzect6+yXiY3m WbRbkpNPp9x7qX0+fSvWdl+gRFxtCETV7QKjntxqBt6j+PpyBmfERz0ihGUzUMqNfPf+ 2tvg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si1326925ejn.479.2020.06.02.04.52.58; Tue, 02 Jun 2020 04:53:21 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726959AbgFBLvF convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Jun 2020 07:51:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58094 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726894AbgFBLvD (ORCPT ); Tue, 2 Jun 2020 07:51:03 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-369-wgooXHlzOjOhdOgqvjiqkQ-1; Tue, 02 Jun 2020 07:51:00 -0400 X-MC-Unique: wgooXHlzOjOhdOgqvjiqkQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 44533BFC0; Tue, 2 Jun 2020 11:50:59 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.195.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id D834910013D7; Tue, 2 Jun 2020 11:50:56 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ian Rogers , Stephane Eranian , Andi Kleen Subject: [PATCHv2 00/13] perf tests: Add metrics tests Date: Tue, 2 Jun 2020 13:50:42 +0200 Message-Id: <20200602115055.1168446-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, changes for using metric result in another metric seem to change lot of core metric code, so it's better we have some more tests before we do that. v2 changes: - some of the patches got accepted - add missing free to patch 1 [Ian] - factor pmu-events test functions and reuse it in the new test [Ian] - add fake_pmu bool to parse_events interface [Ian] - simplify metric tests - use proper cover letter subject ;-) I actually reworked the 2 patches Ian acked so far, so I did not add them. Also available in here: git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git perf/metric_test thanks, jirka --- Jiri Olsa (13): perf tools: Add fake pmu support perf tools: Add fake_pmu bool to parse_events interface perf tests: Factor check_parse_id function perf tests: Add another metric parsing test perf tools: Factor out parse_groups function perf tools: Add fake_pmu to parse_events function perf tools: Add map to parse_events function perf tools: Add metricgroup__parse_groups_test function perf tools: Factor out prepare_metric function perf tools: Release metric_events rblist perf tools: Add test_generic_metric function perf tests: Add parse metric test for ipc metric perf tests: Add parse metric test for frontend metric tools/perf/arch/arm/util/cs-etm.c | 2 +- tools/perf/arch/arm64/util/arm-spe.c | 2 +- tools/perf/arch/powerpc/util/kvm-stat.c | 2 +- tools/perf/arch/x86/tests/intel-cqm.c | 2 +- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 6 ++-- tools/perf/builtin-stat.c | 9 +++--- tools/perf/builtin-trace.c | 4 +-- tools/perf/tests/Build | 1 + tools/perf/tests/backward-ring-buffer.c | 3 +- tools/perf/tests/builtin-test.c | 4 +++ tools/perf/tests/code-reading.c | 2 +- tools/perf/tests/event-times.c | 2 +- tools/perf/tests/evsel-roundtrip-name.c | 4 +-- tools/perf/tests/hists_cumulate.c | 2 +- tools/perf/tests/hists_filter.c | 4 +-- tools/perf/tests/hists_link.c | 4 +-- tools/perf/tests/hists_output.c | 2 +- tools/perf/tests/keep-tracking.c | 4 +-- tools/perf/tests/parse-events.c | 2 +- tools/perf/tests/parse-metric.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/tests/pmu-events.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- tools/perf/tests/switch-tracking.c | 8 ++--- tools/perf/tests/tests.h | 1 + tools/perf/util/bpf-loader.c | 2 +- tools/perf/util/metricgroup.c | 74 ++++++++++++++++++++++++++++++++++++---------- tools/perf/util/metricgroup.h | 10 +++++++ tools/perf/util/parse-events.c | 29 +++++++++++------- tools/perf/util/parse-events.h | 5 ++-- tools/perf/util/parse-events.l | 8 +++-- tools/perf/util/parse-events.y | 41 ++++++++++++++++++++++++-- tools/perf/util/perf_api_probe.c | 2 +- tools/perf/util/record.c | 2 +- tools/perf/util/stat-shadow.c | 67 ++++++++++++++++++++++++++++++------------ tools/perf/util/stat.h | 3 ++ 36 files changed, 527 insertions(+), 92 deletions(-) create mode 100644 tools/perf/tests/parse-metric.c