Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp602506ybg; Mon, 1 Jun 2020 09:26:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7yBRUJMdrPWoZi1bzQ6uIJnA+H249AGo1pC43O1f5wWXXIiUhcIVizsWwPjjVIib/3+Ou X-Received: by 2002:a17:906:7e50:: with SMTP id z16mr1378350ejr.277.1591028798315; Mon, 01 Jun 2020 09:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591028798; cv=none; d=google.com; s=arc-20160816; b=hqfFxQ/+4iXYzdWI7o3lgRM7qbQqk1SQ68Pm5yQDRWVnNXzlI9GrlVsgTGQnX+j2SP 0/2NMtHnXF7wNrk9jqhi6hqI7GpX+pPs4n9gDnEFRqEWLKI9qVFA4dus+CuHL7iAhKrp JPGOAEgQuGaxW1xC0XBL+HvQuvu+YzOvVGaByYhhNhCv5QH1de0T0abItIyqA8b8KFoL yRMe3PraxLO8SmVWbibvRTRGvyU5z5rzgyyfWVQoTEDCp07q5RCHn2PONv+mLU7Jrrs+ PIAoLCVbAM7CfAuzxDzatu1a39iIIZM+NXDPAM0Kg9pJ7Kf/TnY3dmdEVLp8HB824YV/ j8Mw== 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; bh=PQ2GMhzo7cmDr2bvHk1Eg4SDQqgv+z7peej1Sf2vsYE=; b=kl1RSuLJD7p77YuHum3HD6RWez3hDlSIEosanG0LSQdDF+5lmpfeS+sSXFJqymfMkE t6rGgCk0b+qrZQY1iesAsvzobagglHyQmd+XXVIkZwb6Up9ZU8EnAooEnP2pvookcpA9 XN2C/UVt4V1qprThwcxozIhLZuUbiiDVOitgGSHBPJN/zB+oua9EV8jDFg8Yh7/Pds8Y tGZpKBaIH23jHJ+O5jC2XQBSgcJWGdw0tYbXevW64whXqghBAyCDOyw2xDjI9wwAPSpp mR1Yry7TZERniiRuVXV36rHicy/8s0vxVzvW+PunqUbTvKMP3wgZNMORmk5Md5B3xpAw V1lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uPm7+Nhh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si8116697ejt.522.2020.06.01.09.26.14; Mon, 01 Jun 2020 09:26:38 -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=@google.com header.s=20161025 header.b=uPm7+Nhh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727099AbgFAQYK (ORCPT + 99 others); Mon, 1 Jun 2020 12:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbgFAQYJ (ORCPT ); Mon, 1 Jun 2020 12:24:09 -0400 Received: from mail-yb1-xb44.google.com (mail-yb1-xb44.google.com [IPv6:2607:f8b0:4864:20::b44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C979C05BD43 for ; Mon, 1 Jun 2020 09:24:08 -0700 (PDT) Received: by mail-yb1-xb44.google.com with SMTP id y13so3350301ybj.10 for ; Mon, 01 Jun 2020 09:24:08 -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=PQ2GMhzo7cmDr2bvHk1Eg4SDQqgv+z7peej1Sf2vsYE=; b=uPm7+NhhxHzDUqaSkN14igTBR9BwE4dUvjGjDaGJl+MO6HCxa+3Mm3VFkyyCJ/K7qy IPfnwiJ3Ityam2G+W0VuM6GWso8s8Pyfj24xgpSFmWC0bCb8+EHT0aG2inCv3fJ2VJCJ IuF0sKlLInulOSd1HXvy0rUaZxXLkDqWtwXoyHbK146pSD/Jud3GTBOot0SvZgeaGnyC 7meWhECX1loiiMzZMg6wBxEkzjMr40tLD0XwGdS9a01QG2msavsR+B3mLyx6QPWHfMGp jmeQvyiOE9Ka/IH9bHw4brTFOvuD2nMncL/Cktk6ogC6aB+0TjyKzrzjogpFA/3+XnDt 7rGQ== 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=PQ2GMhzo7cmDr2bvHk1Eg4SDQqgv+z7peej1Sf2vsYE=; b=Q6Lm/7BXujMu6Pu37kJqPNwDlFFTV6lPWoKLzy4fxIBPzz4DboeiuVnia1IbrHDq1o rqB6rR9yHQtscOfa98qF+pb0I22XjenMrlGl5SthMVHyD/FTQsM1bDjwTmmVhlmeQsf/ cb28qF/1PjjGpZIYNbOwXyHraiFqaIucdhj8oH30rWhKJDvg92LXV4hClN80p+5S4D8T xnIbx7i5DxBFwaePuJlMgwbQeZ/r0cIYoKEu5soUgGhnMdZBaUZVIQ0FpQo7kpDxWyzj foyK0rdn07unXyppyxodJwH2oVXDOUUxjVn3Dk2I4/yBAk/IV50BklFTLk1VucamGaqs hK7g== X-Gm-Message-State: AOAM532ubXhcIELXAPIE2Ax0HEB5WrIAWnxQyOkrI/p7aK3w36NGhvss XZpuAS9zxdABEvIxQLdAJYht+ZGjLKTN4rcIQhvSxHwF X-Received: by 2002:a25:5387:: with SMTP id h129mr32591599ybb.47.1591028647233; Mon, 01 Jun 2020 09:24:07 -0700 (PDT) MIME-Version: 1.0 References: <20200524224219.234847-1-jolsa@kernel.org> <20200524224219.234847-7-jolsa@kernel.org> <20200601132147.GB1031432@krava> In-Reply-To: <20200601132147.GB1031432@krava> From: Ian Rogers Date: Mon, 1 Jun 2020 09:23:56 -0700 Message-ID: Subject: Re: [PATCH 06/14] perf tests: Add another pmu-events tests To: Jiri Olsa Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Stephane Eranian , Andi Kleen 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 Mon, Jun 1, 2020 at 6:21 AM Jiri Olsa wrote: > > On Mon, Jun 01, 2020 at 12:44:15AM -0700, Ian Rogers wrote: > > SNIP > > > > + 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; > > > +} > > > > This is quite similar to check_parse_id, fold them together? > > there is the 'same_cpu' logic in check_parse_id, > so I did not want to mess with that Agreed. We could handle ret and same_cpu in the caller. > > > > > + > > > +static int metric_parse_fake(const char *str) > > > +{ > > > + struct expr_parse_ctx ctx; > > > + struct hashmap_entry *cur; > > > + double result; > > > + int ret = -1; > > > + size_t bkt; > > > + int i; > > > + > > > + pr_debug("parsing '%s'\n", str); > > > + > > > + expr__ctx_init(&ctx); > > > + if (expr__find_other(str, NULL, &ctx, 0) < 0) { > > > + pr_err("expr__find_other failed\n"); > > > + return -1; > > > + } > > > + > > > + i = 1; > > > + hashmap__for_each_entry((&ctx.ids), cur, bkt) > > > + expr__add_id(&ctx, strdup(cur->key), i++); > > > > It might make sense to share the code here with that in test_parsing. > > This initialization of ids is commented there and it is a bit special. > > hum, not sure it's worth to add this complexity to test, I'd like > to keep it simple, it's already not straightforward ;-) I added the > comment you mentioned Ok, sounds good to me. More testing is the priority :-) Thanks, Ian > jirka >