linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rt-tests 0/4] build tweaks and a bug fix
@ 2015-08-28  0:19 Josh Cartwright
  2015-08-28  0:19 ` [PATCH rt-tests 1/4] rt-tests: Allow for user-specified PYLIB Josh Cartwright
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Josh Cartwright @ 2015-08-28  0:19 UTC (permalink / raw)
  To: Clark Williams, John Kacur
  Cc: linux-rt-users, Darren Hart, Robert Yang, Kai Kang, Song.Li,
	Jesse Zhang

Hey John, Clark-

This series has a few minor rt-tests tweaks that make it a bit easier to build
and package rt-tests for the bizarro build demands in the embedded space.  With
a bug fix thrown in for good measure.

The first patch breaks the assumption that build host == target; the second
patch allows a packager to more easily split hwlatdetect into a separate
package.  (Both of these patches are unchanged since Darren's original
submission in 2012[1]).

The third patch works around crappy gzip implementations.

The forth patch fixes a hypothetical (as far as I know) bug in hackbench's
error handling.

A form of all of these patches has been carried out-of-tree in the OpenEmbedded
project for years now :(.  They are more widely useful; as such, it's time to
land them in rt-tests proper.

Thanks,
  Josh

1: http://permalink.gmane.org/gmane.linux.rt.user/8749

Cc: Darren Hart <dvhart@linux.intel.com>
Cc: Robert Yang <liezhi.yang@windriver.com>
Cc: Kai Kang <kai.kang@windriver.com>
Cc: Song.Li <Song.Li@windriver.com>
Cc: Jesse Zhang <sen.zhang@windriver.com>

Darren Hart (2):
  rt-tests: Allow for user-specified PYLIB
  rt-tests: Break out install_hwlatdetect

Josh Cartwright (2):
  rt-tests: workaround poor gzip implementations
  hackbench: cleanup error handling in create_worker

 Makefile                  | 32 ++++++++++++++++++--------------
 src/hackbench/hackbench.c | 36 +++++++++++++++---------------------
 2 files changed, 33 insertions(+), 35 deletions(-)

-- 
2.5.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH rt-tests 1/4] rt-tests: Allow for user-specified PYLIB
  2015-08-28  0:19 [PATCH rt-tests 0/4] build tweaks and a bug fix Josh Cartwright
@ 2015-08-28  0:19 ` Josh Cartwright
  2015-09-02 12:53   ` John Kacur
  2015-08-28  0:19 ` [PATCH rt-tests 2/4] rt-tests: Break out install_hwlatdetect Josh Cartwright
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Josh Cartwright @ 2015-08-28  0:19 UTC (permalink / raw)
  To: Clark Williams, John Kacur; +Cc: linux-rt-users, Darren Hart

From: Darren Hart <dvhart@linux.intel.com>

Allow users (build systems) to specify PYLIB. This allows for a
cross-build-system to specify the target PYLIB rather than the host
PYLIB.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Clark Williams <williams@redhat.com>
CC: John Kacur <jkacur@redhat.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a48e759..1ec7f6a 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ ifdef HAVE_PARSE_CPUSTRING_ALL
 endif
 endif
 
-PYLIB  := $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
+PYLIB  ?= $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
 
 ifndef DEBUG
 	CFLAGS	+= -O2
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH rt-tests 2/4] rt-tests: Break out install_hwlatdetect
  2015-08-28  0:19 [PATCH rt-tests 0/4] build tweaks and a bug fix Josh Cartwright
  2015-08-28  0:19 ` [PATCH rt-tests 1/4] rt-tests: Allow for user-specified PYLIB Josh Cartwright
@ 2015-08-28  0:19 ` Josh Cartwright
  2015-09-02 12:56   ` John Kacur
  2015-08-28  0:19 ` [PATCH rt-tests 3/4] rt-tests: workaround poor gzip implementations Josh Cartwright
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Josh Cartwright @ 2015-08-28  0:19 UTC (permalink / raw)
  To: Clark Williams, John Kacur; +Cc: linux-rt-users, Darren Hart

