From: tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org,
dsahern@gmail.com, mingo@kernel.org, adrian.hunter@intel.com,
acme@redhat.com, wangnan0@huawei.com, namhyung@kernel.org,
tglx@linutronix.de, hpa@zytor.com
Subject: [tip:perf/core] perf disassemble: Move check for kallsyms + !kcore
Date: Wed, 24 Aug 2016 02:21:42 -0700 [thread overview]
Message-ID: <tip-lk1v4srtsktonnyp6t1o0uhx@git.kernel.org> (raw)
Commit-ID: c12944f7faa7f76441d83c1413f13e8bc70162b2
Gitweb: http://git.kernel.org/tip/c12944f7faa7f76441d83c1413f13e8bc70162b2
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 9 Aug 2016 14:56:13 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 23 Aug 2016 15:37:33 -0300
perf disassemble: Move check for kallsyms + !kcore
We don't need to do all that filename logic to then just have to test
something unrelated and bail out, move it to the start of the function.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-lk1v4srtsktonnyp6t1o0uhx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/annotate.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 4024d30..9882bc6 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1165,11 +1165,10 @@ int symbol__strerror_disassemble(struct symbol *sym __maybe_unused, struct map *
int symbol__disassemble(struct symbol *sym, struct map *map, size_t privsize)
{
struct dso *dso = map->dso;
- char *filename = dso__build_id_filename(dso, NULL, 0);
+ char *filename;
bool free_filename = true;
char command[PATH_MAX * 2];
FILE *file;
- int err = 0;
char symfs_filename[PATH_MAX];
struct kcore_extract kce;
bool delete_extract = false;
@@ -1177,7 +1176,13 @@ int symbol__disassemble(struct symbol *sym, struct map *map, size_t privsize)
int lineno = 0;
int nline;
pid_t pid;
+ int err = SYMBOL_ANNOTATE_ERRNO__NO_VMLINUX;
+
+ if (dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS &&
+ !dso__is_kcore(dso))
+ goto out;
+ filename = dso__build_id_filename(dso, NULL, 0);
if (filename)
symbol__join_symfs(symfs_filename, filename);
@@ -1201,12 +1206,6 @@ fallback:
free_filename = false;
}
- if (dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS &&
- !dso__is_kcore(dso)) {
- err = SYMBOL_ANNOTATE_ERRNO__NO_VMLINUX;
- goto out_free_filename;
- }
-
pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__,
filename, sym->name, map->unmap_ip(map, sym->start),
map->unmap_ip(map, sym->end));
@@ -1338,6 +1337,7 @@ out_free_filename:
kcore_extract__delete(&kce);
if (free_filename)
free(filename);
+out:
return err;
out_close_stdout:
reply other threads:[~2016-08-24 9:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=tip-lk1v4srtsktonnyp6t1o0uhx@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--cc=wangnan0@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.