Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp550350ybg; Mon, 1 Jun 2020 08:11:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz0AVZwwoZtTA1LWTw2+scfCaVMFFJjnhurnLDyGFOIiGv0/1Jc9Unei7B+3E4JYWzaUla X-Received: by 2002:a05:6402:31ba:: with SMTP id dj26mr21288619edb.360.1591024289072; Mon, 01 Jun 2020 08:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591024289; cv=none; d=google.com; s=arc-20160816; b=u3h+WV3ClGKbFHmpOtX/2yJ+uqX15wUDRAaWL12knFc1NG2HyoOTmowp7yvTxTpWJY o0OjMiH0ftpn/VZZLkfWLCXp2HMYp3HlFIRhQG72ftSjqe8p92SVBcP47mMjTLvh7eaU 7RgMsQt2UYPqPj7/sG4p9zoQIJXZdgtf9k8C4NLcK6G3vp23w+xI+PFVa6LBBQO1f8y2 TY3HmUDpTegrcmJvOH8PyK74d2devxVdfVhWh/wSgHEelcS6JOw15C/iLrGGPx+HAP2I qwupLL4IyxU5kWqjn3sezdKacp11Ael2d2KEYI+SD765TaO8qndIlpKspy8BXH3zmhHc 1Rrg== 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:from:date :dkim-signature; bh=ah9iIKeIOoYLPJg0qWkda1Z6IB0WkYQ2WVul6ug3Yug=; b=a+bo72VaK36FtqX58t9X0dOyPneUJHLGaPbZVXn9U1UqlAhtq4osUO+ATVeKt7l4au Dj7jGnTRMLyldjbTY9YiuRS5J4ZfJtOP0TMdN5EFKDuL5ZgIVhb3dl0iPpFmg0mGRkaq 0Id3VRIeUQqcy98QC0SKe+lqyWBh0E3FQTTKMpBGHFYQX79eKJPvzoGcRiAseUzY/I1C CsFFWxyN6WiUUm6f6VDKPXZTV8/lAMe1wjBMJgpg7MMWt8Wcq6iWotIT78b0T3iyN/gX ezTWuKGZVt/KIvtBgKy/8Te880rUWlolf34H6wJApaiNX8zDgsw8mHOo11m9Ejeri3UN HHSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kAM1mFJo; 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 q5si7071299edw.228.2020.06.01.08.11.04; Mon, 01 Jun 2020 08:11:29 -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=@kernel.org header.s=default header.b=kAM1mFJo; 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 S1727921AbgFAPI4 (ORCPT + 99 others); Mon, 1 Jun 2020 11:08:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:36784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbgFAPIz (ORCPT ); Mon, 1 Jun 2020 11:08:55 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D3B7920738; Mon, 1 Jun 2020 15:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591024135; bh=eHhvtyo5/lCeJtq9drq3IibVhm0T3Et4gGxVzJNeYs0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kAM1mFJohoIroY+7Q3FL06id0sq8WEZfPpzdZ7zwsHKQj+ooyWdeZiu5a/t6ToUC7 jWyFHg+MHRyYBamGZJJ0XRLUNF6xYCDbhlkD8O3JOevktCqtjvd5KKsU8reG7MjTAQ GTlztNOypOzwaCdRDudVf4D8tS9S3+/hZuI16Kt0= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 13BCB40AFD; Mon, 1 Jun 2020 12:08:53 -0300 (-03) Date: Mon, 1 Jun 2020 12:08:52 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Stephane Eranian , Andi Kleen Subject: Re: [PATCH 14/14] perf tests: Add parse metric test for frontend metric Message-ID: <20200601150852.GM31795@kernel.org> References: <20200524224219.234847-1-jolsa@kernel.org> <20200524224219.234847-15-jolsa@kernel.org> 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 Mon, Jun 01, 2020 at 01:06:01AM -0700, Ian Rogers escreveu: > On Sun, May 24, 2020 at 3:43 PM Jiri Olsa wrote: > > > > Adding new metri test for frontend metric. It's stolen > > s/metri/metric/ > > > from x86 pmu events. > > > > Signed-off-by: Jiri Olsa > > Acked-by: Ian Rogers Ditto. - Arnaldo > Thanks, > Ian > > > --- > > tools/perf/tests/parse-metric.c | 46 +++++++++++++++++++++++++++++++++ > > 1 file changed, 46 insertions(+) > > > > diff --git a/tools/perf/tests/parse-metric.c b/tools/perf/tests/parse-metric.c > > index 3005d27c5c48..38f20850bba3 100644 > > --- a/tools/perf/tests/parse-metric.c > > +++ b/tools/perf/tests/parse-metric.c > > @@ -15,6 +15,11 @@ static struct pmu_event pme_test[] = { > > .metric_expr = "inst_retired.any / cpu_clk_unhalted.thread", > > .metric_name = "IPC", > > }, > > +{ > > + .metric_expr = "idq_uops_not_delivered.core / (4 * (( ( cpu_clk_unhalted.thread / 2 ) * " > > + "( 1 + cpu_clk_unhalted.one_thread_active / cpu_clk_unhalted.ref_xclk ) )))", > > + .metric_name = "Frontend_Bound_SMT", > > +}, > > }; > > > > static struct pmu_events_map map = { > > @@ -110,8 +115,49 @@ static int test_ipc(void) > > return 0; > > } > > > > +static int test_frontend(void) > > +{ > > + double ratio; > > + struct rblist metric_events = { 0 }; > > + struct evlist *evlist; > > + struct evsel *evsel; > > + struct value vals[] = { > > + { .event = "idq_uops_not_delivered.core", .val = 300 }, > > + { .event = "cpu_clk_unhalted.thread", .val = 200 }, > > + { .event = "cpu_clk_unhalted.one_thread_active", .val = 400 }, > > + { .event = "cpu_clk_unhalted.ref_xclk", .val = 600 }, > > + { 0 }, > > + }; > > + struct runtime_stat st; > > + int err; > > + > > + evlist = evlist__new(); > > + if (!evlist) > > + return -1; > > + > > + err = metricgroup__parse_groups_test(evlist, &map, > > + "Frontend_Bound_SMT", > > + false, false, > > + &metric_events); > > + > > + TEST_ASSERT_VAL("failed to parse metrics", err == 0); > > + > > + runtime_stat__init(&st); > > + load_runtime_stat(&st, evlist, vals); > > + > > + evsel = evlist__first(evlist); > > + ratio = compute_single(&metric_events, evsel, &st); > > + > > + TEST_ASSERT_VAL("Frontend_Bound_SMT failed, wrong ratio", ratio == 0.45); > > + > > + runtime_stat__exit(&st); > > + evlist__delete(evlist); > > + return 0; > > +} > > + > > int test__parse_metric(struct test *test __maybe_unused, int subtest __maybe_unused) > > { > > TEST_ASSERT_VAL("IPC failed", test_ipc() == 0); > > + TEST_ASSERT_VAL("frontend failed", test_frontend() == 0); > > return 0; > > } > > -- > > 2.25.4 > > -- - Arnaldo