From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Stephane Eranian <eranian@google.com>
Subject: [PATCH V3 01/10] perf tools: fix path unpopulated in machine__create_modules()
Date: Tue, 24 Sep 2013 15:15:43 +0300 [thread overview]
Message-ID: <1380024952-29387-2-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1380024952-29387-1-git-send-email-adrian.hunter@intel.com>
In machine__create_modules() the 'path' char array
was used in a call to symbol__restricted_filename()
without always being populated.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/machine.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 933d14f..ddf917b 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -785,14 +785,14 @@ static int machine__create_modules(struct machine *machine)
const char *modules;
char path[PATH_MAX];
- if (machine__is_default_guest(machine))
+ if (machine__is_default_guest(machine)) {
modules = symbol_conf.default_guest_modules;
- else {
- sprintf(path, "%s/proc/modules", machine->root_dir);
+ } else {
+ snprintf(path, PATH_MAX, "%s/proc/modules", machine->root_dir);
modules = path;
}
- if (symbol__restricted_filename(path, "/proc/modules"))
+ if (symbol__restricted_filename(modules, "/proc/modules"))
return -1;
file = fopen(modules, "r");
--
1.7.11.7
next prev parent reply other threads:[~2013-09-24 12:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 12:15 [PATCH V3 00/10] perf tools: kcore improvements Adrian Hunter
2013-09-24 12:15 ` Adrian Hunter [this message]
2013-09-24 12:15 ` [PATCH V3 02/10] perf tools: make a separate function to parse /proc/modules Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 03/10] perf tools: validate kcore module addresses Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 04/10] perf tools: workaround objdump difficulties with kcore Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 05/10] perf tools: add map__find_other_map_symbol() Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 06/10] perf tools: fix annotate_browser__callq() Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 07/10] perf tools: find kcore symbols on other maps Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 08/10] perf tools: add copyfile_mode() Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 09/10] perf buildid-cache: add ability to add kcore to the cache Adrian Hunter
2013-09-24 12:15 ` [PATCH V3 10/10] perf tools: add ability to find kcore in build-id cache Adrian Hunter
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=1380024952-29387-2-git-send-email-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@gmail.com \
--cc=paulus@samba.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).