Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964825AbbLOJFc (ORCPT ); Tue, 15 Dec 2015 04:05:32 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33973 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933248AbbLOJFL (ORCPT ); Tue, 15 Dec 2015 04:05:11 -0500 Date: Tue, 15 Dec 2015 18:04:30 +0900 From: Namhyung Kim To: Wang Nan Cc: acme@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com, a.p.zijlstra@chello.nl, masami.hiramatsu.pt@hitachi.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo Subject: Re: [PATCH v2] perf test: Reset err after using it hold errcode in hist testcases Message-ID: <20151215090430.GC1821@danjae.kornet> References: <1450166966-135536-1-git-send-email-wangnan0@huawei.com> <1450167650-136322-1-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1450167650-136322-1-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2717 Lines: 82 On Tue, Dec 15, 2015 at 08:20:50AM +0000, Wang Nan wrote: > All hists test cases forget to reset err after using it to hold an > error code. If error occure in setup_fake_machine() it incorrectly > return TEST_OK. > > This patch fixes it. > > Signed-off-by: Wang Nan > Suggested-by: Namhyung Kim > Cc: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > Cc: Masami Hiramatsu Acked-by: Namhyung Kim Thanks, Namhyung > --- > tools/perf/tests/hists_cumulate.c | 1 + > tools/perf/tests/hists_filter.c | 1 + > tools/perf/tests/hists_link.c | 1 + > tools/perf/tests/hists_output.c | 1 + > 4 files changed, 4 insertions(+) > > diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c > index 8292948..76f8922 100644 > --- a/tools/perf/tests/hists_cumulate.c > +++ b/tools/perf/tests/hists_cumulate.c > @@ -706,6 +706,7 @@ int test__hists_cumulate(int subtest __maybe_unused) > err = parse_events(evlist, "cpu-clock", NULL); > if (err) > goto out; > + err = TEST_FAIL; > > machines__init(&machines); > > diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c > index ccb5b49..2cd91df 100644 > --- a/tools/perf/tests/hists_filter.c > +++ b/tools/perf/tests/hists_filter.c > @@ -120,6 +120,7 @@ int test__hists_filter(int subtest __maybe_unused) > err = parse_events(evlist, "task-clock", NULL); > if (err) > goto out; > + err = TEST_FAIL; > > /* default sort order (comm,dso,sym) will be used */ > if (setup_sorting() < 0) > diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c > index 6243e2b..4dd8f4e 100644 > --- a/tools/perf/tests/hists_link.c > +++ b/tools/perf/tests/hists_link.c > @@ -293,6 +293,7 @@ int test__hists_link(int subtest __maybe_unused) > if (err) > goto out; > > + err = TEST_FAIL; > /* default sort order (comm,dso,sym) will be used */ > if (setup_sorting() < 0) > goto out; > diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c > index 248beec..dc7bf56 100644 > --- a/tools/perf/tests/hists_output.c > +++ b/tools/perf/tests/hists_output.c > @@ -597,6 +597,7 @@ int test__hists_output(int subtest __maybe_unused) > err = parse_events(evlist, "cpu-clock", NULL); > if (err) > goto out; > + err = TEST_FAIL; > > machines__init(&machines); > > -- > 1.8.3.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/