On 17-02-17 12:51:21, Dietmar Eggemann wrote:
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
Ok, will fix.
[...]
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"?
You are not using [1]. Ok, I found your sha at [2]. Rebased. However, unable to compile on this baseline due to missing bits.h include. Looks like bits.h was removed in 17dd99c72a12602ceab30ade5aead5834b8c119d:
rt-app_parse_config.o: In function `get_opts_from_json_object': rt-app_parse_config.c:(.text+0x15f8): undefined reference to `is_error'
There is this reject of '#include <unistd.h>' in 'src/rt-app_parse_config.c' which is not needed any more.
Will remove.
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.
Ok, thanks. I only renamed the structure.
[1] https://git.linaro.org/power/rt-app.git [2] https://github.com/scheduler-tools/rt-app