While analyzing vmcores from customers sometimes we want to filter tasks by scheduling policy, for instance, to identify if customer runs realtime tasks. Doing this via foreach grepping and then feeding back pointers to task_struct and grepping it again is very slow, especially if customer runs thousands of tasks. So, let's add another option for ps to filter tasks by scheduling policy. Changes in v4: * apply Dave's modifications: * throw fatal error instead of defaulting to NORMAL policy * re-word and re-structure help entry * relocate task_struct_policy members to the end of structs * show task_struct_policy info in "help -o" * replace strdup/calloc/free with wrappers * allow using hex values to specify policy Changes in v3: * fix snprintf format specifier for ulong * fix snprintf block indentation * add one more comma to help output Changes in v2: * handle task_struct.policy member size correctly * accept comma-separated list of policies instead of requiring multiple -y arguments * policy can be specified as a number too * policy name is case-insensitive now * warn about incorrect policy name * fix help message formatting * mark upper_case() source string pointer as a const (minor cleanup) Oleksandr Natalenko (1): task: also filter ps output by ->policy defs.h | 15 ++++++- help.c | 14 +++++- symbols.c | 3 ++ task.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- tools.c | 5 ++- 5 files changed, 170 insertions(+), 10 deletions(-) -- 2.14.2 -- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility