diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-02 12:37:07 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-02 12:37:07 -0500 |
| commit | 3154da34beff952a6b29dcc27c9dacf9adac977c (patch) | |
| tree | 9bb7133d2e429611761d63b6b7dc52e3e59fc5df | |
| parent | 55de1ed2f597646c6c7f0bbe2da1680c760b0d40 (diff) | |
| parent | af76815a31adc75dd9526230affdd678e65ac59f (diff) | |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"Misc fixes, most of them on the tooling side"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf tools: Fix strict alias issue for find_first_bit
perf tools: fix BFD detection on opensuse
perf: Fix hotplug splat
perf/x86: Fix event scheduling
perf symbols: Destroy unused symsrcs
perf annotate: Check availability of annotate when processing samples
| -rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 3 | ||||
| -rw-r--r-- | kernel/events/core.c | 12 | ||||
| -rw-r--r-- | tools/perf/builtin-report.c | 40 | ||||
| -rw-r--r-- | tools/perf/builtin-top.c | 6 | ||||
| -rw-r--r-- | tools/perf/config/Makefile | 2 | ||||
| -rw-r--r-- | tools/perf/config/feature-checks/Makefile | 2 | ||||
| -rw-r--r-- | tools/perf/util/annotate.c | 9 | ||||
| -rw-r--r-- | tools/perf/util/annotate.h | 2 | ||||
| -rw-r--r-- | tools/perf/util/include/linux/bitops.h | 4 | ||||
| -rw-r--r-- | tools/perf/util/symbol.c | 2 |
10 files changed, 54 insertions, 28 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 895604f2e916..79f9f848bee4 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -1192,6 +1192,9 @@ static void x86_pmu_del(struct perf_event *event, int flags) | |||
| 1192 | for (i = 0; i < cpuc->n_events; i++) { | 1192 | for (i = 0; i < cpuc->n_events; i++) { |
| 1193 | if (event == cpuc->event_list[i]) { | 1193 | if (event == cpuc->event_list[i]) { |
| 1194 | 1194 | ||
| 1195 | if (i >= cpuc->n_events - cpuc->n_added) | ||
| 1196 | --cpuc->n_added; | ||
| 1197 | |||
| 1195 | if (x86_pmu.put_event_constraints) | 1198 | if (x86_pmu.put_event_constraints) |
| 1196 | x86_pmu.put_event_constraints(cpuc, event); | 1199 | x86_pmu.put_event_constraints(cpuc, event); |
| 1197 | 1200 | ||
diff --git a/kernel/events/core.c b/kernel/events/core.c index 56003c6edfd3..fa0b2d4ad83c 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -7856,14 +7856,14 @@ static void perf_pmu_rotate_stop(struct pmu *pmu) | |||
| 7856 | static void __perf_event_exit_context(void *__info) | 7856 | static void __perf_event_exit_context(void *__info) |
| 7857 | { | 7857 | { |
| 7858 | struct perf_event_context *ctx = __info; | 7858 | struct perf_event_context *ctx = __info; |
| 7859 | struct perf_event *event, *tmp; | 7859 | struct perf_event *event; |
| 7860 | 7860 | ||
| 7861 | perf_pmu_rotate_stop(ctx->pmu); | 7861 | perf_pmu_rotate_stop(ctx->pmu); |
| 7862 | 7862 | ||
| 7863 | list_for_each_entry_safe(event, tmp, &ctx->pinned_groups, group_entry) | 7863 | rcu_read_lock(); |
| 7864 | __perf_remove_from_context(event); | 7864 | list_for_each_entry_rcu(event, &ctx->event_list, event_entry) |
| 7865 | list_for_each_entry_safe(event, tmp, &ctx->flexible_groups, group_entry) | ||
| 7866 | __perf_remove_from_context(event); | 7865 | __perf_remove_from_context(event); |
| 7866 | rcu_read_unlock(); | ||
| 7867 | } | 7867 | } |
| 7868 | 7868 | ||
| 7869 | static void perf_event_exit_cpu_context(int cpu) | 7869 | static void perf_event_exit_cpu_context(int cpu) |
| @@ -7887,11 +7887,11 @@ static void perf_event_exit_cpu(int cpu) | |||
| 7887 | { | 7887 | { |
| 7888 | struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu); | 7888 | struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu); |
| 7889 | 7889 | ||
| 7890 | perf_event_exit_cpu_context(cpu); | ||
| 7891 | |||
| 7890 | mutex_lock(&swhash->hlist_mutex); | 7892 | mutex_lock(&swhash->hlist_mutex); |
| 7891 | swevent_hlist_release(swhash); | 7893 | swevent_hlist_release(swhash); |
| 7892 | mutex_unlock(&swhash->hlist_mutex); | 7894 | mutex_unlock(&swhash->hlist_mutex); |
| 7893 | |||
| 7894 | perf_event_exit_cpu_context(cpu); | ||
| 7895 | } | 7895 | } |
| 7896 | #else | 7896 | #else |
| 7897 | static inline void perf_event_exit_cpu(int cpu) { } | 7897 | static inline void perf_event_exit_cpu(int cpu) { } |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3c53ec268fbc..02f985f3a396 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -113,14 +113,16 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati | |||
| 113 | if (!he) | 113 | if (!he) |
| 114 | return -ENOMEM; | 114 | return -ENOMEM; |
| 115 | 115 | ||
| 116 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | 116 | if (ui__has_annotation()) { |
| 117 | if (err) | 117 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); |
| 118 | goto out; | 118 | if (err) |
| 119 | goto out; | ||
| 119 | 120 | ||
| 120 | mx = he->mem_info; | 121 | mx = he->mem_info; |
| 121 | err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx); | 122 | err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx); |
| 122 | if (err) | 123 | if (err) |
| 123 | goto out; | 124 | goto out; |
| 125 | } | ||
| 124 | 126 | ||
| 125 | evsel->hists.stats.total_period += cost; | 127 | evsel->hists.stats.total_period += cost; |
| 126 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 128 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); |
| @@ -164,14 +166,18 @@ static int report__add_branch_hist_entry(struct perf_tool *tool, struct addr_loc | |||
| 164 | he = __hists__add_entry(&evsel->hists, al, parent, &bi[i], NULL, | 166 | he = __hists__add_entry(&evsel->hists, al, parent, &bi[i], NULL, |
| 165 | 1, 1, 0); | 167 | 1, 1, 0); |
| 166 | if (he) { | 168 | if (he) { |
| 167 | bx = he->branch_info; | 169 | if (ui__has_annotation()) { |
| 168 | err = addr_map_symbol__inc_samples(&bx->from, evsel->idx); | 170 | bx = he->branch_info; |
| 169 | if (err) | 171 | err = addr_map_symbol__inc_samples(&bx->from, |
| 170 | goto out; | 172 | evsel->idx); |
| 171 | 173 | if (err) | |
| 172 | err = addr_map_symbol__inc_samples(&bx->to, evsel->idx); | 174 | goto out; |
| 173 | if (err) | 175 | |
| 174 | goto out; | 176 | err = addr_map_symbol__inc_samples(&bx->to, |
| 177 | evsel->idx); | ||
| 178 | if (err) | ||
| 179 | goto out; | ||
| 180 | } | ||
| 175 | 181 | ||
| 176 | evsel->hists.stats.total_period += 1; | 182 | evsel->hists.stats.total_period += 1; |
| 177 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 183 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); |
| @@ -205,7 +211,9 @@ static int report__add_hist_entry(struct perf_tool *tool, struct perf_evsel *evs | |||
| 205 | if (err) | 211 | if (err) |
| 206 | goto out; | 212 | goto out; |
| 207 | 213 | ||
| 208 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | 214 | if (ui__has_annotation()) |
| 215 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | ||
| 216 | |||
| 209 | evsel->hists.stats.total_period += sample->period; | 217 | evsel->hists.stats.total_period += sample->period; |
| 210 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 218 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); |
| 211 | out: | 219 | out: |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 76cd510d34d0..5f989a7d8bc2 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
| @@ -176,7 +176,7 @@ static void perf_top__record_precise_ip(struct perf_top *top, | |||
| 176 | { | 176 | { |
| 177 | struct annotation *notes; | 177 | struct annotation *notes; |
| 178 | struct symbol *sym; | 178 | struct symbol *sym; |
| 179 | int err; | 179 | int err = 0; |
| 180 | 180 | ||
| 181 | if (he == NULL || he->ms.sym == NULL || | 181 | if (he == NULL || he->ms.sym == NULL || |
| 182 | ((top->sym_filter_entry == NULL || | 182 | ((top->sym_filter_entry == NULL || |
| @@ -190,7 +190,9 @@ static void perf_top__record_precise_ip(struct perf_top *top, | |||
| 190 | return; | 190 | return; |
| 191 | 191 | ||
| 192 | ip = he->ms.map->map_ip(he->ms.map, ip); | 192 | ip = he->ms.map->map_ip(he->ms.map, ip); |
| 193 | err = hist_entry__inc_addr_samples(he, counter, ip); | 193 | |
| 194 | if (ui__has_annotation()) | ||
| 195 | err = hist_entry__inc_addr_samples(he, counter, ip); | ||
| 194 | 196 | ||
| 195 | pthread_mutex_unlock(¬es->lock); | 197 | pthread_mutex_unlock(¬es->lock); |
| 196 | 198 | ||
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index c48d44958172..0331ea2701a3 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
| @@ -478,7 +478,7 @@ else | |||
| 478 | endif | 478 | endif |
| 479 | 479 | ||
| 480 | ifeq ($(feature-libbfd), 1) | 480 | ifeq ($(feature-libbfd), 1) |
| 481 | EXTLIBS += -lbfd | 481 | EXTLIBS += -lbfd -lz -liberty |
| 482 | endif | 482 | endif |
| 483 | 483 | ||
| 484 | ifdef NO_DEMANGLE | 484 | ifdef NO_DEMANGLE |
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index 12e551346fa6..523b7bc10553 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile | |||
| @@ -121,7 +121,7 @@ test-libpython-version.bin: | |||
| 121 | $(BUILD) $(FLAGS_PYTHON_EMBED) | 121 | $(BUILD) $(FLAGS_PYTHON_EMBED) |
| 122 | 122 | ||
| 123 | test-libbfd.bin: | 123 | test-libbfd.bin: |
| 124 | $(BUILD) -DPACKAGE='"perf"' -lbfd -ldl | 124 | $(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl |
| 125 | 125 | ||
| 126 | test-liberty.bin: | 126 | test-liberty.bin: |
| 127 | $(CC) -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty | 127 | $(CC) -o $(OUTPUT)$ |
