History

perf tools: Add time out to force stop proc map processing

System wide sampling like 'perf top' or 'perf record -a' read all threads /proc/xxx/maps before sampling. If there are any threads which generating a keeping growing huge maps, perf will do infinite loop during synthesizing. Nothing will be sampled. This patch fixes this issue by adding per-thread timeout to force stop this kind of endless proc map processing. PERF_RECORD_MISC_PROC_MAP_PARSE_TIME_OUT is introduced to indicate that the mmap record are truncated by time out. User will get warning notification when truncated mmap records are detected.

Kan Liang committed 11 years ago

Commit 930e6fc1 parent c05676c4 files · +34 −0Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/perf_event.h+4−0
@@ -565,6 +565,10 @@ struct perf_event_mmap_page { · 564 unmodified lines
565#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)565#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
566#define PERF_RECORD_MISC_GUEST_USER (5 << 0)566#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
567 567
568/*
569 * Indicates that /proc/PID/maps parsing are truncated by time out.
570 */
571#define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12)
568/*572/*
569 * PERF_RECORD_MISC_MMAP_DATA and PERF_RECORD_MISC_COMM_EXEC are used on573 * PERF_RECORD_MISC_MMAP_DATA and PERF_RECORD_MISC_COMM_EXEC are used on
570 * different events so can reuse the same bit position.574 * different events so can reuse the same bit position.