From: Lin Ming <ming.m.lin@intel.com>
To: Han Pingtian <phan@redhat.com>
Cc: "linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: perf archive warning
Date: Thu, 03 Mar 2011 12:21:01 +0800 [thread overview]
Message-ID: <1299126061.8642.46.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <20110303042150.GA3025@hpt.nay.redhat.com>
On Thu, 2011-03-03 at 12:21 +0800, Han Pingtian wrote:
> On Thu, Mar 03, 2011 at 08:38:25AM +0800, Lin Ming wrote:
> > On Wed, 2011-03-02 at 16:53 +0800, Han Pingtian wrote:
> > > On Wed, Mar 02, 2011 at 04:29:41PM +0800, Lin Ming wrote:
> > > > >
> > > > > root@intel-s3e36-01 perf]# ./perf-archive
> > > > > tar: .build-id/b2/370e39ea2898c6e11c188e2f3879e4e3d6d1ef: Cannot stat:
> > > > > No such file or directory
> > > > > tar: .build-id/b2/370e39ea2898c6e11c188e2f3879e4e3d6d1ef: Cannot stat:
> > > > > No such file or directory
> > > > > tar: Exiting with failure status due to previous errors
> > > >
> > > > kernel.kallsyms is not created successfully in the buildid-cache.
> > > > Could you have a try below patch?
> > > >
> > > > diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> > > > index 72c124d..d3b5062 100644
> > > > --- a/tools/perf/util/header.c
> > > > +++ b/tools/perf/util/header.c
> > > > @@ -271,11 +271,16 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
> > > > const char *name, bool is_kallsyms)
> > > > {
> > > > const size_t size = PATH_MAX;
> > > > - char *realname = realpath(name, NULL),
> > > > + char *realname,
> > > > *filename = malloc(size),
> > > > *linkname = malloc(size), *targetname;
> > > > int len, err = -1;
> > > >
> > > > + if (is_kallsyms)
> > > > + realname = (char *)name;
> > > > + else
> > > > + realname = realpath(name, NULL);
> > > > +
> > > > if (realname == NULL || filename == NULL || linkname == NULL)
> > > > goto out_free;
> > > >
> > > > @@ -307,7 +312,8 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir,
> > > > if (symlink(targetname, linkname) == 0)
> > > > err = 0;
> > > > out_free:
> > > > - free(realname);
> > > > + if (!is_kallsyms)
> > > > + free(realname);
> > > > free(filename);
> > > > free(linkname);
> > > > return err;
> > > >
> > > The patch didn't fix this problem.
> >
> > Did you re-run perf command?
> > Need to re-run it to generate kernel.kallsyms build-id cache.
> >
> > For example,
> >
> > $ perf record -- sleep 3
> > $ perf-archive
> I think I must do something wrong yesterday when testing your patch. It
> works just fine today, the problem has been fixed by it. Thanks!
OK. I'll send out a patch with your Tested-by.
Lin Ming
prev parent reply other threads:[~2011-03-03 4:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 4:23 perf archive warning Han Pingtian
[not found] ` <AANLkTim+Ls+_cbHnMzdfWAWUj0Wx2rQtnoTCjZJ8Cnro@mail.gmail.com>
2011-03-02 8:29 ` Lin Ming
2011-03-02 8:53 ` Han Pingtian
2011-03-03 0:38 ` Lin Ming
2011-03-03 4:21 ` Han Pingtian
2011-03-03 4:21 ` Lin Ming [this message]
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=1299126061.8642.46.camel@minggr.sh.intel.com \
--to=ming.m.lin@intel.com \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=phan@redhat.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 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).