From: Darren Hart <dvhart@linux.intel.com>

Allow hwlatdetect to be installed independently of the rest of the
tests. This is convenient for build systems that package it separately
due to the python dependency.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Clark Williams <williams@redhat.com>
CC: John Kacur <jkacur@redhat.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
---
 Makefile | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 1ec7f6a..e5a9942 100644
--- a/Makefile
+++ b/Makefile
@@ -131,21 +131,15 @@ changelog:
 	git log >ChangeLog
 
 .PHONY: install
-install: all
+install: all install_hwlatdetect
 	mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man4"
 	mkdir -p "$(DESTDIR)$(srcdir)" "$(DESTDIR)$(mandir)/man8"
 	cp $(TARGETS) "$(DESTDIR)$(bindir)"
-	if test -n "$(PYLIB)" ; then \
-		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
-		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-	fi
 	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
 	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
 	gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
 	gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
 	gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
-	gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz"
 	gzip src/ptsematest/ptsematest.8 -c >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
 	gzip src/sigwaittest/sigwaittest.8 -c >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
 	gzip src/svsematest/svsematest.8 -c >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
@@ -153,6 +147,16 @@ install: all
 	gzip src/backfire/sendme.8 -c >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
 	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
 
+.PHONY: install_hwlatdetect
+install_hwlatdetect: hwlatdetect
+	if test -n "$(PYLIB)" ; then \
+		mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
+		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
+		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+		gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
+	fi
+
 .PHONY: release
 release: distclean changelog
 	mkdir -p releases
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH rt-tests 3/4] rt-tests: workaround poor gzip implementations
  2015-08-28  0:19 [PATCH rt-tests 0/4] build tweaks and a bug fix Josh Cartwright
  2015-08-28  0:19 ` [PATCH rt-tests 1/4] rt-tests: Allow for user-specified PYLIB Josh Cartwright
  2015-08-28  0:19 ` [PATCH rt-tests 2/4] rt-tests: Break out install_hwlatdetect Josh Cartwright
