Commit 5788a5c7 authored by Maxime Perrotin's avatar Maxime Perrotin
parents 52e539f6 8eaf6250
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2016 ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2020 ESA & ISAE.
*/
#ifndef __PO_HI_DEBUG_H__
......@@ -29,31 +29,37 @@
#include <stdio.h>
#endif
/* Some OS do not define stderr, print directly on stdout */
#ifdef AIR_HYPERVISOR
#define __PO_HI_PRINTF(s, args...) printf(s, ##args)
#else
#define __PO_HI_PRINTF(s, args...) fprintf(stderr, s, ##args); fflush(stdout)
#endif
#if __PO_HI_DEBUG_LEVEL >= __PO_HI_DEBUG_LEVEL_CRITICAL
#define __PO_HI_DEBUG_CRITICAL(s, args...) fprintf(stderr, s, ##args); fflush (stderr);
#define __PO_HI_DEBUG_CRITICAL(s, args...) __PO_HI_PRINTF(s, ##args)
#else
#define __PO_HI_DEBUG_CRITICAL(s, args...)
#endif
#if __PO_HI_DEBUG_LEVEL >= __PO_HI_DEBUG_LEVEL_WARNING
#define __PO_HI_DEBUG_WARNING(s, args...) fprintf(stderr, s, ##args); fflush (stderr);
#define __PO_HI_DEBUG_WARNING(s, args...) __PO_HI_PRINTF(s, ##args)
#else
#define __PO_HI_DEBUG_WARNING(s, args...)
#endif
#if __PO_HI_DEBUG_LEVEL >= __PO_HI_DEBUG_LEVEL_DEBUG
#define __PO_HI_DEBUG_DEBUG(s, args...) fprintf(stderr, s, ##args); fflush (stderr);
#define __PO_HI_DEBUG_DEBUG(s, args...) __PO_HI_PRINTF(s, ##args)
#else
#define __PO_HI_DEBUG_DEBUG(s, args...)
#endif
#if __PO_HI_DEBUG_LEVEL >= __PO_HI_DEBUG_LEVEL_INFO
#define __PO_HI_DEBUG_INFO(s, args...) fprintf(stderr, s, ##args); fflush (stderr);
#define __DEBUGMSG(s, args...) fprintf(stderr, s, ##args); fflush (stderr);
#define __PO_HI_DEBUG_INFO(s, args...) __PO_HI_PRINTF(s, ##args)
#define __DEBUGMSG(s, args...) __PO_HI_PRINTF(s, ##args)
#else
#define __PO_HI_DEBUG_INFO(s, args...)
#define __DEBUGMSG(s, args...)
#endif
#endif /* __DEBUG_H__ */
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2018 ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2020 ESA & ISAE.
*/
#ifndef __PO_HI_TRANSPORT__
......@@ -88,7 +88,7 @@ int __po_hi_transport_send (__po_hi_task_id id, __po_hi_port_t por
#define __po_hi_send_output __po_hi_transport_send
/*
* \fn __po_hi_get_port_name
* \fn __po_hi_get_port_model_name
* \brief Return the name of the port similar to the name within the AADL model.
*/
char* __po_hi_get_port_model_name (const __po_hi_port_t port);
......
......@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2010-2018 ESA & ISAE.
* Copyright (C) 2010-2020 ESA & ISAE.
*/
......@@ -351,7 +351,7 @@ int __po_hi_initialize ()
case __PO_HI_IN_DATA_INTER_PROCESS:
CREATE_SAMPLING_PORT
(__po_hi_transport_get_model_name (tmp),
(__po_hi_get_port_name (tmp),
__po_hi_transport_get_data_size (tmp),
DESTINATION,
PERIOD,
......@@ -366,7 +366,7 @@ int __po_hi_initialize ()
case __PO_HI_OUT_DATA_INTER_PROCESS:
CREATE_SAMPLING_PORT
(__po_hi_transport_get_model_name (tmp),
(__po_hi_get_port_name (tmp),
__po_hi_transport_get_data_size (tmp),
SOURCE,
PERIOD,
......@@ -380,8 +380,8 @@ int __po_hi_initialize ()
case __PO_HI_IN_EVENT_DATA_INTER_PROCESS:
CREATE_QUEUING_PORT
(__po_hi_transport_get_model_name (tmp),
1024,
(__po_hi_get_port_name (tmp),
40 + __po_hi_transport_get_data_size (tmp),
__po_hi_transport_get_queue_size (tmp),
DESTINATION,
FIFO,
......@@ -389,14 +389,16 @@ int __po_hi_initialize ()
&rc);
if (rc != NO_ERROR) {
__PO_HI_DEBUG_CRITICAL("CREATE_QUEUING_PORT error %d\n", rc);
__PO_HI_DEBUG_CRITICAL("CREATE_QUEUING_PORT (IN) error %d %s size= %d\n",
rc, __po_hi_get_port_name (tmp),
40 + __po_hi_transport_get_data_size (tmp));
}
break;
case __PO_HI_OUT_EVENT_DATA_INTER_PROCESS:
CREATE_QUEUING_PORT
(__po_hi_transport_get_model_name (tmp),
1024, //__po_hi_transport_get_data_size (tmp),
(__po_hi_get_port_name (tmp),
40 + __po_hi_transport_get_data_size (tmp),
__po_hi_transport_get_queue_size (tmp),
SOURCE,
FIFO,
......@@ -404,7 +406,9 @@ int __po_hi_initialize ()
&rc);
if (rc != NO_ERROR) {
__PO_HI_DEBUG_CRITICAL("CREATE_QUEUING_PORT error %d\n", rc);
__PO_HI_DEBUG_CRITICAL("CREATE_QUEUING_PORT (IN) error %d %s size= %d\n",
rc, __po_hi_get_port_name (tmp),
40 + __po_hi_transport_get_data_size (tmp));
}
break;
......@@ -479,7 +483,7 @@ int __po_hi_wait_initialization (void)
pthread_mutex_unlock (&mutex_init);
#if defined(__PO_HI_USE_VCD) && defined(__unix__)
#if defined(__PO_HI_USE_VCD) && defined(__unix__)
/* initialize parameters used to save the vcd trace */
__PO_HI_INITIALIZE_VCD_TRACE
#endif
......
......@@ -418,7 +418,6 @@ int __po_hi_number_of_cpus (void)
int cores = 1;
#if defined (__linux__) || defined (__APPLE__) || (defined (RTEMS_POSIX) && defined (RTEMS412))
cores = (int) sysconf (_SC_NPROCESSORS_ONLN);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment