From feacb5a3ff69c7d8a93ac1f1dc7faefe15244bdb Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Mon, 3 Oct 2016 16:11:43 +0100 Subject: [PATCH] libs/wlgen/rta: Limit task name to 15 characters rt-app uses pthread_setname_np(3) to set the names of tasks on the target [1]. This interface limits thread name length to 16 characters including the null '\0'. Although rt-app prints a message on the target, the workload execution goes ahead when the provided task names are too long, and the tasks are named "rt-app". This means they are not found when later examining the trace. Therefore, raise an exception on the host to prevent this situation arising. [1] https://github.com/scheduler-tools/rt-app/blob/dcaf5a04aa63b69d8b5e174d10a9e459f88772cf/src/rt-app.c#L152 --- libs/wlgen/wlgen/rta.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/wlgen/wlgen/rta.py b/libs/wlgen/wlgen/rta.py index 1b792ffe9..65535ebf7 100644 --- a/libs/wlgen/wlgen/rta.py +++ b/libs/wlgen/wlgen/rta.py @@ -495,6 +495,14 @@ class RTA(Workload): """ + for task in params.keys(): + if len(task) > 15: + # rt-app uses pthread_setname_np(3) which limits the task name + # to 16 characters including the terminal '\0'. + msg = ('Task name "{}" too long, please configure your tasks ' + 'with names shorter than 16 characters').format(task) + raise ValueError(msg) + if not sched: sched = {'policy' : 'OTHER'} -- GitLab