lkml.org 
[lkml]   [2012]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] perf-tool: Don't process samples with no valid machine object
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


\
 
 \ /
  Last update: 2012-02-10 14:35    [W:0.067 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site