@ 2015-08-28  0:19 ` Josh Cartwright
  2015-09-02 12:58   ` John Kacur
  2015-08-28  0:19 ` [PATCH rt-tests 4/4] hackbench: cleanup error handling in create_worker Josh Cartwright
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Josh Cartwright @ 2015-08-28  0:19 UTC (permalink / raw)
  To: Clark Williams, John Kacur; +Cc: linux-rt-users, Robert Yang, Kai Kang

Some 'gzip' implementations, in particular 'pigz' don't properly handle
the '-c' argument if it's passed after the name of the input files.

Work around this by putting the '-c' option before the file names.

Inspired by patches in OpenEmbedded by Robert Yang and Kai Kang.

Cc: Robert Yang <liezhi.yang@windriver.com>
Cc: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
---
 Makefile | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index e5a9942..5c4dd04 100644
--- a/Makefile
+++ b/Makefile
@@ -137,15 +137,15 @@ install: all install_hwlatdetect
 	cp $(TARGETS) "$(DESTDIR)$(bindir)"
 	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
 	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
-	gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
-	gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
-	gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
-	gzip src/ptsematest/ptsematest.8 -c >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
-	gzip src/sigwaittest/sigwaittest.8 -c >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
-	gzip src/svsematest/svsematest.8 -c >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
-	gzip src/pmqtest/pmqtest.8 -c >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
-	gzip src/backfire/sendme.8 -c >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
-	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
+	gzip -c src/backfire/backfire.4 >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
+	gzip -c src/cyclictest/cyclictest.8 >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
+	gzip -c src/pi_tests/pi_stress.8 >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
+	gzip -c src/ptsematest/ptsematest.8 >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
+	gzip -c src/sigwaittest/sigwaittest.8 >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
+	gzip -c src/svsematest/svsematest.8 >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
+	gzip -c src/pmqtest/pmqtest.8 >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
+	gzip -c src/backfire/sendme.8 >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
+	gzip -c src/hackbench/hackbench.8 >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
 
 .PHONY: install_hwlatdetect
 install_hwlatdetect: hwlatdetect
@@ -154,7 +154,7 @@ install_hwlatdetect: hwlatdetect
 		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
 		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
 		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-		gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
+		gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
 	fi
 
 .PHONY: release
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH rt-tests 4/4] hackbench: cleanup error handling in create_worker
  2015-08-28  0:19 [PATCH rt-tests 0/4] build tweaks and a bug fix Josh Cartwright
                   ` (2 preceding siblings ...)
  2015-08-28  0:19 ` [PATCH rt-tests 3/4] rt-tests: workaround poor gzip implementations Josh Cartwright
@ 2015-08-28  0:19 ` Josh Cartwright
  2015-09-02 13:01   ` John Kacur
  2015-08-28 17:50 ` [PATCH rt-tests 0/4] build tweaks and a bug fix Clark Williams
  2015-08-28 17:54 ` Darren Hart
  5 siblings, 1 reply; 12+ messages in thread
From: Josh Cartwright @ 2015-08-28  0:19 UTC (permalink / raw)
  To: Clark Williams, John Kacur; +Cc: linux-rt-users, Song.Li, Jesse Zhang

The childinfo_t union shares the 'long long error' member with a
'pthread_t threadid'.  For a "sufficiently large" threadid, it's
possible that the error condition is incorrectly hit even though a valid
thread was created.

Stop conflating the error condition with legitimate thread/process
identifiers by modifying create_worker to explicitly return an error
code.

Inspired by a patch in OpenEmbedded authored by Song Li and Jesse Zhang.

Cc: Song.Li <Song.Li@windriver.com>
Cc: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Josh Cartwright <joshc@ni.com>
---
 src/hackbench/hackbench.c | 36 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 21 deletions(-)

diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c
index c42257c..ba804f5 100644
--- a/src/hackbench/hackbench.c
+++ b/src/hackbench/hackbench.c
@@ -64,7 +64,6 @@ struct receiver_context {
 typedef union {
 	pthread_t threadid;
 	pid_t	  pid;
-	long long error;
 } childinfo_t;
 
 childinfo_t *child_tab = NULL;
@@ -189,52 +188,44 @@ again:
 	return NULL;
 }
 
-static childinfo_t create_worker(void *ctx, void *(*func)(void *))
+static int create_worker(childinfo_t *child, void *ctx, void *(*func)(void *))
 {
 	pthread_attr_t attr;
 	int err;
-	childinfo_t child;
-	pid_t childpid;
 
-	memset(&child, 0, sizeof(child));
 	switch (process_mode) {
 	case PROCESS_MODE: /* process mode */
 		/* Fork the sender/receiver child. */
-		switch ((childpid = fork())) {
+		switch ((child->pid = fork())) {
 			case -1:
 				sneeze("fork()");
-				child.error = -1;
-				return child;
+				return -1;
 			case 0:
 				(*func) (ctx);
 				exit(0);
 		}
-		child.pid = childpid;
 		break;
 
 	case THREAD_MODE: /* threaded mode */
 		if (pthread_attr_init(&attr) != 0) {
 			sneeze("pthread_attr_init()");
-			child.error = -1;
-			return child;
+			return -1;
 		}
 
 #ifndef __ia64__
 		if (pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN) != 0) {
 			sneeze("pthread_attr_setstacksize()");
-			child.error = -1;
-			return child;
+			return -1;
 		}
 #endif
 
-		if ((err=pthread_create(&child.threadid, &attr, func, ctx)) != 0) {
+		if ((err=pthread_create(&child->threadid, &attr, func, ctx)) != 0) {
 			sneeze("pthread_create failed()");
-			child.error = -1;
-			return child;
+			return -1;
 		}
 		break;
 	}
-	return child;
+	return 0;
 }
 
 void signal_workers(childinfo_t *children, unsigned int num_children)
@@ -291,6 +282,7 @@ static unsigned int group(childinfo_t *child,
 	unsigned int i;
 	struct sender_context* snd_ctx = malloc (sizeof(struct sender_context)
 			+num_fds*sizeof(int));
+	int err;
 
 	if (!snd_ctx) {
 		sneeze("malloc() [sender ctx]");
@@ -317,8 +309,9 @@ static unsigned int group(childinfo_t *child,
 		ctx->ready_out = ready_out;
 		ctx->wakefd = wakefd;
 
-		child[tab_offset+i] = create_worker(ctx, (void *)(void *)receiver);
-		if( child[tab_offset+i].error < 0 ) {
+		err = create_worker(&child[tab_offset+i], ctx,
+				    (void *)(void *)receiver);
+		if(err) {
 			return (i > 0 ? i-1 : 0);
 		}
 		snd_ctx->out_fds[i] = fds[1];
@@ -332,8 +325,9 @@ static unsigned int group(childinfo_t *child,
 
 	/* Now we have all the fds, fork the senders */
 	for (i = 0; i < num_fds; i++) {
-		child[tab_offset+num_fds+i] = create_worker(snd_ctx, (void *)(void *)sender);
-		if( child[tab_offset+num_fds+i].error < 0 ) {
+		err = create_worker(&child[tab_offset+num_fds+i], snd_ctx,
+				    (void *)(void *)sender);
+		if(err) {
 			return (num_fds+i)-1;
 		}
 	}
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH rt-tests 0/4] build tweaks and a bug fix
  2015-08-28  0:19 [PATCH rt-tests 0/4] build tweaks and a bug fix Josh Cartwright
                   ` (3 preceding siblings ...)
  2015-08-28  0:19 ` [PATCH rt-tests 4/4] hackbench: cleanup error handling in create_worker Josh Cartwright
@ 2015-08-28 17:50 ` Clark Williams
  2015-08-28 17:54 ` Darren Hart
  5 siblings, 0 replies; 12+ messages in thread
From: Clark Williams @ 2015-08-28 17:50 UTC (permalink / raw)
  To: Josh Cartwright
  Cc: John Kacur, linux-rt-users, Darren Hart, Robert Yang, Kai Kang,
	Song.Li, Jesse Zhang

On Thu, 27 Aug 2015 19:19:47 -0500
Josh Cartwright <joshc@ni.com> wrote:

> Hey John, Clark-
> 
> This series has a few minor rt-tests tweaks that make it a bit easier to build
> and package rt-tests for the bizarro build demands in the embedded space.  With
> a bug fix thrown in for good measure.
> 
> The first patch breaks the assumption that build host == target; the second
> patch allows a packager to more easily split hwlatdetect into a separate
> package.  (Both of these patches are unchanged since Darren's original
> submission in 2012[1]).
> 
> The third patch works around crappy gzip implementations.
> 
> The forth patch fixes a hypothetical (as far as I know) bug in hackbench's
> error handling.
> 
> A form of all of these patches has been carried out-of-tree in the OpenEmbedded
> project for years now :(.  They are more widely useful; as such, it's time to
> land them in rt-tests proper.
> 
> Thanks,
>   Josh
> 

These look reasonable to me Josh. I'll pull 'em in and we'll beat on
them for a while.

Clark

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH rt-tests 0/4] build tweaks and a bug fix
  2015-08-28  0:19 [PATCH rt-tests 0/4] build tweaks and a bug fix Josh Cartwright
                   ` (4 preceding siblings ...)
  2015-08-28 17:50 ` [PATCH rt-tests 0/4] build tweaks and a bug fix Clark Williams
@ 2015-08-28 17:54 ` Darren Hart
  2015-08-28 18:11   ` Josh Cartwright
  5 siblings, 1 reply; 12+ messages in thread
From: Darren Hart @ 2015-08-28 17:54 UTC (permalink / raw)
  To: Josh Cartwright
  Cc: Clark Williams, John Kacur, linux-rt-users, Darren Hart,
	Robert Yang, Kai Kang, Song.Li, Jesse Zhang

On Thu, Aug 27, 2015 at 07:19:47PM -0500, Josh Cartwright wrote:
> Hey John, Clark-
> 
> This series has a few minor rt-tests tweaks that make it a bit easier to build
> and package rt-tests for the bizarro build demands in the embedded space.  With
> a bug fix thrown in for good measure.
> 
> The first patch breaks the assumption that build host == target; the second
> patch allows a packager to more easily split hwlatdetect into a separate
> package.  (Both of these patches are unchanged since Darren's original
> submission in 2012[1]).

Yikes, did I not submit those to rt-tests? If not, shame on me!

> 
> The third patch works around crappy gzip implementations.
> 
> The forth patch fixes a hypothetical (as far as I know) bug in hackbench's
> error handling.
> 
> A form of all of these patches has been carried out-of-tree in the OpenEmbedded
> project for years now :(.  They are more widely useful; as such, it's time to
> land them in rt-tests proper.
> 
> Thanks,
>   Josh
> 
> 1: http://permalink.gmane.org/gmane.linux.rt.user/8749
> 
> Cc: Darren Hart <dvhart@linux.intel.com>
> Cc: Robert Yang <liezhi.yang@windriver.com>
> Cc: Kai Kang <kai.kang@windriver.com>
> Cc: Song.Li <Song.Li@windriver.com>
> Cc: Jesse Zhang <sen.zhang@windriver.com>
> 
> Darren Hart (2):
>   rt-tests: Allow for user-specified PYLIB
>   rt-tests: Break out install_hwlatdetect
> 

Re-Acked, thanks Josh.

-- 
Darren Hart
Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH rt-tests 0/4] build tweaks and a bug fix
  2015-08-28 17:54 ` Darren Hart
