diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-12-20 14:32:37 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-12-20 14:32:37 -0500 |
commit | d9e24427f339e5c18419769d41697062811c5cd8 (patch) | |
tree | 3c50f19561f60d4175d375ff8d39ec203a42eb8c /tools/perf/util | |
parent | d87f69a16eb2cb96459117b06949a560679002e4 (diff) | |
parent | 65c1e0452a3389f9b7b8c1b23305ed2922fafb2d (diff) |
Merge branch 'perf/core' of git://github.com/acmel/linux into perf/core
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/config.c | 5 | ||||
-rw-r--r-- | tools/perf/util/event.c | 13 | ||||
-rw-r--r-- | tools/perf/util/evlist.c | 4 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 5 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 11 | ||||
-rw-r--r-- | tools/perf/util/usage.c | 5 | ||||
-rw-r--r-- | tools/perf/util/values.c | 1 |
7 files changed, 26 insertions, 18 deletions
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index 80d9598db31a..0deac6a14b65 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c | |||
@@ -1,5 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * GIT - The information manager from hell | 2 | * config.c |
3 | * | ||
4 | * Helper functions for parsing config items. | ||
5 | * Originally copied from GIT source. | ||
3 | * | 6 | * |
4 | * Copyright (C) Linus Torvalds, 2005 | 7 | * Copyright (C) Linus Torvalds, 2005 |
5 | * Copyright (C) Johannes Schindelin, 2005 | 8 | * Copyright (C) Johannes Schindelin, 2005 |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 97c479bcb0dc..b7c7f39a8f6d 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -814,13 +814,14 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
814 | al->cpu = sample->cpu; | 814 | al->cpu = sample->cpu; |
815 | 815 | ||
816 | if (al->map) { | 816 | if (al->map) { |
817 | struct dso *dso = al->map->dso; | ||
818 | |||
817 | if (symbol_conf.dso_list && | 819 | if (symbol_conf.dso_list && |
818 | (!al->map || !al->map->dso || | 820 | (!dso || !(strlist__has_entry(symbol_conf.dso_list, |
819 | !(strlist__has_entry(symbol_conf.dso_list, | 821 | dso->short_name) || |
820 | al->map->dso->short_name) || | 822 | (dso->short_name != dso->long_name && |
821 | (al->map->dso->short_name != al->map->dso->long_name && | 823 | strlist__has_entry(symbol_conf.dso_list, |
822 | strlist__has_entry(symbol_conf.dso_list, | 824 | dso->long_name))))) |
823 | al->map->dso->long_name))))) | ||
824 | goto out_filtered; | 825 | goto out_filtered; |
825 | 826 | ||
826 | al->sym = map__find_symbol(al->map, al->addr, filter); | 827 | al->sym = map__find_symbol(al->map, al->addr, filter); |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 8b19e7a1e881..963d63dde457 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -447,8 +447,10 @@ static int __perf_evlist__mmap(struct perf_evlist *evlist, | |||
447 | evlist->mmap[idx].mask = mask; | 447 | evlist->mmap[idx].mask = mask; |
448 | evlist->mmap[idx].base = mmap(NULL, evlist->mmap_len, prot, | 448 | evlist->mmap[idx].base = mmap(NULL, evlist->mmap_len, prot, |
449 | MAP_SHARED, fd, 0); | 449 | MAP_SHARED, fd, 0); |
450 | if (evlist->mmap[idx].base == MAP_FAILED) | 450 | if (evlist->mmap[idx].base == MAP_FAILED) { |
451 | evlist->mmap[idx].base = NULL; | ||
451 | return -1; | 452 | return -1; |
453 | } | ||
452 | 454 | ||
453 | perf_evlist__add_pollfd(evlist, fd); | 455 | perf_evlist__add_pollfd(evlist, fd); |
454 | return 0; | 456 | return 0; |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4a8c8b02e9cc..667f3b78bb2c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -108,6 +108,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts) | |||
108 | if (opts->system_wide) | 108 | if (opts->system_wide) |
109 | attr->sample_type |= PERF_SAMPLE_CPU; | 109 | attr->sample_type |= PERF_SAMPLE_CPU; |
110 | 110 | ||
111 | if (opts->period) | ||
112 | attr->sample_type |= PERF_SAMPLE_PERIOD; | ||
113 | |||
111 | if (opts->sample_id_all_avail && | 114 | if (opts->sample_id_all_avail && |
112 | (opts->sample_time || opts->system_wide || | 115 | (opts->sample_time || opts->system_wide || |
113 | !opts->no_inherit || opts->cpu_list)) | 116 | !opts->no_inherit || opts->cpu_list)) |
@@ -457,7 +460,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type, | |||
457 | u32 val32[2]; | 460 | u32 val32[2]; |
458 | } u; | 461 | } u; |
459 | 462 | ||
460 | 463 | memset(data, 0, sizeof(*data)); | |
461 | data->cpu = data->pid = data->tid = -1; | 464 | data->cpu = data->pid = data->tid = -1; |
462 | data->stream_id = data->id = data->time = -1ULL; | 465 | data->stream_id = data->id = data->time = -1ULL; |
463 | 466 | ||
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 632b50c7bc26..215d50f2042e 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1757,7 +1757,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, | |||
1757 | struct stat st; | 1757 | struct stat st; |
1758 | 1758 | ||
1759 | /*sshfs might return bad dent->d_type, so we have to stat*/ | 1759 | /*sshfs might return bad dent->d_type, so we have to stat*/ |
1760 | sprintf(path, "%s/%s", dir_name, dent->d_name); | 1760 | snprintf(path, sizeof(path), "%s/%s", dir_name, dent->d_name); |
1761 | if (stat(path, &st)) | 1761 | if (stat(path, &st)) |
1762 | continue; | 1762 | continue; |
1763 | 1763 | ||
@@ -1766,8 +1766,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, | |||
1766 | !strcmp(dent->d_name, "..")) | 1766 | !strcmp(dent->d_name, "..")) |
1767 | continue; | 1767 | continue; |
1768 | 1768 | ||
1769 | snprintf(path, sizeof(path), "%s/%s", | ||
1770 | dir_name, dent->d_name); | ||
1771 | ret = map_groups__set_modules_path_dir(mg, path); | 1769 | ret = map_groups__set_modules_path_dir(mg, path); |
1772 | if (ret < 0) | 1770 | if (ret < 0) |
1773 | goto out; | 1771 | goto out; |
@@ -1788,9 +1786,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, | |||
1788 | if (map == NULL) | 1786 | if (map == NULL) |
1789 | continue; | 1787 | continue; |
1790 | 1788 | ||
1791 | snprintf(path, sizeof(path), "%s/%s", | ||
1792 | dir_name, dent->d_name); | ||
1793 | |||
1794 | long_name = strdup(path); | 1789 | long_name = strdup(path); |
1795 | if (long_name == NULL) { | 1790 | if (long_name == NULL) { |
1796 | ret = -1; | 1791 | ret = -1; |
@@ -2609,10 +2604,10 @@ int symbol__init(void) | |||
2609 | symbol_conf.initialized = true; | 2604 | symbol_conf.initialized = true; |
2610 | return 0; | 2605 | return 0; |
2611 | 2606 | ||
2612 | out_free_dso_list: | ||
2613 | strlist__delete(symbol_conf.dso_list); | ||
2614 | out_free_comm_list: | 2607 | out_free_comm_list: |
2615 | strlist__delete(symbol_conf.comm_list); | 2608 | strlist__delete(symbol_conf.comm_list); |
2609 | out_free_dso_list: | ||
2610 | strlist__delete(symbol_conf.dso_list); | ||
2616 | return -1; | 2611 | return -1; |
2617 | } | 2612 | } |
2618 | 2613 | ||
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c index e16bf9a707e8..d76d1c0ff98f 100644 --- a/tools/perf/util/usage.c +++ b/tools/perf/util/usage.c | |||
@@ -1,5 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * GIT - The information manager from hell | 2 | * usage.c |
3 | * | ||
4 | * Various reporting routines. | ||
5 | * Originally copied from GIT source. | ||
3 | * | 6 | * |
4 | * Copyright (C) Linus Torvalds, 2005 | 7 | * Copyright (C) Linus Torvalds, 2005 |
5 | */ | 8 | */ |
diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c index bdd33470b235..697c8b4e59cc 100644 --- a/tools/perf/util/values.c +++ b/tools/perf/util/values.c | |||
@@ -32,6 +32,7 @@ void perf_read_values_destroy(struct perf_read_values *values) | |||
32 | 32 | ||
33 | for (i = 0; i < values->threads; i++) | 33 | for (i = 0; i < values->threads; i++) |
34 | free(values->value[i]); | 34 | free(values->value[i]); |
35 | free(values->value); | ||
35 | free(values->pid); | 36 | free(values->pid); |
36 | free(values->tid); | 37 | free(values->tid); |
37 | free(values->counterrawid); | 38 | free(values->counterrawid); |