Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: * Fix annotation on stdio/GTK+ interfaces (Namhyung Kim) * Fix file descriptor leaking while searching DSOs for suitable symtab (Namhyung Kim). Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -113,14 +113,16 @@ static int report__add_mem_hist_entry(struct perf_tool *tool, struct addr_locati
|
|||||||
if (!he)
|
if (!he)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
|
if (ui__has_annotation()) {
|
||||||
if (err)
|
err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
|
||||||
goto out;
|
if (err)
|
||||||
|
goto out;
|
||||||
|
|
||||||
mx = he->mem_info;
|
mx = he->mem_info;
|
||||||
err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx);
|
err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
evsel->hists.stats.total_period += cost;
|
evsel->hists.stats.total_period += cost;
|
||||||
hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
|
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
|
|||||||
he = __hists__add_entry(&evsel->hists, al, parent, &bi[i], NULL,
|
he = __hists__add_entry(&evsel->hists, al, parent, &bi[i], NULL,
|
||||||
1, 1, 0);
|
1, 1, 0);
|
||||||
if (he) {
|
if (he) {
|
||||||
bx = he->branch_info;
|
if (ui__has_annotation()) {
|
||||||
err = addr_map_symbol__inc_samples(&bx->from, evsel->idx);
|
bx = he->branch_info;
|
||||||
if (err)
|
err = addr_map_symbol__inc_samples(&bx->from,
|
||||||
goto out;
|
evsel->idx);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
|
||||||
err = addr_map_symbol__inc_samples(&bx->to, evsel->idx);
|
err = addr_map_symbol__inc_samples(&bx->to,
|
||||||
if (err)
|
evsel->idx);
|
||||||
goto out;
|
if (err)
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
evsel->hists.stats.total_period += 1;
|
evsel->hists.stats.total_period += 1;
|
||||||
hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
|
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
|
|||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
|
if (ui__has_annotation())
|
||||||
|
err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
|
||||||
|
|
||||||
evsel->hists.stats.total_period += sample->period;
|
evsel->hists.stats.total_period += sample->period;
|
||||||
hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
|
hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
|
||||||
out:
|
out:
|
||||||
|
@@ -176,7 +176,7 @@ static void perf_top__record_precise_ip(struct perf_top *top,
|
|||||||
{
|
{
|
||||||
struct annotation *notes;
|
struct annotation *notes;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
int err;
|
int err = 0;
|
||||||
|
|
||||||
if (he == NULL || he->ms.sym == NULL ||
|
if (he == NULL || he->ms.sym == NULL ||
|
||||||
((top->sym_filter_entry == NULL ||
|
((top->sym_filter_entry == NULL ||
|
||||||
@@ -190,7 +190,9 @@ static void perf_top__record_precise_ip(struct perf_top *top,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ip = he->ms.map->map_ip(he->ms.map, ip);
|
ip = he->ms.map->map_ip(he->ms.map, ip);
|
||||||
err = hist_entry__inc_addr_samples(he, counter, ip);
|
|
||||||
|
if (ui__has_annotation())
|
||||||
|
err = hist_entry__inc_addr_samples(he, counter, ip);
|
||||||
|
|
||||||
pthread_mutex_unlock(¬es->lock);
|
pthread_mutex_unlock(¬es->lock);
|
||||||
|
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "ui/ui.h"
|
||||||
|
#include "sort.h"
|
||||||
#include "build-id.h"
|
#include "build-id.h"
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
@@ -489,7 +491,7 @@ static int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
|
|||||||
{
|
{
|
||||||
struct annotation *notes;
|
struct annotation *notes;
|
||||||
|
|
||||||
if (sym == NULL || use_browser != 1 || !sort__has_sym)
|
if (sym == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
notes = symbol__annotation(sym);
|
notes = symbol__annotation(sym);
|
||||||
@@ -1399,3 +1401,8 @@ int hist_entry__annotate(struct hist_entry *he, size_t privsize)
|
|||||||
{
|
{
|
||||||
return symbol__annotate(he->ms.sym, he->ms.map, privsize);
|
return symbol__annotate(he->ms.sym, he->ms.map, privsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ui__has_annotation(void)
|
||||||
|
{
|
||||||
|
return use_browser == 1 && sort__has_sym;
|
||||||
|
}
|
||||||
|
@@ -151,6 +151,8 @@ void symbol__annotate_zero_histogram(struct symbol *sym, int evidx);
|
|||||||
void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);
|
void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);
|
||||||
void disasm__purge(struct list_head *head);
|
void disasm__purge(struct list_head *head);
|
||||||
|
|
||||||
|
bool ui__has_annotation(void);
|
||||||
|
|
||||||
int symbol__tty_annotate(struct symbol *sym, struct map *map,
|
int symbol__tty_annotate(struct symbol *sym, struct map *map,
|
||||||
struct perf_evsel *evsel, bool print_lines,
|
struct perf_evsel *evsel, bool print_lines,
|
||||||
bool full_paths, int min_pcnt, int max_lines);
|
bool full_paths, int min_pcnt, int max_lines);
|
||||||
|
@@ -1336,6 +1336,8 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
|
|||||||
|
|
||||||
if (syms_ss && runtime_ss)
|
if (syms_ss && runtime_ss)
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
symsrc__destroy(ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user