Patch 0001, 0002 are easy to digest. Patch 0003 is more invasive.
Dietmar Eggemann (3): Move DEFAULT_THREAD_PRIORITY, DEFAULT_THREAD_NICE & PATH_LENGTH to common place Remove BUDGET_OVERP definition Clean-up header file inferno
src/rt-app.c | 17 +++++++++++++---- src/rt-app.h | 14 -------------- src/rt-app_args.c | 7 ++++++- src/rt-app_args.h | 19 +------------------ src/rt-app_parse_config.c | 11 ++++++++++- src/rt-app_parse_config.h | 19 ------------------- src/rt-app_types.h | 14 ++++++++------ src/rt-app_utils.c | 7 ++++++- src/rt-app_utils.h | 11 +++-------- 9 files changed, 47 insertions(+), 72 deletions(-)
Avoid double defining DEFAULT_THREAD_PRIORITY and PATH_LENGTH and move DEFAULT_THREAD_PRIORITY, DEFAULT_THREAD_NICE & PATH_LENGTH to src/rt-app_types.h.
Signed-off-by: Dietmar Eggemann dietmar.eggemann@arm.com --- src/rt-app_args.h | 3 --- src/rt-app_parse_config.h | 4 ---- src/rt-app_types.h | 7 ++++++- 3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/rt-app_args.h b/src/rt-app_args.h index 23ba50c5f343..116423335327 100644 --- a/src/rt-app_args.h +++ b/src/rt-app_args.h @@ -38,9 +38,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #endif #include "rt-app_parse_config.h"
-#define DEFAULT_THREAD_PRIORITY 10 -#define PATH_LENGTH 256 - void usage (const char* msg, int ex_code);
diff --git a/src/rt-app_parse_config.h b/src/rt-app_parse_config.h index 9b0e5faf425d..1589dde6dc59 100644 --- a/src/rt-app_parse_config.h +++ b/src/rt-app_parse_config.h @@ -39,10 +39,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #endif #include <json-c/json.h>
-#define DEFAULT_THREAD_PRIORITY 10 -#define DEFAULT_THREAD_NICE 0 -#define PATH_LENGTH 256 - void parse_config(const char *filename, rtapp_options_t *opts); void diff --git a/src/rt-app_types.h b/src/rt-app_types.h index 5b8345fcf6aa..b9da66a3af34 100644 --- a/src/rt-app_types.h +++ b/src/rt-app_types.h @@ -33,8 +33,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define RTAPP_POLICY_DESCR_LENGTH 16 #define RTAPP_RESOURCE_DESCR_LENGTH 16 #define RTAPP_FTRACE_PATH_LENGTH 256 -/* exit codes */
+#define DEFAULT_THREAD_PRIORITY 10 +#define DEFAULT_THREAD_NICE 0 + +#define PATH_LENGTH 256 + +/* exit codes */ #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 #define EXIT_INV_CONFIG 2
Deadline budget overprovisioning is not implemented any more.
Signed-off-by: Dietmar Eggemann dietmar.eggemann@arm.com --- src/rt-app.h | 2 -- 1 file changed, 2 deletions(-)
diff --git a/src/rt-app.h b/src/rt-app.h index d55271f7f3a1..5244a683c5a4 100644 --- a/src/rt-app.h +++ b/src/rt-app.h @@ -34,8 +34,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "rt-app_types.h" #include "rt-app_args.h"
-#define BUDGET_OVERP 5 - void *thread_body(void *arg);
#endif /* _RT_APP_H_ */
The rt-app header and source files only include C standard library (glibc), POSIX (threading), json-c header and rt-app header files if needed.
The autoconf configuration header 'config.h' is included where it is needed. Currently only the preprocessor symbol DLSCHED is used.
Build tests:
on x86_64 w/o deadline:
$ git reset --hard; git clean -fdx $ ./autogen.sh $ ./configure $ make
on x86_64 w/ deadline:
$ git reset --hard; git clean -fdx $ ./autogen.sh $ ./configure $ make
on arm64 w/ deadline, static
$ git reset --hard; git clean -fdx $ ./autogen.sh $ ./configure --host=aarch64-linux -gnu LDFLAGS="--static -L/opt/git/tools/json-c/.libs/" CFLAGS="-I /opt/git/tools/" --with-deadline $ make
Tests ran on arm64 (juno) using static version w/ deadline and a json file w/ cfs and deadline tasks.
Signed-off-by: Dietmar Eggemann dietmar.eggemann@arm.com --- src/rt-app.c | 17 +++++++++++++---- src/rt-app.h | 12 ------------ src/rt-app_args.c | 7 ++++++- src/rt-app_args.h | 16 +--------------- src/rt-app_parse_config.c | 11 ++++++++++- src/rt-app_parse_config.h | 15 --------------- src/rt-app_types.h | 7 ++----- src/rt-app_utils.c | 7 ++++++- src/rt-app_utils.h | 11 +++-------- 9 files changed, 41 insertions(+), 62 deletions(-)
diff --git a/src/rt-app.c b/src/rt-app.c index 0f992f5748c4..4123d7b67ce8 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -19,14 +19,23 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+/* for CPU_SET macro */ #define _GNU_SOURCE + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> #include <fcntl.h> -#include "rt-app.h" -#include "rt-app_utils.h" -#include <sched.h> -#include "pthread.h" +#include <math.h> +#include <pthread.h> +#include <signal.h> #include <sys/time.h> #include <sys/resource.h> +#include <sys/mman.h> /* for memlock */ + +#include "config.h" +#include "rt-app_utils.h" +#include "rt-app_args.h"
static int errno; static volatile sig_atomic_t continue_running; diff --git a/src/rt-app.h b/src/rt-app.h index 5244a683c5a4..85eccb1fb716 100644 --- a/src/rt-app.h +++ b/src/rt-app.h @@ -22,18 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _RT_APP_H_ #define _RT_APP_H_
-#include <stdlib.h> -#include <stdio.h> -#include <error.h> -#include <time.h> -#include <sched.h> -#include <pthread.h> -#include <signal.h> -#include <sys/mman.h> /* for memlock */ -#include "config.h" -#include "rt-app_types.h" -#include "rt-app_args.h" - void *thread_body(void *arg);
#endif /* _RT_APP_H_ */ diff --git a/src/rt-app_args.c b/src/rt-app_args.c index e16415de6336..dc4a2d2f90de 100644 --- a/src/rt-app_args.c +++ b/src/rt-app_args.c @@ -19,7 +19,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#include "rt-app_args.h" +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <sys/stat.h> + +#include "rt-app_parse_config.h"
void usage (const char* msg, int ex_code) diff --git a/src/rt-app_args.h b/src/rt-app_args.h index 116423335327..a5304d45193f 100644 --- a/src/rt-app_args.h +++ b/src/rt-app_args.h @@ -21,22 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef _RTAPP_ARGS_H_ #define _RTAPP_ARGS_H_ -/* for CPU_SET macro */ -#define _GNU_SOURCE - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <sched.h> -#include <getopt.h> -#include <sys/stat.h> -#include <string.h> + #include "rt-app_types.h" -#include "rt-app_utils.h" -#ifdef DLSCHED -#include "dl_syscalls.h" -#endif -#include "rt-app_parse_config.h"
void usage (const char* msg, int ex_code); diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c index e5ef87f6ee3e..c6086f423d2e 100644 --- a/src/rt-app_parse_config.c +++ b/src/rt-app_parse_config.c @@ -18,7 +18,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <json-c/bits.h> + +/* for CPU_SET macro */ +#define _GNU_SOURCE + +#include <stdio.h> +#include <string.h> +#include <fcntl.h> +#include <json-c/json.h> + +#include "rt-app_utils.h" #include "rt-app_parse_config.h"
#define PFX "[json] " diff --git a/src/rt-app_parse_config.h b/src/rt-app_parse_config.h index 1589dde6dc59..bd2f991137e7 100644 --- a/src/rt-app_parse_config.h +++ b/src/rt-app_parse_config.h @@ -21,23 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef _RTAPP_PARSE_CONFIG_H #define _RTAPP_PARSE_CONFIG_H -/* for CPU_SET macro */ -#define _GNU_SOURCE
-#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> -#include <sched.h> -#include <string.h> #include "rt-app_types.h" -#include "rt-app_utils.h" -#ifdef DLSCHED -#include "dl_syscalls.h" -#endif -#include <json-c/json.h>
void parse_config(const char *filename, rtapp_options_t *opts); diff --git a/src/rt-app_types.h b/src/rt-app_types.h index b9da66a3af34..98ec99fbc151 100644 --- a/src/rt-app_types.h +++ b/src/rt-app_types.h @@ -22,13 +22,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _RTAPP_TYPES_H_ #define _RTAPP_TYPES_H_
+#include <pthread.h> + #include "config.h" #include "dl_syscalls.h" -#include <sched.h> -#include <pthread.h> -#include <time.h> -#include <stdio.h> -#include <sched.h>
#define RTAPP_POLICY_DESCR_LENGTH 16 #define RTAPP_RESOURCE_DESCR_LENGTH 16 diff --git a/src/rt-app_utils.c b/src/rt-app_utils.c index f12f48cffa90..449343bf7eab 100644 --- a/src/rt-app_utils.c +++ b/src/rt-app_utils.c @@ -19,8 +19,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#include <errno.h> +#include <stdlib.h> +#include <stdio.h> #include <string.h> +#include <errno.h> +#include <math.h> +#include <stdarg.h> + #include "rt-app_utils.h"
unsigned long diff --git a/src/rt-app_utils.h b/src/rt-app_utils.h index 6a8d921d1321..2bae023cca17 100644 --- a/src/rt-app_utils.h +++ b/src/rt-app_utils.h @@ -23,14 +23,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define _TIMESPEC_UTILS_H_
#include <time.h> -#include <math.h> -#include <stdio.h> -#include <string.h> -#include <stdarg.h> -#include <stdlib.h> -#define _GNU_SOURCE -#include <unistd.h> -#include <sys/syscall.h> +#include <stdint.h> + +#include "config.h" #include "rt-app_types.h"
#ifndef LOG_PREFIX
On 16 February 2017 at 12:35, Juri Lelli juri.lelli@arm.com wrote:
Hi Dietmar,
On 14/02/17 13:31, Dietmar Eggemann wrote:
Patch 0001, 0002 are easy to digest. Patch 0003 is more invasive.
The whole set looks good to me.
Could you send a pull request, maybe after Vincent had a look as well?
Looks good for me too
Thanks
Thanks,
- Juri