tests/gem_seqno_wrap: use igt logging

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2014-02-13 14:12:03 +01:00
parent 46ec3ef1f8
commit c88f898c57

View File

@ -58,7 +58,6 @@ struct option_struct {
int rounds; int rounds;
int background; int background;
char cmd[1024]; char cmd[1024];
int verbose;
int timeout; int timeout;
int dontwrap; int dontwrap;
int prewrap_space; int prewrap_space;
@ -318,12 +317,6 @@ static int run_cmd(char *s)
igt_assert(snprintf(full_path, PATH_MAX, "%s/%s", path, wexp.we_wordv[0]) > 0); igt_assert(snprintf(full_path, PATH_MAX, "%s/%s", path, wexp.we_wordv[0]) > 0);
/* if (!options.verbose) {
close(STDOUT_FILENO);
close(STDERR_FILENO);
}
*/
r = execv(full_path, wexp.we_wordv); r = execv(full_path, wexp.we_wordv);
if (r == -1) if (r == -1)
perror("execv failed"); perror("execv failed");
@ -404,8 +397,7 @@ static int __read_seqno(uint32_t *seqno)
*seqno = tmp; *seqno = tmp;
if (options.verbose) igt_debug("next_seqno: 0x%x\n", *seqno);
printf("next_seqno: 0x%x\n", *seqno);
return 0; return 0;
} }
@ -449,8 +441,7 @@ static int write_seqno(uint32_t seqno)
last_seqno = seqno; last_seqno = seqno;
if (options.verbose) igt_debug("next_seqno set to: 0x%x\n", seqno);
printf("next_seqno set to: 0x%x\n", seqno);
r = __read_seqno(&rb); r = __read_seqno(&rb);
if (r < 0) if (r < 0)
@ -564,7 +555,6 @@ static void parse_options(int argc, char **argv)
{"background", no_argument, 0, 'b'}, {"background", no_argument, 0, 'b'},
{"timeout", required_argument, 0, 't'}, {"timeout", required_argument, 0, 't'},
{"dontwrap", no_argument, 0, 'd'}, {"dontwrap", no_argument, 0, 'd'},
{"verbose", no_argument, 0, 'v'},
{"prewrap", required_argument, 0, 'p'}, {"prewrap", required_argument, 0, 'p'},
{"norandom", no_argument, 0, 'r'}, {"norandom", no_argument, 0, 'r'},
{"buffers", required_argument, 0, 'i'}, {"buffers", required_argument, 0, 'i'},
@ -575,7 +565,6 @@ static void parse_options(int argc, char **argv)
options.background = 0; options.background = 0;
options.dontwrap = 0; options.dontwrap = 0;
options.timeout = 20; options.timeout = 20;
options.verbose = 0;
options.random = 1; options.random = 1;
options.prewrap_space = 21; options.prewrap_space = 21;
options.buffers = 10; options.buffers = 10;
@ -611,9 +600,6 @@ static void parse_options(int argc, char **argv)
printf("setting timeout to %d seconds\n", printf("setting timeout to %d seconds\n",
options.timeout); options.timeout);
break; break;
case 'v':
options.verbose = 1;
break;
case 'r': case 'r':
options.random = 0; options.random = 0;
break; break;
@ -660,16 +646,12 @@ int main(int argc, char **argv)
wcount++; wcount++;
if (options.verbose) { igt_debug("%s done: %d\n",
printf("%s done: %d\n", options.dontwrap ? "tests" : "wraps", wcount);
options.dontwrap ? "tests" : "wraps", wcount);
fflush(stdout);
}
} }
if (options.rounds == wcount) { if (options.rounds == wcount) {
if (options.verbose) igt_debug("done %d wraps successfully\n", wcount);
printf("done %d wraps successfully\n", wcount);
return 0; return 0;
} }