From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH 1/2] advsync: Use '#include "api.h"' in litmus tests
Date: Sun, 9 Jul 2017 10:40:48 +0900 [thread overview]
Message-ID: <788721d8-eab0-e712-0cfb-5640e5a433ff@gmail.com> (raw)
In-Reply-To: <0f7d5b71-c960-6462-fc45-a83f757d88ee@gmail.com>
From 408b798755475f18285178c9a1f9f0c6bb2bd9ed Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Fri, 7 Jul 2017 21:13:01 +0900
Subject: [PATCH 1/2] advsync: Use '#include "api.h"' in litmus tests
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
CodeSamples/advsync/herd/C-SB+o-mb-o+o-mb-o.litmus | 4 +---
CodeSamples/advsync/herd/C-SB+o-o+o-o.litmus | 3 +--
CodeSamples/advsync/herd/Makefile | 14 ++++++++++++--
CodeSamples/advsync/herd/api.h | 8 ++++++++
4 files changed, 22 insertions(+), 7 deletions(-)
create mode 100644 CodeSamples/advsync/herd/api.h
diff --git a/CodeSamples/advsync/herd/C-SB+o-mb-o+o-mb-o.litmus b/CodeSamples/advsync/herd/C-SB+o-mb-o+o-mb-o.litmus
index c04e82f..1093329 100644
--- a/CodeSamples/advsync/herd/C-SB+o-mb-o+o-mb-o.litmus
+++ b/CodeSamples/advsync/herd/C-SB+o-mb-o+o-mb-o.litmus
@@ -3,9 +3,7 @@ C C-SB+o-mb-o+o-mb-o
}
{
-#define READ_ONCE(x) __atomic_load_n(&(x), __ATOMIC_RELAXED)
-#define WRITE_ONCE(x, v) __atomic_store_n(&(x), (v), __ATOMIC_RELAXED)
-#define smp_mb() __atomic_thread_fence(__ATOMIC_SEQ_CST)
+#include "api.h"
}
P0(int *x0, int *x1)
diff --git a/CodeSamples/advsync/herd/C-SB+o-o+o-o.litmus b/CodeSamples/advsync/herd/C-SB+o-o+o-o.litmus
index 47cc6dd..2e45ee6 100644
--- a/CodeSamples/advsync/herd/C-SB+o-o+o-o.litmus
+++ b/CodeSamples/advsync/herd/C-SB+o-o+o-o.litmus
@@ -3,8 +3,7 @@ C C-SB+o-o+o-o
}
{
-#define READ_ONCE(x) __atomic_load_n(&(x), __ATOMIC_RELAXED)
-#define WRITE_ONCE(x, v) __atomic_store_n(&(x), (v), __ATOMIC_RELAXED)
+#include "api.h"
}
P0(int *x0, int *x1)
diff --git a/CodeSamples/advsync/herd/Makefile b/CodeSamples/advsync/herd/Makefile
index 92986cd..7959063 100644
--- a/CodeSamples/advsync/herd/Makefile
+++ b/CodeSamples/advsync/herd/Makefile
@@ -1,4 +1,14 @@
-all: C-SB+o-o+o-o.litmus.out C-SB+o-mb-o+o-mb-o.litmus.out
+LITMUS := $(wildcard *.litmus)
+LITMUS_OUT = $(addsuffix .out,$(LITMUS))
+CCOPTS = -fomit-frame-pointer -O2
+CCOPTS += -I$(shell pwd)
+
+.PHONY: all clean
+
+all: $(LITMUS_OUT)
%.litmus.out: %.litmus
- litmus7 -r 1000 -carch X86 $< > $@ 2>&1
+ litmus7 -r 1000 -carch X86 -ccopts "$(CCOPTS)" $< > $@ 2>&1
+
+clean:
+ rm -f *.out
diff --git a/CodeSamples/advsync/herd/api.h b/CodeSamples/advsync/herd/api.h
new file mode 100644
index 0000000..8326835
--- /dev/null
+++ b/CodeSamples/advsync/herd/api.h
@@ -0,0 +1,8 @@
+#ifndef __API_H__
+#define __API_H__
+#ifndef READ_ONCE
+#define READ_ONCE(x) __atomic_load_n(&(x), __ATOMIC_RELAXED)
+#define WRITE_ONCE(x, v) __atomic_store_n(&(x), (v), __ATOMIC_RELAXED)
+#define smp_mb() __atomic_thread_fence(__ATOMIC_SEQ_CST)
+#endif
+#endif
--
2.7.4
next prev parent reply other threads:[~2017-07-09 1:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-09 1:39 [PATCH 0/2] litmus test updates Akira Yokosawa
2017-07-09 1:40 ` Akira Yokosawa [this message]
2017-07-09 1:41 ` [PATCH 2/2] advsync: Add cross compilation targets Akira Yokosawa
2017-07-09 19:26 ` [PATCH 0/2] litmus test updates Paul E. McKenney
2017-07-10 22:14 ` Akira Yokosawa
2017-07-11 0:06 ` Paul E. McKenney
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=788721d8-eab0-e712-0cfb-5640e5a433ff@gmail.com \
--to=akiyks@gmail.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=perfbook@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.