Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752550AbbG2LxS (ORCPT ); Wed, 29 Jul 2015 07:53:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56063 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751785AbbG2LxR (ORCPT ); Wed, 29 Jul 2015 07:53:17 -0400 Date: Wed, 29 Jul 2015 13:53:14 +0200 From: Jiri Olsa To: Kan Liang Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC V6 6/6] perf,tests: Add tests to callgraph and time parse Message-ID: <20150729115314.GE9606@krava.brq.redhat.com> References: <1437999699-19632-1-git-send-email-kan.liang@intel.com> <1437999699-19632-7-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437999699-19632-7-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2112 Lines: 46 On Mon, Jul 27, 2015 at 08:21:39AM -0400, Kan Liang wrote: > From: Kan Liang > > Add tests in tests/parse-events.c to check callgraph and time option > > Signed-off-by: Kan Liang > --- > tools/perf/tests/parse-events.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c > index f65bb89..fa733d5 100644 > --- a/tools/perf/tests/parse-events.c > +++ b/tools/perf/tests/parse-events.c > @@ -479,6 +479,29 @@ static int test__checkevent_pmu_name(struct perf_evlist *evlist) > return 0; > } > > +static int test__checkevent_pmu_partial_time_callgraph(struct perf_evlist *evlist) > +{ > + struct perf_evsel *evsel = perf_evlist__first(evlist); > + > + /* cpu/config=1,callgraph=fp,time,period=100000/ */ > + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); > + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); > + TEST_ASSERT_VAL("wrong config", 1 == evsel->attr.config); > + TEST_ASSERT_VAL("wrong period", 100000 == evsel->attr.sample_period); > + TEST_ASSERT_VAL("wrong callgraph", PERF_SAMPLE_CALLCHAIN & evsel->attr.sample_type); > + TEST_ASSERT_VAL("wrong time", PERF_SAMPLE_TIME & evsel->attr.sample_type); > + > + /* cpu/config=2,callgraph=no,time=0,period=2000/ */ > + evsel = perf_evsel__next(evsel); > + TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); > + TEST_ASSERT_VAL("wrong config", 2 == evsel->attr.config); > + TEST_ASSERT_VAL("wrong period", 2000 == evsel->attr.sample_period); > + TEST_ASSERT_VAL("wrong callgraph", !(PERF_SAMPLE_CALLCHAIN & evsel->attr.sample_type)); > + TEST_ASSERT_VAL("wrong time", !(PERF_SAMPLE_TIME & evsel->attr.sample_type)); hum, this cannot pass right? we dont call perf_evsel__config in this test.. jirka -- 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/