Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1565736ybg; Tue, 2 Jun 2020 13:33:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSV9aE5rWYuKr7aNkIQ0db1nYgs+MtkOL0aba7lBbbDJ5CRkcmdGJAhJMqZzkKDQqck1Bo X-Received: by 2002:a50:f044:: with SMTP id u4mr2284691edl.226.1591130026019; Tue, 02 Jun 2020 13:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591130026; cv=none; d=google.com; s=arc-20160816; b=l7gczwhWMurUkQHwbApiG6O7xA401LNt3yosnACHXzmpgipuHqYPGNEezKpa9GA4fu djBSdEM97uNq2yIcPFMyzCudvARQwGRBNXj98qKFE9q38v/VOj5VH6fubJ2PFwNWB0XP rG5q2JGrGgkS37zrcC18AozWpIexXhFyMEeaPoJklAIWLBF+eJYjvQgwrlPm4uUqGlWO xoy8aQkjs9OQmgvKqHg1n2UmM0Stb/ImPSr4nNK/xzh5SBnVu7XpJxudmC6U9xlr0Hub 4n633nrACNje5ZYbbW299y1MwrsWftvoxiQhoqxQU7lLibNny3tv3eoYu67aFqlgGSwq COEA== 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=dG2W30ikv7IrUlDO3uoRpNzwGtub0ifXIazr40I7HqQ=; b=KIr1MaYqslqz5ovAZKoEGhs186nqDg+n+gEFJhP10pTM7x+UKioCnATtz/7hlEzMQx 094e/G/qwlxs/5NNyQJDmVU1CtHn+Sazyc8jgd3HX7UdIKCPrH11mPwAJVKgQkDYQDdm y0VaaH0pbStPCOFWjUMZc3a5ejVxQvL0AD2ttgKRKLzg+Zw6LRoIK+6T/ru0ufGq/daY rcC/8r5i5qfNII3z3nS8nXMNFEamUP88gRgMM42SgEMXjiPnirWxLnIaU3WDPsk560lQ RqM7ucIBCgVmL3mwaonLuGZOfh8a/wnQFHfTKEv5gy6vAZXu9grom1BovCrB4XV1sfDx nTbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sDdwGkN1; 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 s15si1984436ejq.486.2020.06.02.13.33.20; Tue, 02 Jun 2020 13:33:46 -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=sDdwGkN1; 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 S1726937AbgFBUa7 (ORCPT + 99 others); Tue, 2 Jun 2020 16:30:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgFBUa6 (ORCPT ); Tue, 2 Jun 2020 16:30:58 -0400 Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B744CC08C5C0 for ; Tue, 2 Jun 2020 13:30:58 -0700 (PDT) Received: by mail-yb1-xb42.google.com with SMTP id j8so7688427ybj.12 for ; Tue, 02 Jun 2020 13:30:58 -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=dG2W30ikv7IrUlDO3uoRpNzwGtub0ifXIazr40I7HqQ=; b=sDdwGkN1aw+rFG87Zy/vBPI61YaYEMyJpvOrSu4Wod1Q79GO3E5FqvelR+/3Ud8IyU y2QEE9JQ8Pacn4MKRA7VRnmAAurkthXh5tLyRsqFIQSCfuVK0VWJZJb0MSF4v5XaA//8 gpIvEuyGePst/EVnG9jXgQluwhXZ8Ik/Vz7s7sKXR3Qc/IZHFyzkT9j77InsukBy5eC8 hsUsUjRG2hUBl4btt8uFZr+gCB2PO2Ilf5UUjNobN4xFu46HmtEfXzzNMDX+CSHFY6oR b1vh/Iacn4Xnb/BwSlFDZokXltbO9xRhG9j371UfY0/bVcshkR+q6oOLfbp+07UGqHGt J7dQ== 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=dG2W30ikv7IrUlDO3uoRpNzwGtub0ifXIazr40I7HqQ=; b=acd6j/0Axp0lw3q8xva/Sgb2MFF0dUxeQAzIWuTO+3aaeRQb4giWZD70thO1k/t8KC TWb3WrwV70INtjaVs38u3Ek0iOcsU6WzYHByQYnTI8XAakRQzKz4MOef37DopPEr5+Lf GlVsD2PugnrHnu595rJn+9iw4HoOalBUHcuVKI8vU9YttlKpLMILRqGCCTOhMEhTiXQu tiNu8tsdue2Uwc2iCjxg3YmcoUsYn+i5M/uP4PAFN6s8GgalgqjOev6pdHuYhfdPRqMz xLuhaOILhVeDU6FXFmAjgG6/Pq4LXTUr1rq8YGgatGC6grED7utbWOOqTdaQmudopL2W Q2IA== X-Gm-Message-State: AOAM533ryjPeuiAIkAZ68QE0ZzMXiOyS1LXXpnDDO4qi8m/OxpPf6YAd k9NlXmdkaqUhsjIBb9Ws6now0adUXT6Sa7s8+2doeA== X-Received: by 2002:a25:be81:: with SMTP id i1mr44795639ybk.184.1591129857654; Tue, 02 Jun 2020 13:30:57 -0700 (PDT) MIME-Version: 1.0 References: <20200602115055.1168446-1-jolsa@kernel.org> <20200602115055.1168446-5-jolsa@kernel.org> <20200602190815.GH1169993@krava> In-Reply-To: <20200602190815.GH1169993@krava> From: Ian Rogers Date: Tue, 2 Jun 2020 13:30:46 -0700 Message-ID: Subject: Re: [PATCH 04/13] perf tests: Add another metric parsing test 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 Tue, Jun 2, 2020 at 12:08 PM Jiri Olsa wrote: > > On Tue, Jun 02, 2020 at 10:58:32AM -0700, Ian Rogers wrote: > > SNIP > > > > +static int check_parse_fake(const char *id) > > > +{ > > > + struct parse_events_error error; > > > > nit: this reads funny as it isn't clear, without looking at > > check_parse_id, that error is zero initialized. > > right, how about something like below? Thanks, looks good! Ian > thanks, > jirka > > > --- > diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c > index d3343827eb4d..c745b6e13cbe 100644 > --- a/tools/perf/tests/pmu-events.c > +++ b/tools/perf/tests/pmu-events.c > @@ -403,7 +403,6 @@ static int check_parse_id(const char *id, struct parse_events_error *error, > evlist = evlist__new(); > if (!evlist) > return -ENOMEM; > - memset(error, 0, sizeof(*error)); > ret = parse_events(evlist, id, error, fake_pmu); > evlist__delete(evlist); > return ret; > @@ -411,7 +410,7 @@ static int check_parse_id(const char *id, struct parse_events_error *error, > > static int check_parse_cpu(const char *id, bool same_cpu, struct pmu_event *pe) > { > - struct parse_events_error error; > + struct parse_events_error error = { 0 }; > > int ret = check_parse_id(id, &error, false); > if (ret && same_cpu) { > @@ -433,7 +432,7 @@ static int check_parse_cpu(const char *id, bool same_cpu, struct pmu_event *pe) > > static int check_parse_fake(const char *id) > { > - struct parse_events_error error; > + struct parse_events_error error = { 0 }; > int ret = check_parse_id(id, &error, true); > > free(error.str); >