From patchwork Mon Jun 16 08:38:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tim.gore@intel.com X-Patchwork-Id: 4356801 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8EA119F26E for ; Mon, 16 Jun 2014 08:38:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EF812025A for ; Mon, 16 Jun 2014 08:38:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 54D7220109 for ; Mon, 16 Jun 2014 08:38:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAEE16E24B; Mon, 16 Jun 2014 01:38:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 804B76E24B for ; Mon, 16 Jun 2014 01:38:12 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Jun 2014 01:32:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,485,1400050800"; d="scan'208";a="558106516" Received: from tgore-linux.iwi.intel.com ([172.28.253.145]) by orsmga002.jf.intel.com with ESMTP; 16 Jun 2014 01:38:10 -0700 From: tim.gore@intel.com To: intel-gfx@lists.freedesktop.org Date: Mon, 16 Jun 2014 09:38:09 +0100 Message-Id: <1402907889-8050-1-git-send-email-tim.gore@intel.com> X-Mailer: git-send-email 1.9.2 Subject: [Intel-gfx] [PATCH] intel-gpu-tools: remove the --cmd option from gem_seqno_wrap X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tim Gore gem_seqno_wrap was not being built on Android because it uses wordexp which is not in Bionic. After discussion with Mika Kuoppala (the test author) it seems that wordexp was used to implement the --cmd option that was really only intended for use during development of the test and is no longer needed. So I have removed support for this option and enabled this test for Android. Signed-off-by: Tim Gore Reviewed-by: Mika Kuoppala --- tests/Android.mk | 1 - tests/gem_seqno_wrap.c | 77 ++------------------------------------------------ 2 files changed, 3 insertions(+), 75 deletions(-) diff --git a/tests/Android.mk b/tests/Android.mk index 9db6625..f085d35 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -28,7 +28,6 @@ endef # some tests still do not build under android skip_tests_list := -skip_tests_list += gem_seqno_wrap skip_tests_list += testdisplay # needs glib.h skip_tests_list += pm_rpm diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c index fa38f1f..ad4f839 100644 --- a/tests/gem_seqno_wrap.c +++ b/tests/gem_seqno_wrap.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -62,7 +61,6 @@ static struct intel_batchbuffer *batch_3d; struct option_struct { int rounds; int background; - char cmd[1024]; int timeout; int dontwrap; int prewrap_space; @@ -281,64 +279,6 @@ static void run_sync_test(int num_buffers, bool verify) close(fd); } -static int run_cmd(char *s) -{ - int pid; - int r = -1; - int status = 0; - wordexp_t wexp; - int i; - r = wordexp(s, &wexp, 0); - if (r != 0) { - printf("can't parse %s\n", s); - return r; - } - - for(i = 0; i < wexp.we_wordc; i++) - printf("argv[%d] = %s\n", i, wexp.we_wordv[i]); - - pid = fork(); - - if (pid == 0) { - char path[PATH_MAX]; - char full_path[PATH_MAX]; - - if (getcwd(path, PATH_MAX) == NULL) - perror("getcwd"); - - igt_assert(snprintf(full_path, PATH_MAX, "%s/%s", path, wexp.we_wordv[0]) > 0); - - r = execv(full_path, wexp.we_wordv); - if (r == -1) - perror("execv failed"); - } else { - int waitcount = options.timeout; - - while(waitcount-- > 0) { - r = waitpid(pid, &status, WNOHANG); - if (r == pid) { - if(WIFEXITED(status)) { - if (WEXITSTATUS(status)) - fprintf(stderr, - "child returned with %d\n", - WEXITSTATUS(status)); - return WEXITSTATUS(status); - } - } else if (r != 0) { - perror("waitpid"); - return -errno; - } - - sleep(3); - } - - kill(pid, SIGKILL); - return -ETIMEDOUT; - } - - return r; -} - static const char *dfs_base = "/sys/kernel/debug/dri"; static const char *dfs_entry = "i915_next_seqno"; @@ -415,7 +355,7 @@ static int write_seqno(uint32_t seqno) int fh; char buf[32]; int r; - uint32_t rb; + uint32_t rb = -1; if (options.dontwrap) return 0; @@ -461,10 +401,7 @@ static uint32_t calc_prewrap_val(void) static void run_test(void) { - if (strnlen(options.cmd, sizeof(options.cmd)) > 0) - igt_assert(run_cmd(options.cmd) == 0); - else - run_sync_test(options.buffers, true); + run_sync_test(options.buffers, true); } static void preset_run_once(void) @@ -521,7 +458,6 @@ static void print_usage(const char *s) printf("%s: [OPTION]...\n", s); printf(" where options are:\n"); printf(" -b --background run in background inducing wraps\n"); - printf(" -c --cmd=cmdstring use cmdstring to cross wrap\n"); printf(" -n --rounds=num run num times across wrap boundary, 0 == forever\n"); printf(" -t --timeout=sec set timeout to wait for testrun to sec seconds\n"); printf(" -d --dontwrap don't wrap just run the test\n"); @@ -536,7 +472,6 @@ static void parse_options(int argc, char **argv) int c; int option_index = 0; static struct option long_options[] = { - {"cmd", required_argument, 0, 'c'}, {"rounds", required_argument, 0, 'n'}, {"background", no_argument, 0, 'b'}, {"timeout", required_argument, 0, 't'}, @@ -546,7 +481,6 @@ static void parse_options(int argc, char **argv) {"buffers", required_argument, 0, 'i'}, }; - strcpy(options.cmd, ""); options.rounds = SLOW_QUICK(50, 2); options.background = 0; options.dontwrap = 0; @@ -555,7 +489,7 @@ static void parse_options(int argc, char **argv) options.prewrap_space = 21; options.buffers = 10; - while((c = getopt_long(argc, argv, "c:n:bvt:dp:ri:", + while((c = getopt_long(argc, argv, "n:bvt:dp:ri:", long_options, &option_index)) != -1) { switch(c) { case 'b': @@ -570,11 +504,6 @@ static void parse_options(int argc, char **argv) options.rounds = atoi(optarg); printf("running %d rounds\n", options.rounds); break; - case 'c': - strncpy(options.cmd, optarg, sizeof(options.cmd) - 1); - options.cmd[sizeof(options.cmd) - 1] = 0; - printf("cmd set to %s\n", options.cmd); - break; case 'i': options.buffers = atoi(optarg); printf("buffers %d\n", options.buffers);