@ 2015-08-28 18:11   ` Josh Cartwright
  0 siblings, 0 replies; 12+ messages in thread
From: Josh Cartwright @ 2015-08-28 18:11 UTC (permalink / raw)
  To: Darren Hart
  Cc: Clark Williams, John Kacur, linux-rt-users, Darren Hart,
	Robert Yang, Kai Kang, Song.Li, Jesse Zhang

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

On Fri, Aug 28, 2015 at 10:54:00AM -0700, Darren Hart wrote:
> On Thu, Aug 27, 2015 at 07:19:47PM -0500, Josh Cartwright wrote:
> > Hey John, Clark-
> > 
> > This series has a few minor rt-tests tweaks that make it a bit easier to build
> > and package rt-tests for the bizarro build demands in the embedded space.  With
> > a bug fix thrown in for good measure.
> > 
> > The first patch breaks the assumption that build host == target; the second
> > patch allows a packager to more easily split hwlatdetect into a separate
> > package.  (Both of these patches are unchanged since Darren's original
> > submission in 2012[1]).
> 
> Yikes, did I not submit those to rt-tests? If not, shame on me!

Oh, you did!  The linked submission was to linux-rt-users.  Looks like
the patches just fell through the cracks.

[..]
> > Darren Hart (2):
> >   rt-tests: Allow for user-specified PYLIB
> >   rt-tests: Break out install_hwlatdetect
> > 
> 
> Re-Acked, thanks Josh.

Thanks!

  Josh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH rt-tests 1/4] rt-tests: Allow for user-specified PYLIB
  2015-08-28  0:19 ` [PATCH rt-tests 1/4] rt-tests: Allow for user-specified PYLIB Josh Cartwright
