mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
perf util: Remove setup_sorting dups
And it is also needed by 'perf diff'. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Frédéric Weisbecker <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
f823e441ab
commit
c8829c7a31
4 changed files with 19 additions and 32 deletions
|
|
@ -521,21 +521,6 @@ static const struct option options[] = {
|
|||
OPT_END()
|
||||
};
|
||||
|
||||
static void setup_sorting(void)
|
||||
{
|
||||
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(annotate_usage, options);
|
||||
}
|
||||
}
|
||||
|
||||
free(str);
|
||||
}
|
||||
|
||||
int cmd_annotate(int argc, const char **argv, const char *prefix __used)
|
||||
{
|
||||
if (symbol__init(&symbol_conf) < 0)
|
||||
|
|
@ -543,7 +528,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used)
|
|||
|
||||
argc = parse_options(argc, argv, options, annotate_usage, 0);
|
||||
|
||||
setup_sorting();
|
||||
setup_sorting(annotate_usage, options);
|
||||
|
||||
if (argc) {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -843,21 +843,6 @@ static const struct option options[] = {
|
|||
OPT_END()
|
||||
};
|
||||
|
||||
static void setup_sorting(void)
|
||||
{
|
||||
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(report_usage, options);
|
||||
}
|
||||
}
|
||||
|
||||
free(str);
|
||||
}
|
||||
|
||||
static void setup_list(struct strlist **list, const char *list_str,
|
||||
struct sort_entry *se, const char *list_name,
|
||||
FILE *fp)
|
||||
|
|
@ -884,7 +869,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
|
|||
|
||||
argc = parse_options(argc, argv, options, report_usage, 0);
|
||||
|
||||
setup_sorting();
|
||||
setup_sorting(report_usage, options);
|
||||
|
||||
if (parent_pattern != default_parent_pattern) {
|
||||
sort_dimension__add("parent");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@ struct sort_entry {
|
|||
extern struct sort_entry sort_thread;
|
||||
extern struct list_head hist_entry__sort_list;
|
||||
|
||||
void setup_sorting(const char * const usagestr[], const struct option *opts);
|
||||
|
||||
extern int repsep_fprintf(FILE *fp, const char *fmt, ...);
|
||||
extern size_t sort__thread_print(FILE *, struct hist_entry *, unsigned int);
|
||||
extern size_t sort__comm_print(FILE *, struct hist_entry *, unsigned int);
|
||||
|
|
|
|||
Loading…
Reference in a new issue