Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp203002ybs; Tue, 26 May 2020 07:13:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWYGkL/yzaH9A1KWO4Lz3JLLqwAy+1VZu0Pa9g4dmI3RRlxnkl50TJlkxTY8YocC+asfZb X-Received: by 2002:a17:907:b11:: with SMTP id h17mr1325831ejl.430.1590502411891; Tue, 26 May 2020 07:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590502411; cv=none; d=google.com; s=arc-20160816; b=K5tK7UAnTmYF34e9+f4tBqLqrVLvjQf53tIf1hkcEPzssPWyUtKog3yikmypVYMya1 s061gs3YbXqnkp8U4XYNS1zGAhle+cpQPy7VRS7gWlHIUp+LfWPlnen78ZwZcD++gaFe rC2FdMAMFHA2J/PxRFlY7r13JMJVHKqO88IcOOx3hPYTMEsLEivvycwFRKLVl0nmwL3k 1X5kGTjhwoJ21CzclzYxk8G4N7sVcmhlii0WiRu2xtQv9ZL92pppus0dimsyjei6N4Qe usAiK+N+l62RfSFNifuCExDVzCnvSanCJ23o77eDvdZTMVK8UbfIIEZqt3wAPk3gpc73 zaFw== 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=5bTHoLgIfdIigbECZgfIbpBlTngaTI4kGHd0degjyNM=; b=l6xQnRoP62AvGqMU2zmGWrPmqkP7dit/awXh2n2gE3y3kRT8X/At+wi9LsPg6qILZK CNtIlBJrk0UlblJ2pzPHhG4x65ktj0nIjzC1xOBVvgciAqyhrCVb/qFnqkW85wqq2VkE BeB0OetG8XM/wTIp/CU8ypOu5LIK775HoFTkIeFGyUwBVp9XZBRIT+DrlHtZv5+UPEYq y/pnwDihPEBckYs8G9/5jjhgRmk8IU0fyOPNZLQu8XTswJx8K6gQYVjhvK6eAET2O2Yi nIEbx75Z7WcUJXdHelO66k5/+rf6O+kwRtqTzuYJKzZgRzgw65ErS7IZdUdjbCUdvu39 o1JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K0vmH1pU; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a2si10928865edl.517.2020.05.26.07.13.09; Tue, 26 May 2020 07:13:31 -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=@redhat.com header.s=mimecast20190719 header.b=K0vmH1pU; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388876AbgEZLP2 (ORCPT + 99 others); Tue, 26 May 2020 07:15:28 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44610 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388712AbgEZLP2 (ORCPT ); Tue, 26 May 2020 07:15:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590491726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5bTHoLgIfdIigbECZgfIbpBlTngaTI4kGHd0degjyNM=; b=K0vmH1pUziHWjRaXfNS9BTkfUwkC/E1fBdK80BnI0H45rC2ukLAUsfZvKw2B3gF+2RS57j XBchVra0pUqTR4gSmxUJac1CNMYPmunAydwGQmnBLN1gnlI5OjAFCEZNh1DOOsEE0qLcWj 45NGHLK8X1a84xNnTEVo4DFTdz9Y5u0= 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-443-kyTJuLFbMk6yo5xLjM8A3A-1; Tue, 26 May 2020 07:15:17 -0400 X-MC-Unique: kyTJuLFbMk6yo5xLjM8A3A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80631800688; Tue, 26 May 2020 11:15:15 +0000 (UTC) Received: from krava (unknown [10.40.195.156]) by smtp.corp.redhat.com (Postfix) with SMTP id 133456EF91; Tue, 26 May 2020 11:15:12 +0000 (UTC) Date: Tue, 26 May 2020 13:15:12 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Ian Rogers , Stephane Eranian , Andi Kleen Subject: Re: [RFC 00/14] perf tests: Check on subtest for user specified test Message-ID: <20200526111512.GC333164@krava> References: <20200524224219.234847-1-jolsa@kernel.org> <20200525142300.GK14034@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200525142300.GK14034@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 25, 2020 at 11:23:00AM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, May 25, 2020 at 12:42:05AM +0200, Jiri Olsa escreveu: > > 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. > > > > Sending as RFC as it's still alive and you guys might > > have some other idea of how to do this. > > > > Also available in here: > > git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git > > perf/fixes > > I applied the first three patches, will wait a bit for Ian and others to > have some time to look at it, but one thing I thought was that instead > of having parse_state->fake_pmu as a bool, you could have it as a > pointer to the fake pmu, this way we would do away with that static > thing in the middle of the parsing code. > > +static int check_id(const char *id) > +{ > + struct parse_events_error error; > + struct evlist *evlist; > + int ret; > + > + /* Numbers are always valid. */ > + if (is_number(id)) > + return 0; > + > + evlist = evlist__new(); > + if (!evlist) > + return -1; > + > + memset(&error, 0, sizeof(error)); > + ret = parse_events_fake(evlist, id, &error); > + if (ret) { > + pr_debug("str : %s\n", error.str); > + pr_debug("help : %s\n", error.help); > + pr_debug("first_str : %s\n", error.first_str); > + pr_debug("first_help : %s\n", error.first_help); > + } > + > + evlist__delete(evlist); > + free(error.str); > + free(error.help); > + free(error.first_str); > + free(error.first_help); > + return ret; > +} > > > Would read: > > struct perf_pmu fake = { 0, }; > . > . > . > ret = parse_events_fake_pmu(evlist, id, &fake, &error); hi, ok I'll check, but what I'd like to keep is to have the fake pmu defined in just one place, I was initialy thinking to put it on the list of pmus, but then it'd appear in other places we dont want, like perf list ;-) > . > . > . > > > That also renames parse_events_fake() to parse_events_fake_pmu(). ok, thanks, jirka