@ 2015-09-02 12:53   ` John Kacur
  0 siblings, 0 replies; 12+ messages in thread
From: John Kacur @ 2015-09-02 12:53 UTC (permalink / raw)
  To: Josh Cartwright; +Cc: Clark Williams, John Kacur, linux-rt-users, Darren Hart



On Thu, 27 Aug 2015, Josh Cartwright wrote:

> From: Darren Hart <dvhart@linux.intel.com>
> 
> Allow users (build systems) to specify PYLIB. This allows for a
> cross-build-system to specify the target PYLIB rather than the host
> PYLIB.
> 
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> CC: Clark Williams <williams@redhat.com>
> CC: John Kacur <jkacur@redhat.com>
> Signed-off-by: Josh Cartwright <joshc@ni.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index a48e759..1ec7f6a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -34,7 +34,7 @@ ifdef HAVE_PARSE_CPUSTRING_ALL
>  endif
>  endif
>  
> -PYLIB  := $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
> +PYLIB  ?= $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
>  
>  ifndef DEBUG
>  	CFLAGS	+= -O2
> -- 
> 2.5.0
> 

Nice. I see Clark has already grabbed this one.
Signed-off-by: John Kacur <jkacur@redhat.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH rt-tests 2/4] rt-tests: Break out install_hwlatdetect
  2015-08-28  0:19 ` [PATCH rt-tests 2/4] rt-tests: Break out install_hwlatdetect Josh Cartwright
