public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Namhyung Kim <namhyung.kim@lge.com>,
	Waiman Long <Waiman.Long@hp.com>,
	linux-kernel@vger.kernel.org, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] perf tools: ensure return negitive value when write header error
Date: Thu, 23 Oct 2014 18:47:29 -0300	[thread overview]
Message-ID: <20141023214729.GQ14687@kernel.org> (raw)
In-Reply-To: <87siigeghv.fsf@sejong.aot.lge.com>

Em Wed, Oct 22, 2014 at 04:00:12PM +0900, Namhyung Kim escreveu:
> On Thu, 16 Oct 2014 11:08:29 +0800, Wang Nan wrote:
> > When 'perf record' write headers, it calls write_xxx in
> > tools/perf/util/header.c, and check return value. It rolls back all
> > working only when return value is negative.
> >
> > This patch ensures write_cpudesc() and write_total_mem() return negative number
> > when error. Without this patch, headers reported by 'perf report' header is
> > error in some platform. Following output is caputured on ARM, which doesn't
> > contain "Processor" field in /proc/cpuinfo. See "cpudesc", "total memory" and
> > "cmdline" field.
> >
> >    bash-4.2# perf record ls
> >    ...
> >    [ perf record: Woken up 1 times to write data ]
> >    [ perf record: Captured and wrote 0.001 MB perf.data (~36 samples) ]
> >    bash-4.2# perf report --stdio --header
> >    Error:
> >    The perf.data file has no samples!
> >    # ========
> >    # captured on: Fri Sep 12 10:09:10 2014
> >    # hostname : arma15el
> >    # os release : 3.17.0+
> >    # perf version : 3.10.53
> >    # arch : armv7l
> >    # nrcpus online : 4
> >    # nrcpus avail : 1
> >    # cpudesc : (null)
> >    # total memory : 0 kB
> >    # cmdline :
> >    # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0
> >    # pmu mappings: not available
> >    # ========
> >    #
> >
> > Signed-off-by: Wang Nan <wangnan0@huawei.com>
> 
> I guess the total_memory, cmdline and pmu mappings are somehow affected
> by the broken cpudesc.  Do they have their own problem on ARM?
> 
> Anyway I think it's good to check the result properly, so
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied

- Arnaldo

  parent reply	other threads:[~2014-10-23 21:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16  3:08 [PATCH] perf tools: ensure return negitive value when write header error Wang Nan
2014-10-22  7:00 ` Namhyung Kim
2014-10-22  7:52   ` Wang Nan
2014-10-23  2:19   ` Wang Nan
2014-10-23 21:47   ` Arnaldo Carvalho de Melo [this message]
2014-10-30  6:45 ` [tip:perf/core] perf tools: Ensure return negative " tip-bot for Wang Nan

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=20141023214729.GQ14687@kernel.org \
    --to=acme@kernel.org \
    --cc=Waiman.Long@hp.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@redhat.com \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox