perf util: Remove setup_sorting dups
And it is also needed by 'perf diff'. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1260828571-3613-1-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
f823e441ab
commit
c8829c7a31
@ -288,3 +288,18 @@ int sort_dimension__add(const char *tok)
|
||||
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
void setup_sorting(const char * const usagestr[], const struct option *opts)
|
||||
{
|
||||
char *tmp, *tok, *str = strdup(sort_order);
|
||||
|
||||
for (tok = strtok_r(str, ", ", &tmp);
|
||||
tok; tok = strtok_r(NULL, ", ", &tmp)) {
|
||||
if (sort_dimension__add(tok) < 0) {
|
||||
error("Unknown --sort key: `%s'", tok);
|
||||
usage_with_options(usagestr, opts);
|
||||
}
|
||||
}
|
||||
|
||||
free(str);
|
||||
}
|
||||
|
Reference in New Issue
Block a user