@ 2015-09-02 12:56   ` John Kacur
  0 siblings, 0 replies; 12+ messages in thread
From: John Kacur @ 2015-09-02 12:56 UTC (permalink / raw)
  To: Josh Cartwright; +Cc: Clark Williams, John Kacur, linux-rt-users, Darren Hart



On Thu, 27 Aug 2015, Josh Cartwright wrote:

> From: Darren Hart <dvhart@linux.intel.com>
> 
> Allow hwlatdetect to be installed independently of the rest of the
> tests. This is convenient for build systems that package it separately
> due to the python dependency.
> 
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> CC: Clark Williams <williams@redhat.com>
> CC: John Kacur <jkacur@redhat.com>
> Signed-off-by: Josh Cartwright <joshc@ni.com>
> ---
>  Makefile | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 1ec7f6a..e5a9942 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -131,21 +131,15 @@ changelog:
>  	git log >ChangeLog
>  
>  .PHONY: install
> -install: all
> +install: all install_hwlatdetect
>  	mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man4"
>  	mkdir -p "$(DESTDIR)$(srcdir)" "$(DESTDIR)$(mandir)/man8"
>  	cp $(TARGETS) "$(DESTDIR)$(bindir)"
> -	if test -n "$(PYLIB)" ; then \
> -		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
> -		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> -		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> -	fi
>  	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
>  	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
>  	gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
>  	gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
>  	gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
> -	gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz"
>  	gzip src/ptsematest/ptsematest.8 -c >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
>  	gzip src/sigwaittest/sigwaittest.8 -c >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
>  	gzip src/svsematest/svsematest.8 -c >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
> @@ -153,6 +147,16 @@ install: all
>  	gzip src/backfire/sendme.8 -c >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
>  	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
>  
> +.PHONY: install_hwlatdetect
> +install_hwlatdetect: hwlatdetect
> +	if test -n "$(PYLIB)" ; then \
> +		mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
> +		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
> +		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> +		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> +		gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
> +	fi
> +
>  .PHONY: release
>  release: distclean changelog
>  	mkdir -p releases
> -- 
> 2.5.0

Signed-off-by: John Kacur <jkacur@redhat.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH rt-tests 3/4] rt-tests: workaround poor gzip implementations
  2015-08-28  0:19 ` [PATCH rt-tests 3/4] rt-tests: workaround poor gzip implementations Josh Cartwright
