Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349986
b: refs/heads/master
c: 2ae8287
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Jan 24, 2013
1 parent 2ee358f commit 2f89b82
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffe0fb769a6db3b6027d9228b6fecb6b352e4834
refs/heads/master: 2ae828786c65ab8f587647bd0f22f8fe00f1f238
4 changes: 4 additions & 0 deletions trunk/tools/perf/Documentation/perf-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ from 'perf test list'.

OPTIONS
-------
-s::
--skip::
Tests to skip (comma separater numeric list).

-v::
--verbose::
Be more verbose.
17 changes: 15 additions & 2 deletions trunk/tools/perf/tests/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Builtin regression testing command: ever growing number of sanity tests
*/
#include "builtin.h"
#include "intlist.h"
#include "tests.h"
#include "debug.h"
#include "color.h"
Expand Down Expand Up @@ -105,7 +106,7 @@ static bool perf_test__matches(int curr, int argc, const char *argv[])
return false;
}

static int __cmd_test(int argc, const char *argv[])
static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
{
int i = 0;
int width = 0;
Expand All @@ -126,6 +127,12 @@ static int __cmd_test(int argc, const char *argv[])
continue;

pr_info("%2d: %-*s:", i, width, tests[curr].desc);

if (intlist__find(skiplist, i)) {
color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n");
continue;
}

pr_debug("\n--- start ---\n");
err = tests[curr].func();
pr_debug("---- end ----\n%s:", tests[curr].desc);
Expand Down Expand Up @@ -169,11 +176,14 @@ int cmd_test(int argc, const char **argv, const char *prefix __maybe_unused)
"perf test [<options>] [{list <test-name-fragment>|[<test-name-fragments>|<test-numbers>]}]",
NULL,
};
const char *skip = NULL;
const struct option test_options[] = {
OPT_STRING('s', "skip", &skip, "tests", "tests to skip"),
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show symbol address, etc)"),
OPT_END()
};
struct intlist *skiplist = NULL;

argc = parse_options(argc, argv, test_options, test_usage, 0);
if (argc >= 1 && !strcmp(argv[0], "list"))
Expand All @@ -186,5 +196,8 @@ int cmd_test(int argc, const char **argv, const char *prefix __maybe_unused)
if (symbol__init() < 0)
return -1;

return __cmd_test(argc, argv);
if (skip != NULL)
skiplist = intlist__new(skip);

return __cmd_test(argc, argv, skiplist);
}

0 comments on commit 2f89b82

Please sign in to comment.