Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: [patch]: Improve spu-info testcase
Date: Fri, 20 Jun 2008 12:23:00 -0000	[thread overview]
Message-ID: <485B34CC.70401@de.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

Hello,

if multiple users on the same machine run the testsuite for spu-gdb, gdb.arch/spu-info will fail because of 
access priviliges to the temporary file. This file is created in /var/tmp currently. With this patch I changed
the naming of the file (using speid to seperate different runs) and the location (user dir).

Ok ?


ChangeLog:

	* gdb.arch/spu-info.c  (do_dma_test): Add speid paramter. Change name
	of temporary file to include speid. Delete it after use.
	(main): Update call to do_dma_test.



-- 
  Markus Deuling
  GNU Toolchain for Linux on Cell BE
  deuling@de.ibm.com


[-- Attachment #2: diff-spu-info --]
[-- Type: text/plain, Size: 1329 bytes --]

diff -urpN src-orig/gdb/testsuite/gdb.arch/spu-info.c src/gdb/testsuite/gdb.arch/spu-info.c
--- src-orig/gdb/testsuite/gdb.arch/spu-info.c	2008-01-01 23:53:18.000000000 +0100
+++ src/gdb/testsuite/gdb.arch/spu-info.c	2008-06-20 06:32:20.000000000 +0200
@@ -124,19 +124,20 @@ do_event_test ()
 }
 
 int
-do_dma_test ()
+do_dma_test (unsigned long long speid)
 {
   #define MAP_FAILED      (-1ULL)
   #define PROT_READ       0x1
   #define MAP_PRIVATE     0x002
   #define BSIZE 128
   static char buf[BSIZE] __attribute__ ((aligned (128)));
-  char *file = "/var/tmp/tmp_buf";
+  char file[32];
   struct stat fdstat;
   int fd, cnt;
   unsigned long long src;
 
   /* Create a file and fill it with some bytes.  */
+  snprintf (file, sizeof(file), "tmp_buf_%lld", speid);
   fd = open (file, O_CREAT | O_RDWR | O_TRUNC, 0777);
   if (fd == -1)
     return -1;
@@ -158,8 +159,9 @@ do_dma_test ()
   mfc_write_tag_mask (1<<5);   /* Marker DMAWait */
   spu_mfcstat (MFC_TAG_UPDATE_ALL);
 
-  /* Close the file.  */
+  /* Close and delete the file.  */
   close (fd);
+  unlink (file);
 
   return cnt;
 }
@@ -221,7 +223,7 @@ main (unsigned long long speid, unsigned
   res = do_event_test ();
 
   /* info spu dma  */
-  res = do_dma_test ();
+  res = do_dma_test (speid);
 
   /* info spu mailbox  */
   res = do_mailbox_test ();

             reply	other threads:[~2008-06-20  4:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 12:23 Markus Deuling [this message]
2008-06-24 19:30 ` Ulrich Weigand
2008-06-25 12:43   ` Markus Deuling
2008-07-16 19:29     ` Ulrich Weigand

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=485B34CC.70401@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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