mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <suravee.suthikulpanit@amd.com>
To: <fweisbec@gmail.com>, <mingo@kernel.org>, <mingo@redhat.com>,
	<jacob.w.shin@gmail.com>
Cc: <oleg@redhat.com>, <a.p.zijlstra@chello.nl>,
	<acme@ghostprotocols.net>, <hpa@zytor.com>,
	<linux-kernel@vger.kernel.org>, <sherry.hurwitz@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: [PATCH 3/4] perf tools: add hardware breakpoint bp_len test cases
Date: Wed, 11 Dec 2013 06:28:25 -0600	[thread overview]
Message-ID: <1386764906-1681-4-git-send-email-suravee.suthikulpanit@amd.com> (raw)
In-Reply-To: <1386764906-1681-1-git-send-email-suravee.suthikulpanit@amd.com>

From: Jacob Shin <jacob.w.shin@gmail.com>

Signed-off-by: Jacob Shin <jacob.w.shin@gmail.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 tools/perf/tests/parse-events.c | 55 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 3cbd104..0c5bffc 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1114,6 +1114,49 @@ static int test__pinned_group(struct perf_evlist *evlist)
 	return 0;
 }
 
+static int test__checkevent_breakpoint_len(struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel = perf_evlist__first(evlist);
+
+	TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries);
+	TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type);
+	TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config);
+	TEST_ASSERT_VAL("wrong bp_type", (HW_BREAKPOINT_R | HW_BREAKPOINT_W) ==
+					 evsel->attr.bp_type);
+	TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_1 ==
+					evsel->attr.bp_len);
+
+	return 0;
+}
+
+static int test__checkevent_breakpoint_len_w(struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel = perf_evlist__first(evlist);
+
+	TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries);
+	TEST_ASSERT_VAL("wrong type", PERF_TYPE_BREAKPOINT == evsel->attr.type);
+	TEST_ASSERT_VAL("wrong config", 0 == evsel->attr.config);
+	TEST_ASSERT_VAL("wrong bp_type", HW_BREAKPOINT_W ==
+					 evsel->attr.bp_type);
+	TEST_ASSERT_VAL("wrong bp_len", HW_BREAKPOINT_LEN_2 ==
+					evsel->attr.bp_len);
+
+	return 0;
+}
+
+static int
+test__checkevent_breakpoint_len_rw_modifier(struct perf_evlist *evlist)
+{
+	struct perf_evsel *evsel = perf_evlist__first(evlist);
+
+	TEST_ASSERT_VAL("wrong exclude_user", !evsel->attr.exclude_user);
+	TEST_ASSERT_VAL("wrong exclude_kernel", evsel->attr.exclude_kernel);
+	TEST_ASSERT_VAL("wrong exclude_hv", evsel->attr.exclude_hv);
+	TEST_ASSERT_VAL("wrong precise_ip", !evsel->attr.precise_ip);
+
+	return test__checkevent_breakpoint_rw(evlist);
+}
+
 static int count_tracepoints(void)
 {
 	char events_path[PATH_MAX];
@@ -1346,6 +1389,18 @@ static struct evlist_test test__events[] = {
 		.name  = "{cycles,cache-misses,branch-misses}:D",
 		.check = test__pinned_group,
 	},
+	[42] = {
+		.name  = "mem:0/1",
+		.check = test__checkevent_breakpoint_len,
+	},
+	[43] = {
+		.name  = "mem:0/2:w",
+		.check = test__checkevent_breakpoint_len_w,
+	},
+	[44] = {
+		.name  = "mem:0/4:rw:u",
+		.check = test__checkevent_breakpoint_len_rw_modifier,
+	},
 };
 
 static struct evlist_test test__events_pmu[] = {
-- 
1.8.1.2



  parent reply	other threads:[~2013-12-11 12:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 12:28 [PATCH V6 0/4] perf/x86/amd: AMD Family 16h Data Breakpoint Extensions suravee.suthikulpanit
2013-12-11 12:28 ` [PATCH 1/4] perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 suravee.suthikulpanit
2014-01-09  1:24   ` Frederic Weisbecker
2013-12-11 12:28 ` [PATCH 2/4] perf tools: allow user to specify hardware breakpoint bp_len suravee.suthikulpanit
2013-12-11 12:28 ` suravee.suthikulpanit [this message]
2013-12-11 12:28 ` [PATCH 4/4] perf/x86: Remove get_hbp_len and replace with bp_len suravee.suthikulpanit
2014-01-08 19:00 ` [PATCH V6 0/4] perf/x86/amd: AMD Family 16h Data Breakpoint Extensions Suravee Suthikulanit
2014-01-09  1:52   ` Frederic Weisbecker
2014-02-25 15:09     ` Suravee Suthikulanit
2014-02-25 15:49       ` Frederic Weisbecker
2014-04-28 23:01         ` Suravee Suthikulanit
2014-05-29 15:26 [PATCH 0/4] perf: Support AMD range breakpoints Frederic Weisbecker
2014-05-29 15:26 ` [PATCH 3/4] perf tools: add hardware breakpoint bp_len test cases Frederic Weisbecker
2014-05-30 14:49   ` Suravee Suthikulanit
2014-05-30 15:24     ` Frederic Weisbecker
2014-09-24 13:45 [PATCH 0/4] perf: Support AMD range breakpoints v2 Frederic Weisbecker
2014-09-24 13:45 ` [PATCH 3/4] perf tools: add hardware breakpoint bp_len test cases Frederic Weisbecker
2014-10-01 21:37 [GIT PULL] hw_breakpoints: Support AMD range breakpoints Frederic Weisbecker
2014-10-01 21:37 ` [PATCH 3/4] perf tools: add hardware breakpoint bp_len test cases Frederic Weisbecker
2014-12-04  0:13 [GIT PULL][RESEND] hw_breakpoints: Support AMD range breakpoints Frederic Weisbecker
2014-12-04  0:13 ` [PATCH 3/4] perf tools: add hardware breakpoint bp_len test cases Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386764906-1681-4-git-send-email-suravee.suthikulpanit@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jacob.w.shin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=sherry.hurwitz@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®