Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147622
b: refs/heads/master
c: 5352f35
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Jun 3, 2009
1 parent 4474f4c commit 6ec94f4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3502973d005ed89cc2b3f39780813a341ddba97f
refs/heads/master: 5352f35d6ae7b8b981d77137fb268bc54d10624f
29 changes: 17 additions & 12 deletions trunk/Documentation/perf_counter/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,28 +453,18 @@ static int sort_dimension__add(char *tok)
if (sd->taken)
continue;

if (strcmp(tok, sd->name))
if (strncasecmp(tok, sd->name, strlen(tok)))
continue;

list_add_tail(&sd->entry->list, &hist_entry__sort_list);
sd->taken = 1;

return 0;
}

return -ESRCH;
}

static void setup_sorting(void)
{
char *tmp, *tok, *str = strdup(sort_order);

for (tok = strtok_r(str, ", ", &tmp);
tok; tok = strtok_r(NULL, ", ", &tmp))
sort_dimension__add(tok);

free(str);
}

static int64_t
hist_entry__cmp(struct hist_entry *left, struct hist_entry *right)
{
Expand Down Expand Up @@ -880,6 +870,21 @@ 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);
}

int cmd_report(int argc, const char **argv, const char *prefix)
{
symbol__init();
Expand Down

0 comments on commit 6ec94f4

Please sign in to comment.