@ 2015-09-02 12:58   ` John Kacur
  0 siblings, 0 replies; 12+ messages in thread
From: John Kacur @ 2015-09-02 12:58 UTC (permalink / raw)
  To: Josh Cartwright
  Cc: Clark Williams, John Kacur, linux-rt-users, Robert Yang, Kai Kang



On Thu, 27 Aug 2015, Josh Cartwright wrote:

> Some 'gzip' implementations, in particular 'pigz' don't properly handle
> the '-c' argument if it's passed after the name of the input files.
> 
> Work around this by putting the '-c' option before the file names.
> 
> Inspired by patches in OpenEmbedded by Robert Yang and Kai Kang.
> 
> Cc: Robert Yang <liezhi.yang@windriver.com>
> Cc: Kai Kang <kai.kang@windriver.com>
> Signed-off-by: Josh Cartwright <joshc@ni.com>
> ---
>  Makefile | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index e5a9942..5c4dd04 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -137,15 +137,15 @@ install: all install_hwlatdetect
>  	cp $(TARGETS) "$(DESTDIR)$(bindir)"
>  	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
>  	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
> -	gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
> -	gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
> -	gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
> -	gzip src/ptsematest/ptsematest.8 -c >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
> -	gzip src/sigwaittest/sigwaittest.8 -c >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
> -	gzip src/svsematest/svsematest.8 -c >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
> -	gzip src/pmqtest/pmqtest.8 -c >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
> -	gzip src/backfire/sendme.8 -c >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
> -	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
> +	gzip -c src/backfire/backfire.4 >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
> +	gzip -c src/cyclictest/cyclictest.8 >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
> +	gzip -c src/pi_tests/pi_stress.8 >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
> +	gzip -c src/ptsematest/ptsematest.8 >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
> +	gzip -c src/sigwaittest/sigwaittest.8 >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
> +	gzip -c src/svsematest/svsematest.8 >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
> +	gzip -c src/pmqtest/pmqtest.8 >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
> +	gzip -c src/backfire/sendme.8 >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
> +	gzip -c src/hackbench/hackbench.8 >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
>  
>  .PHONY: install_hwlatdetect
>  install_hwlatdetect: hwlatdetect
> @@ -154,7 +154,7 @@ install_hwlatdetect: hwlatdetect
>  		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
>  		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
>  		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
> -		gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
> +		gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
>  	fi
>  
>  .PHONY: release
> -- 
> 2.5.0

Signed-off-by: John Kacur <jkacur@redhat.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH rt-tests 4/4] hackbench: cleanup error handling in create_worker
  2015-08-28  0:19 ` [PATCH rt-tests 4/4] hackbench: cleanup error handling in create_worker Josh Cartwright
