Re: [PATCH] rtems_waf: moved "import os.path" to the beginning of "bsp_configure" func def to avoid UnboundLocalError.

2016-09-11 Thread Chris Johns

Hi,

Thank you for the report and the fix. I have pushed a variation of your 
patch.


I could not use the email as a patch because git did not like it. It 
looks like it contained HTML. It would be good if you could please use 
'git send-email' to posts patches in the future then I can use your patch.


Thanks
Chris

On 09/09/2016 03:27, Saeed Ehteshamifar wrote:

In function 'bsp_configure' of rtems_bsd.py, when
conf.options.rtems_libbsd is None, os.path is not imported, which leads
to "UnboundLocalError: local variable 'os' referenced before assignment"
error.

This patch tries to avoid that error.

-
diff --git a/rtems_bsd.py b/rtems_bsd.py
index eaff438..6074f4d 100644
--- a/rtems_bsd.py
+++ b/rtems_bsd.py
@@ -48,6 +48,7 @@ def options(opt):
 help = 'Path to install RTEMS LibBSD (defauls to
prefix).')

  def bsp_configure(conf, arch_bsp):
+import os.path
  conf.check(header_name = 'dlfcn.h', features = 'c')
  if not rtems.check_posix(conf):
  conf.fatal("RTEMS kernel POSIX support is disabled; configure
RTEMS with --enable-posix")
@@ -56,7 +57,6 @@ def bsp_configure(conf, arch_bsp):
  if conf.options.rtems_libbsd is None:
  rtems_libbsd_path = conf.env.PREFIX
  else:
-import os.path
  if not os.path.exists(conf.options.rtems_libbsd):
  conf.fatal('RTEMS LibBSD not found')
  rtems_libbsd_path = conf.options.rtems_libbsd



___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 00/10] Raspberry Pi 2 (BCM2836) SMP support

2016-09-11 Thread Pavel Pisa
Hello Chris and others,

On Sunday 11 of September 2016 08:53:09 Chris Johns wrote:
> On 09/09/2016 17:47, Sebastian Huber wrote:
> > On 09/09/16 09:43, Pavel Pisa wrote:
> >> Hello Chris and others,
> >>
> >> On Friday 09 of September 2016 02:06:19 Chris Johns wrote:
> >>> >On 09/09/2016 07:46, Pavel Pisa wrote:
>  > >I have provided simple bsp_reset() for Raspberry Pi and pushed it
> 
>  into
> 
>  > >master.
> >>> >
> >>> >Thank you. Is the reset on exit on by default? I rebuilt without a BSP
> >>> >opt and the Rpi2 did not reset. I see a reference to
> >>> >BSP_RESET_BOARD_AT_EXIT but I do not know what the default is.
> >>> >
> >>> >I think*all*  RTEMS BSPs should reset on exit and shut-down by
> >>> > default. It is the normal production setting for most systems.
> >>
> >> Mainly for others, the BSP default cleanup operations
> >> selection mechanism is defined in
> >>
> >>rtems/c/src/aclocal/bsp-bspcleanup-options.m4
> >>
> >> RTEMS_BSP_CLEANUP_OPTIONS
> >> dnl USAGE:
> >> dnlRTEMS_BSP_CLEANUP_OPTIONS([0|1], [0|1], [0|1])
> >> dnl WHERE:
> >> dnlargument 1 indicates the default value for
> >> BSP_PRESS_KEY_FOR_RESET dnlargument 2 indicates the default value
> >> for BSP_RESET_BOARD_AT_EXIT dnlargument 3 indicates the default
> >> value for
> >> BSP_PRINT_EXCEPTION_CONTEXT
> >
> > Maybe it makes sense to remove the ability to change the default, so
> > what all BSPs have the same defaults. You can change the behaviour via
> > the configure command line if needed.
>
> Yes I think this is the way we should head. Any BSP which does not reset
> and start again by default needs to be changed making the default state
> for a BSP production ready. This statement covers this configure option
> plus it covers things like pressing a key which the PC BSP has on by
> default and should be defaulted to off.

May it be that RTEMS_BSP_CLEANUP_OPTIONS should not define
default but provide information which options are supported
for given BSP.

Best wishes,

  Pavel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Context Switching measurement RTEMS

2016-09-11 Thread Sebastian Huber

Hello Babacar,

what is your definition of "context switching time"? To measure short 
time intervals with little overhead, you can use the 
rtems_counter_read() function (not supported on all BSPs).


The tmcontext01 test measures the low-level context switch time. To get 
some samples for the thread dispatch time, you can enable profiling 
(--enable-profiling configure command line option) and use the test 
suite. Collect the output of all the tests and filter out the non-XML 
data (filter-test-xml.py). Then you can use this XML file to get some 
statistics (e.g. boxplot.py).


On 07/09/16 22:10, Babacar Diop wrote:


Dear devels,

I am using a multithreaded task and I would like to measure the 
context switching time.


Do you have any idea on how to do this ?

Kind Regards


Babacar Diop
23 ans
Élève ingénieur à Polytech' Paris-UPMC
Section Électronique, Informatique des Systèmes Embarqués
Année 5



___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  :sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

#!/usr/bin/python
#
# Copyright (c) 2014 embedded brains GmbH
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#notice, this list of conditions and the following disclaimer in the
#documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import libxml2
from libxml2 import xmlNode
import matplotlib.pyplot as plt

def m(n):
	return [int(n.getContent()), n.get_parent().get_parent().prop("name")][0]

def getData(name):
	doc = libxml2.parseFile(name)
	ctx = doc.xpathNewContext()
	return map(m, ctx.xpathEval('/ProfilingCollection/ProfilingReport/PerCPUProfilingReport/MaxThreadDispatchDisabledTime'))

cmPerInch = 2.54
plt.figure(figsize = (18.0 / cmPerInch, 18.0 / 1.618 / cmPerInch))
plt.boxplot(getData('tests.xml'), 0, 'rs');
plt.ylabel('max thread dispatch disabled time [ns]')
plt.yscale('log')
plt.savefig('max-thread-dispatch-disabled-times-log.png')
#!/usr/bin/python
#
# Copyright (c) 2014 embedded brains GmbH
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#notice, this list of conditions and the following disclaimer in the
#documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import sys
import re

print ""

while True:
	line = sys.stdin.readline()
	if not line:
		break
	m = re.match('^\s*\s*$', line)
	if m:
		continue
	m = re.match('^\s*\s*$', line)
	if m:
		continue
	m = re.m