From: Andi Kleen <ak@linux.intel.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 7/9] perf report: Add support for srcfile sort key
Date: Tue, 11 Aug 2015 06:36:55 -0700 [thread overview]
Message-ID: <20150811133655.GC4524@tassilo.jf.intel.com> (raw)
In-Reply-To: <20150811023136.GE2488@sejong>
>
> AFAIK get_srcline() can return a string literal SRCLINE_UNKNOWN. It
> should not be freed or altered..
Good point. Here's a patch.
---
perf, tools: Check for SRCLINE_UNKNOWN case in srcline
Handle the SRCLINE_UNKNOWN case correctly when processing srcfile.
Pointed out by Namhyung.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index c0c32b0..7e38716 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -330,6 +330,8 @@ static char *get_srcfile(struct hist_entry *e)
sf = get_srcline(map->dso, map__rip_2objdump(map, e->ip),
e->ms.sym, true);
+ if (!strcmp(sf, SRCLINE_UNKNOWN))
+ return no_srcfile;
p = strchr(sf, ':');
if (p && *sf) {
*p = 0;
next prev parent reply other threads:[~2015-08-11 13:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 20:56 [GIT PULL 0/9] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 1/9] perf stat: Move perf_counts struct and functions into separate object Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 2/9] perf callchain: Move option parsing code to util.c Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 3/9] perf tools: Support full source file paths for srcline Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 4/9] perf tools: Unset perf_event_attr::freq when period term is set Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 5/9] perf hists: hist_entry__cmp() may use he_tmp.hists, initialize it Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 6/9] perf hists: Update the column width for the "srcline" sort key Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 7/9] perf report: Add support for srcfile " Arnaldo Carvalho de Melo
2015-08-11 2:31 ` Namhyung Kim
2015-08-11 13:36 ` Andi Kleen [this message]
2015-08-13 8:04 ` [tip:perf/core] perf sort: Check for SRCLINE_UNKNOWN case in " srcfile" processing tip-bot for Andi Kleen
2015-08-10 20:56 ` [PATCH 8/9] perf record: Support per-event freq term Arnaldo Carvalho de Melo
2015-08-10 20:56 ` [PATCH 9/9] perf evlist: Be more specific on -F/--freq Arnaldo Carvalho de Melo
2015-08-12 10:18 ` [GIT PULL 0/9] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150811133655.GC4524@tassilo.jf.intel.com \
--to=ak@linux.intel.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).