Re: [PATCH 1/1] perf,tools: add time out to force stop endless mmap processing

From: David Ahern
Date: Tue Jun 16 2015 - 11:57:29 EST


On 6/16/15 9:11 AM, Arnaldo Carvalho de Melo wrote:
Then, that being said, having a sane upper limit on the time for
processing those events makes the tool more robust and allows it to do
most of its work, just samples for the maps not synthesized will fail to
get resolved to symbols/DSOs.

If you are going to use timeouts then you need a sane upper limit on walking /proc altogether as well. i.e, one time limit for individual proc files (ie, time limit per task), and one for all of /proc (i.e, time limit for all of synthesized_threads). What is a reasonable time limit for each? Will it be configurable or hardcoded?

If perf aborts data collection for either a case the user should get a warning.


For those cases we should, during synthesizing, do both what Kan did in
his patch, i.e. emit a log warning with the COMM/PID that we are
truncating /proc/PID/maps parsing, and increment a counter that, just
after we finish synthesizing we should report, in a similar way as we
do in perf_session__warn_about_errors() after processing events,
something like:

+--------------------------------------------------------+
| %d map information files for pre-existing threads were |
| not processed, if there are samples for addresses they |
| will not be resolved, you may find out which are these |
| threads by running with -v and redirecting the output |
| to a file. |
+--------------------------------------------------------+

Ideally, as an extra step, we could flip a flag on the 'struct thread'
where these maps got truncated and add some visual cue to the
hist_entry instances (lines in the top UI).

Perhaps we should add a per-thread-proc-map-processing timeout parameter
to the synthesizing routines instead of having that hardcoded, i.e.
allow the tool to specify what is reasonable for it, but that wouldn't
be strictly required for a first patch, emitting the dialog box above
after synthesizing, if truncation happened, is.

Agreed?

And then report side there should be a warning as well (record can be done by one person and analysis by another).

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/