mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH 13/13] perf test: Add attr tests under builtin test command
Date: Fri, 24 Aug 2012 11:00:44 +0200	[thread overview]
Message-ID: <1345798844-27423-14-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1345798844-27423-1-git-send-email-jolsa@redhat.com>

The test attr suite is run only if it's run under perf source
directory, because test attr files are not installed.

If run elsewhere, tests are ommited (notification is displayed)
and finished as successfull.

Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
 tools/perf/builtin-test.c   |  4 ++++
 tools/perf/perf.h           |  1 +
 tools/perf/util/test-attr.c | 14 ++++++++++++++
 3 files changed, 19 insertions(+)

diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 381d5ab..f2d3c50 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -1135,6 +1135,10 @@ static struct test {
 		.func = dso__test_data,
 	},
 	{
+		.desc = "Test perf attr",
+		.func = test_attr__run,
+	},
+	{
 		.func = NULL,
 	},
 };
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index a67bb75..2039774 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -174,6 +174,7 @@ void test_attr__init(void);
 int  test_attr__open(struct perf_event_attr *attr,
 		     pid_t pid, int cpu, int group_fd,
 		     unsigned long flags);
+int test_attr__run(void);
 
 static inline int
 sys_perf_event_open(struct perf_event_attr *attr,
diff --git a/tools/perf/util/test-attr.c b/tools/perf/util/test-attr.c
index dd83954..eb610f7 100644
--- a/tools/perf/util/test-attr.c
+++ b/tools/perf/util/test-attr.c
@@ -126,3 +126,17 @@ int test_attr__open(struct perf_event_attr *attr,
 
 	return fd;
 }
+
+int test_attr__run(void)
+{
+	struct stat st;
+	const char *run;
+
+	run = "python ./util/test-attr.py -d ./util/test-attr/ -p ./perf";
+
+	if (!lstat("./util/", &st))
+		return system(run);
+
+	fprintf(stderr, " (ommitted)");
+	return 0;
+}
-- 
1.7.11.4


  parent reply	other threads:[~2012-08-24  9:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24  9:00 [RFC 00/13] perf test: Add perf_event_attr tests Jiri Olsa
2012-08-24  9:00 ` [PATCH 01/13] perf test: Add framework for atomated " Jiri Olsa
2012-08-24  9:00 ` [PATCH 02/13] perf test: Add perf_event_attr record basic test Jiri Olsa
2012-08-24  9:00 ` [PATCH 03/13] perf test: Add perf_event_attr record group test Jiri Olsa
2012-08-24  9:00 ` [PATCH 04/13] perf test: Add perf_event_attr record freq test Jiri Olsa
2012-08-24  9:00 ` [PATCH 05/13] perf test: Add perf_event_attr record count test Jiri Olsa
2012-08-24  9:00 ` [PATCH 06/13] perf test: Add perf_event_attr record graph test Jiri Olsa
2012-08-24  9:00 ` [PATCH 07/13] perf test: Add perf_event_attr record period test Jiri Olsa
2012-08-24  9:00 ` [PATCH 08/13] perf test: Add perf_event_attr record no samples test Jiri Olsa
2012-08-24  9:00 ` [PATCH 09/13] perf test: Add perf_event_attr record no-inherit test Jiri Olsa
2012-08-24  9:00 ` [PATCH 10/13] perf test: Add perf_event_attr stat basic test Jiri Olsa
2012-08-24  9:00 ` [PATCH 11/13] perf test: Add perf_event_attr stat no-inherit test Jiri Olsa
2012-08-24  9:00 ` [PATCH 12/13] perf test: Add perf_event_attr stat group test Jiri Olsa
2012-08-24  9:00 ` Jiri Olsa [this message]
2012-08-24 13:07 ` [RFC 00/13] perf test: Add perf_event_attr tests Arnaldo Carvalho de Melo
2012-08-24 18:12   ` Ingo Molnar

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=1345798844-27423-14-git-send-email-jolsa@redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /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®