Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d9cad76 authored by Kan Liang's avatar Kan Liang Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: Configurable per thread proc map processing time out



The time out to limit the individual proc map processing was hard code
to 500ms. This patch introduce a new option --proc-map-timeout to make
the time limit configurable.

Signed-off-by: default avatarKan Liang <kan.liang@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ying Huang <ying.huang@intel.com>
Link: http://lkml.kernel.org/r/1434549071-25611-2-git-send-email-kan.liang@intel.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 930e6fcd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -151,6 +151,12 @@ STAT LIVE OPTIONS
       Show events other than HLT (x86 only) or Wait state (s390 only)
       that take longer than duration usecs.

--proc-map-timeout::
	When processing pre-existing threads /proc/XXX/mmap, it may take
	a long time, because the file may be huge. A time out is needed
	in such cases.
	This option sets the time out limit. The default value is 500 ms.

SEE ALSO
--------
linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1],
+5 −0
Original line number Diff line number Diff line
@@ -271,6 +271,11 @@ AUX area tracing event. Optionally the number of bytes to capture per
snapshot can be specified. In Snapshot Mode, trace data is captured only when
signal SIGUSR2 is received.

--proc-map-timeout::
When processing pre-existing threads /proc/XXX/mmap, it may take a long time,
because the file may be huge. A time out is needed in such cases.
This option sets the time out limit. The default value is 500 ms.

SEE ALSO
--------
linkperf:perf-stat[1], linkperf:perf-list[1]
+6 −0
Original line number Diff line number Diff line
@@ -201,6 +201,12 @@ Default is to monitor all CPUS.
	Force each column width to the provided list, for large terminal
	readability.  0 means no limit (default behavior).

--proc-map-timeout::
	When processing pre-existing threads /proc/XXX/mmap, it may take
	a long time, because the file may be huge. A time out is needed
	in such cases.
	This option sets the time out limit. The default value is 500 ms.


INTERACTIVE PROMPTING KEYS
--------------------------
+5 −0
Original line number Diff line number Diff line
@@ -121,6 +121,11 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
--event::
	Trace other events, see 'perf list' for a complete list.

--proc-map-timeout::
	When processing pre-existing threads /proc/XXX/mmap, it may take a long time,
	because the file may be huge. A time out is needed in such cases.
	This option sets the time out limit. The default value is 500 ms.

PAGEFAULTS
----------

+4 −1
Original line number Diff line number Diff line
@@ -1311,6 +1311,8 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
			"show events other than"
			" HLT (x86 only) or Wait state (s390 only)"
			" that take longer than duration usecs"),
		OPT_UINTEGER(0, "proc-map-timeout", &kvm->opts.proc_map_timeout,
				"per thread proc mmap processing timeout in ms"),
		OPT_END()
	};
	const char * const live_usage[] = {
@@ -1338,6 +1340,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
	kvm->opts.target.uses_mmap = false;
	kvm->opts.target.uid_str = NULL;
	kvm->opts.target.uid = UINT_MAX;
	kvm->opts.proc_map_timeout = 500;

	symbol__init(NULL);
	disable_buildid_cache();
@@ -1393,7 +1396,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
	perf_session__set_id_hdr_size(kvm->session);
	ordered_events__set_copy_on_queue(&kvm->session->ordered_events, true);
	machine__synthesize_threads(&kvm->session->machines.host, &kvm->opts.target,
				    kvm->evlist->threads, false);
				    kvm->evlist->threads, false, kvm->opts.proc_map_timeout);
	err = kvm_live_open_events(kvm);
	if (err)
		goto out;
Loading