mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
perf newt: Pass the input_name to perf_session__browse_hists
So that it can use it in the 'perf annotate' command line, otherwise it'll use the default and not the specified -i filename passed to 'perf report'. Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
e65713ea1e
commit
533c46c31c
3 changed files with 14 additions and 8 deletions
|
@ -313,7 +313,8 @@ static int __cmd_report(void)
|
||||||
stats->stats.total);
|
stats->stats.total);
|
||||||
if (use_browser)
|
if (use_browser)
|
||||||
perf_session__browse_hists(&stats->hists, nr_hists,
|
perf_session__browse_hists(&stats->hists, nr_hists,
|
||||||
stats->stats.total, help);
|
stats->stats.total, help,
|
||||||
|
input_name);
|
||||||
else {
|
else {
|
||||||
if (rb_first(&session->stats_by_id) ==
|
if (rb_first(&session->stats_by_id) ==
|
||||||
rb_last(&session->stats_by_id))
|
rb_last(&session->stats_by_id))
|
||||||
|
|
|
@ -317,7 +317,8 @@ static size_t hist_entry__append_browser(struct hist_entry *self,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void map_symbol__annotate_browser(const struct map_symbol *self)
|
static void map_symbol__annotate_browser(const struct map_symbol *self,
|
||||||
|
const char *input_name)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int cols, rows;
|
int cols, rows;
|
||||||
|
@ -331,8 +332,8 @@ static void map_symbol__annotate_browser(const struct map_symbol *self)
|
||||||
if (self->sym == NULL)
|
if (self->sym == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (asprintf(&str, "perf annotate -d \"%s\" %s 2>&1 | expand",
|
if (asprintf(&str, "perf annotate -i \"%s\" -d \"%s\" %s 2>&1 | expand",
|
||||||
self->map->dso->name, self->sym->name) < 0)
|
input_name, self->map->dso->name, self->sym->name) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fp = popen(str, "r");
|
fp = popen(str, "r");
|
||||||
|
@ -472,7 +473,8 @@ static int hist_browser__populate(struct hist_browser *self, struct rb_root *his
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_session__browse_hists(struct rb_root *hists, u64 nr_hists,
|
int perf_session__browse_hists(struct rb_root *hists, u64 nr_hists,
|
||||||
u64 session_total, const char *helpline)
|
u64 session_total, const char *helpline,
|
||||||
|
const char *input_name)
|
||||||
{
|
{
|
||||||
struct newtExitStruct es;
|
struct newtExitStruct es;
|
||||||
char str[1024];
|
char str[1024];
|
||||||
|
@ -527,7 +529,8 @@ int perf_session__browse_hists(struct rb_root *hists, u64 nr_hists,
|
||||||
"kallsyms file");
|
"kallsyms file");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
map_symbol__annotate_browser(browser->selection);
|
map_symbol__annotate_browser(browser->selection,
|
||||||
|
input_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = 0;
|
err = 0;
|
||||||
|
|
|
@ -96,12 +96,14 @@ static inline struct map *
|
||||||
static inline int perf_session__browse_hists(struct rb_root *hists __used,
|
static inline int perf_session__browse_hists(struct rb_root *hists __used,
|
||||||
u64 nr_hists __used,
|
u64 nr_hists __used,
|
||||||
u64 session_total __used,
|
u64 session_total __used,
|
||||||
const char *helpline __used)
|
const char *helpline __used,
|
||||||
|
const char *input_name __used)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int perf_session__browse_hists(struct rb_root *hists, u64 nr_hists,
|
int perf_session__browse_hists(struct rb_root *hists, u64 nr_hists,
|
||||||
u64 session_total, const char *helpline);
|
u64 session_total, const char *helpline,
|
||||||
|
const char *input_name);
|
||||||
#endif
|
#endif
|
||||||
#endif /* __PERF_SESSION_H */
|
#endif /* __PERF_SESSION_H */
|
||||||
|
|
Loading…
Reference in a new issue