From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbbJFHPI (ORCPT ); Tue, 6 Oct 2015 03:15:08 -0400 Received: from terminus.zytor.com ([198.137.202.10]:55829 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553AbbJFHOt (ORCPT ); Tue, 6 Oct 2015 03:14:49 -0400 Date: Tue, 6 Oct 2015 00:14:31 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: dsahern@gmail.com, a.p.zijlstra@chello.nl, dzickus@redhat.com, acme@redhat.com, kan.liang@intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, jolsa@kernel.org, mingo@kernel.org, hpa@zytor.com Reply-To: dsahern@gmail.com, a.p.zijlstra@chello.nl, dzickus@redhat.com, jolsa@kernel.org, mingo@kernel.org, acme@redhat.com, kan.liang@intel.com, tglx@linutronix.de, namhyung@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com In-Reply-To: <1444068369-20978-7-git-send-email-jolsa@kernel.org> References: <1444068369-20978-7-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tests: Add parsing test for 'P' modifier Git-Commit-ID: ddd83c9717ef8204f17cc63d6dcb5053d472caee X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ddd83c9717ef8204f17cc63d6dcb5053d472caee Gitweb: http://git.kernel.org/tip/ddd83c9717ef8204f17cc63d6dcb5053d472caee Author: Jiri Olsa AuthorDate: Mon, 5 Oct 2015 20:06:06 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 5 Oct 2015 16:22:15 -0300 perf tests: Add parsing test for 'P' modifier We cant test 'P' modifier gets properly parsed, the functionality test itself is beyond this suite. Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Don Zickus Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1444068369-20978-7-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/parse-events.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 3a2ebe6..0648b84 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -1259,6 +1259,17 @@ test__checkevent_breakpoint_len_rw_modifier(struct perf_evlist *evlist) return test__checkevent_breakpoint_rw(evlist); } +static int test__checkevent_precise_max_modifier(struct perf_evlist *evlist) +{ + struct perf_evsel *evsel = perf_evlist__first(evlist); + + TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->nr_entries); + TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->attr.type); + TEST_ASSERT_VAL("wrong config", + PERF_COUNT_SW_TASK_CLOCK == evsel->attr.config); + return 0; +} + static int count_tracepoints(void) { struct dirent *events_ent; @@ -1562,6 +1573,11 @@ static struct evlist_test test__events[] = { .check = test__checkevent_exclude_idle_modifier_1, .id = 46, }, + { + .name = "task-clock:P,cycles", + .check = test__checkevent_precise_max_modifier, + .id = 47, + }, }; static struct evlist_test test__events_pmu[] = {