@ 2015-09-02 13:01   ` John Kacur
  0 siblings, 0 replies; 12+ messages in thread
From: John Kacur @ 2015-09-02 13:01 UTC (permalink / raw)
  To: Josh Cartwright
  Cc: Clark Williams, John Kacur, linux-rt-users, Song.Li, Jesse Zhang



On Thu, 27 Aug 2015, Josh Cartwright wrote:

> The childinfo_t union shares the 'long long error' member with a
> 'pthread_t threadid'.  For a "sufficiently large" threadid, it's
> possible that the error condition is incorrectly hit even though a valid
> thread was created.
> 
> Stop conflating the error condition with legitimate thread/process
> identifiers by modifying create_worker to explicitly return an error
> code.
> 
> Inspired by a patch in OpenEmbedded authored by Song Li and Jesse Zhang.
> 
> Cc: Song.Li <Song.Li@windriver.com>
> Cc: Jesse Zhang <sen.zhang@windriver.com>
> Signed-off-by: Josh Cartwright <joshc@ni.com>
> ---
>  src/hackbench/hackbench.c | 36 +++++++++++++++---------------------
>  1 file changed, 15 insertions(+), 21 deletions(-)
> 
> diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c
> index c42257c..ba804f5 100644
> --- a/src/hackbench/hackbench.c
> +++ b/src/hackbench/hackbench.c
> @@ -64,7 +64,6 @@ struct receiver_context {
>  typedef union {
>  	pthread_t threadid;
>  	pid_t	  pid;
> -	long long error;
>  } childinfo_t;
>  
>  childinfo_t *child_tab = NULL;
> @@ -189,52 +188,44 @@ again:
>  	return NULL;
>  }
>  
> -static childinfo_t create_worker(void *ctx, void *(*func)(void *))
> +static int create_worker(childinfo_t *child, void *ctx, void *(*func)(void *))
>  {
>  	pthread_attr_t attr;
>  	int err;
> -	childinfo_t child;
> -	pid_t childpid;
>  
> -	memset(&child, 0, sizeof(child));
>  	switch (process_mode) {
>  	case PROCESS_MODE: /* process mode */
>  		/* Fork the sender/receiver child. */
> -		switch ((childpid = fork())) {
> +		switch ((child->pid = fork())) {
>  			case -1:
>  				sneeze("fork()");
> -				child.error = -1;
> -				return child;
> +				return -1;
>  			case 0:
>  				(*func) (ctx);
>  				exit(0);
>  		}
> -		child.pid = childpid;
>  		break;
>  
>  	case THREAD_MODE: /* threaded mode */
>  		if (pthread_attr_init(&attr) != 0) {
>  			sneeze("pthread_attr_init()");
> -			child.error = -1;
> -			return child;
> +			return -1;
>  		}
>  
>  #ifndef __ia64__
>  		if (pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN) != 0) {
>  			sneeze("pthread_attr_setstacksize()");
> -			child.error = -1;
> -			return child;
> +			return -1;
>  		}
>  #endif
>  
> -		if ((err=pthread_create(&child.threadid, &attr, func, ctx)) != 0) {
> +		if ((err=pthread_create(&child->threadid, &attr, func, ctx)) != 0) {
>  			sneeze("pthread_create failed()");
> -			child.error = -1;
> -			return child;
> +			return -1;
>  		}
>  		break;
>  	}
> -	return child;
> +	return 0;
>  }
>  
>  void signal_workers(childinfo_t *children, unsigned int num_children)
> @@ -291,6 +282,7 @@ static unsigned int group(childinfo_t *child,
>  	unsigned int i;
>  	struct sender_context* snd_ctx = malloc (sizeof(struct sender_context)
>  			+num_fds*sizeof(int));
> +	int err;
>  
>  	if (!snd_ctx) {
>  		sneeze("malloc() [sender ctx]");
> @@ -317,8 +309,9 @@ static unsigned int group(childinfo_t *child,
>  		ctx->ready_out = ready_out;
>  		ctx->wakefd = wakefd;
>  
> -		child[tab_offset+i] = create_worker(ctx, (void *)(void *)receiver);
> -		if( child[tab_offset+i].error < 0 ) {
> +		err = create_worker(&child[tab_offset+i], ctx,
> +				    (void *)(void *)receiver);
> +		if(err) {
>  			return (i > 0 ? i-1 : 0);
>  		}
>  		snd_ctx->out_fds[i] = fds[1];
> @@ -332,8 +325,9 @@ static unsigned int group(childinfo_t *child,
>  
>  	/* Now we have all the fds, fork the senders */
>  	for (i = 0; i < num_fds; i++) {
> -		child[tab_offset+num_fds+i] = create_worker(snd_ctx, (void *)(void *)sender);
> -		if( child[tab_offset+num_fds+i].error < 0 ) {
> +		err = create_worker(&child[tab_offset+num_fds+i], snd_ctx,
> +				    (void *)(void *)sender);
> +		if(err) {
>  			return (num_fds+i)-1;
>  		}
>  	}
> -- 
> 2.5.0
> 
> --

Signed-off-by: John Kacur <jkacur@redhat.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-09-02 13:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-28  0:19 [PATCH rt-tests 0/4] build tweaks and a bug fix Josh Cartwright
2015-08-28  0:19 ` [PATCH rt-tests 1/4] rt-tests: Allow for user-specified PYLIB Josh Cartwright
2015-09-02 12:53   ` John Kacur
2015-08-28  0:19 ` [PATCH rt-tests 2/4] rt-tests: Break out install_hwlatdetect Josh Cartwright
2015-09-02 12:56   ` John Kacur
2015-08-28  0:19 ` [PATCH rt-tests 3/4] rt-tests: workaround poor gzip implementations Josh Cartwright
2015-09-02 12:58   ` John Kacur
2015-08-28  0:19 ` [PATCH rt-tests 4/4] hackbench: cleanup error handling in create_worker Josh Cartwright
2015-09-02 13:01   ` John Kacur
2015-08-28 17:50 ` [PATCH rt-tests 0/4] build tweaks and a bug fix Clark Williams
2015-08-28 17:54 ` Darren Hart
2015-08-28 18:11   ` Josh Cartwright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).