[Xenomai-git] Philippe Gerum : utils/autotune: force affinity to the same CPU for all threads

2015-10-06 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: e142e0716f530691ff6eb2ad776868174af82de1
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e142e0716f530691ff6eb2ad776868174af82de1

Author: Philippe Gerum 
Date:   Tue Aug 25 18:46:27 2015 +0200

utils/autotune: force affinity to the same CPU for all threads

To get consistent results, we want both the load generator and the
sampler to run on the same CPU. Force the scheduling affinity to
CPU#0.

---

 utils/autotune/autotune.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/utils/autotune/autotune.c b/utils/autotune/autotune.c
index bbd16c7..a403e34 100644
--- a/utils/autotune/autotune.c
+++ b/utils/autotune/autotune.c
@@ -237,6 +237,7 @@ int main(int argc, char *const argv[])
 {
int fd, period, ret, c, lindex, tuned = 0;
pthread_t load_pth;
+   cpu_set_t cpu_set;
time_t start;
 
period = CONFIG_XENO_DEFAULT_PERIOD;
@@ -273,6 +274,12 @@ int main(int argc, char *const argv[])
}
}
 
+   CPU_ZERO(_set);
+   CPU_SET(0, _set);
+   ret = sched_setaffinity(0, sizeof(cpu_set), _set);
+   if (ret)
+   error(1, errno, "cannot set CPU affinity");
+
if (background) {
ret = daemon(0, 0);
if (ret)


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : utils/autotune: force affinity to the same CPU for all threads

2015-10-03 Thread git repository hosting
Module: xenomai-3
Branch: arm64
Commit: e142e0716f530691ff6eb2ad776868174af82de1
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e142e0716f530691ff6eb2ad776868174af82de1

Author: Philippe Gerum 
Date:   Tue Aug 25 18:46:27 2015 +0200

utils/autotune: force affinity to the same CPU for all threads

To get consistent results, we want both the load generator and the
sampler to run on the same CPU. Force the scheduling affinity to
CPU#0.

---

 utils/autotune/autotune.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/utils/autotune/autotune.c b/utils/autotune/autotune.c
index bbd16c7..a403e34 100644
--- a/utils/autotune/autotune.c
+++ b/utils/autotune/autotune.c
@@ -237,6 +237,7 @@ int main(int argc, char *const argv[])
 {
int fd, period, ret, c, lindex, tuned = 0;
pthread_t load_pth;
+   cpu_set_t cpu_set;
time_t start;
 
period = CONFIG_XENO_DEFAULT_PERIOD;
@@ -273,6 +274,12 @@ int main(int argc, char *const argv[])
}
}
 
+   CPU_ZERO(_set);
+   CPU_SET(0, _set);
+   ret = sched_setaffinity(0, sizeof(cpu_set), _set);
+   if (ret)
+   error(1, errno, "cannot set CPU affinity");
+
if (background) {
ret = daemon(0, 0);
if (ret)


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : utils/autotune: force affinity to the same CPU for all threads

2015-08-26 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: e142e0716f530691ff6eb2ad776868174af82de1
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e142e0716f530691ff6eb2ad776868174af82de1

Author: Philippe Gerum r...@xenomai.org
Date:   Tue Aug 25 18:46:27 2015 +0200

utils/autotune: force affinity to the same CPU for all threads

To get consistent results, we want both the load generator and the
sampler to run on the same CPU. Force the scheduling affinity to
CPU#0.

---

 utils/autotune/autotune.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/utils/autotune/autotune.c b/utils/autotune/autotune.c
index bbd16c7..a403e34 100644
--- a/utils/autotune/autotune.c
+++ b/utils/autotune/autotune.c
@@ -237,6 +237,7 @@ int main(int argc, char *const argv[])
 {
int fd, period, ret, c, lindex, tuned = 0;
pthread_t load_pth;
+   cpu_set_t cpu_set;
time_t start;
 
period = CONFIG_XENO_DEFAULT_PERIOD;
@@ -273,6 +274,12 @@ int main(int argc, char *const argv[])
}
}
 
+   CPU_ZERO(cpu_set);
+   CPU_SET(0, cpu_set);
+   ret = sched_setaffinity(0, sizeof(cpu_set), cpu_set);
+   if (ret)
+   error(1, errno, cannot set CPU affinity);
+
if (background) {
ret = daemon(0, 0);
if (ret)


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git