linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
	Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH 1/2] perf-tool: Don't process samples with no valid machine object
Date: Fri, 10 Feb 2012 11:31:59 -0200	[thread overview]
Message-ID: <20120210133159.GF2526@infradead.org> (raw)
In-Reply-To: <20120209171334.GR22598@amd.com>

Em Thu, Feb 09, 2012 at 06:13:34PM +0100, Joerg Roedel escreveu:
> On Thu, Feb 09, 2012 at 02:34:41PM -0200, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Feb 09, 2012 at 05:07:38PM +0100, Joerg Roedel escreveu:
> > > -		if (event->header.type == PERF_RECORD_SAMPLE) {
> > > +		if (event->header.type == PERF_RECORD_SAMPLE && machine != NULL) {
> > 
> > Shouldn't we warn the user, even if just once, on the status (last line
> > on the screen) line?
> 
> Probably yes, what would be a good message? I guess something like
> 
> 	"no machine object for sample"
> 
> is not helpful to the user. Maybe something like
> 
> 	"Unresolvable sample(s) recorded"?
> 
> Or something completly different?

This is not completely standardized or harminized across the sources,
but we have things like:

	if (verbose)
		error("Failed to resolve callchain.  Skipping\n");

---

        if (perf_event__preprocess_sample(event, machine, &al, sample,
                                          NULL) < 0) {
                error("problem processing %d event, skipping it.\n",
                        event->header.type);
                return;
        }

---

       if (!ip_callchain__valid(sample->callchain, event)) {
                pr_debug("call-chain problem with event, skipping it.\n");
                ++session->hists.stats.nr_invalid_chains;

---


	What has been done more recently is like the above, account the
number of different problems and then, at the end do like:

        if (session->hists.stats.nr_unknown_id != 0) {
                ui__warning("%u samples with id not present in the header\n",
                            session->hists.stats.nr_unknown_id);
        }


	But this is for perf report or other tools that process all
events and then provide some post processed results, just before
presenting these results.

	I guess we could do that too for 'perf top' like tools, that
continuously show results while collecting more. Perhaps call
ui__warning() if some threshold happens, i.e. if way too many errors of
some kind are happening and then at the end provide a summary of errors
found.

- Arnaldo

  reply	other threads:[~2012-02-10 13:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 16:07 [PATCH 0/2] Fix perf-tool crashes when kvm guest is running Joerg Roedel
2012-02-09 16:07 ` [PATCH 1/2] perf-tool: Don't process samples with no valid machine object Joerg Roedel
2012-02-09 16:34   ` Arnaldo Carvalho de Melo
2012-02-09 17:13     ` Joerg Roedel
2012-02-10 13:31       ` Arnaldo Carvalho de Melo [this message]
2012-02-09 16:07 ` [PATCH 2/2] perf-tool: Change perf_guest default back to false Joerg Roedel
  -- strict thread matches above, loose matches on Subject: below --
2012-02-10 17:05 [PATCH 0/2 v2] Fix perf-tool crashes when kvm guest is running Joerg Roedel
2012-02-10 17:05 ` [PATCH 1/2] perf-tool: Don't process samples with no valid machine object Joerg Roedel

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=20120210133159.GF2526@infradead.org \
    --to=acme@ghostprotocols.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dsahern@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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).