On 02/15/2017 11:43 PM, Stephen Boyd wrote:
From: Olav Haugan ohaugan@codeaurora.org
Allow setting of cpusets at all levels of the spec.
Signed-off-by: Olav Haugan ohaugan@codeaurora.org Signed-off-by: Stephen Boyd stephen.boyd@linaro.org
- v2 changes:
- Added documentation and example json
- Clarified comments
- Added check for invalid CPU
- Reduced logging level for affinity setting message
- Code fixes based on feedback
doc/examples/tutorial/example7.json | 40 ++++++++++++ doc/tutorial.txt | 37 +++++++++++ src/rt-app.c | 119 +++++++++++++++++++++++++++++++----- src/rt-app_parse_config.c | 66 ++++++++++++++------ src/rt-app_types.h | 12 +++- 5 files changed, 238 insertions(+), 36 deletions(-) create mode 100644 doc/examples/tutorial/example7.json
[...]
diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c index e5ef87f6ee3e..06b0cf1232a9 100644 --- a/src/rt-app_parse_config.c +++ b/src/rt-app_parse_config.c @@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <json-c/bits.h> #include "rt-app_parse_config.h" +#include <unistd.h>
#define PFX "[json] " #define PFL " "PFX @@ -596,6 +597,42 @@ obj_is_event(char *name) return 0; }
+static void parse_cpuset_data(struct json_object *obj, cpuset_data_t *data) +{
- struct json_object *cpuset_obj, *cpu;
- unsigned int max_cpu = sysconf(_SC_NPROCESSORS_CONF) - 1;
- /* cpuset */
- cpuset_obj = get_in_object(obj, "cpus", TRUE);
- if (cpuset_obj) {
struct array_list *cpuset;
Not needed. Already removed by commit 952d888727fc
[...]
Tested-by: Dietmar Eggemann dietmar.eggemann@arm.com Reviewed-by: Dietmar Eggemann dietmar.eggemann@arm.com
Can you rebase on the latest commit7ce99bae70eb "Merge pull request #19 from deggeman/misc_cleanups"?
There is this reject of '#include <unistd.h>' in 'src/rt-app_parse_config.c' which is not needed any more.
I still would like to rename cpuset related structures, types and variables something else then cpu_data ('data' is used for so many other stuff) to improve readability, which should make it easier to integrate more functionality into rt-app, but I will send out another patch on top.