History

perf core: Per event callchain limit

Additionally to being able to control the system wide maximum depth via /proc/sys/kernel/perf_event_max_stack, now we are able to ask for different depths per event, using perf_event_attr.sample_max_stack for that. This uses an u16 hole at the end of perf_event_attr, that, when perf_event_attr.sample_type has the PERF_SAMPLE_CALLCHAIN, if sample_max_stack is zero, means use perf_event_max_stack, otherwise it'll be bounds checked under callchain_mutex.

Arnaldo Carvalho de Melo committed 10 years ago

Commit 97c79a31 parent 480ca355 files · +23 −6Browse files

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

Unified · Split

include/uapi/linux/perf_event.h+5−1
@@ -276,6 +276,9 @@ enum perf_event_read_format { · 275 unmodified lines
276276
277277 /*
278278 * Hardware event_id to monitor via a performance monitoring event:
279+ *
280+ * @sample_max_stack: Max number of frame pointers in a callchain,
281+ * should be < /proc/sys/kernel/perf_event_max_stack
279282 */
280283 struct perf_event_attr {
281284
@@ -385,7 +388,8 @@ struct perf_event_attr { · 103 unmodified lines
385388 * Wakeup watermark for AUX area
386389 */
387390 __u32 aux_watermark;
388− __u32 __reserved_2; /* align to __u64 */
391+ __u16 sample_max_stack;
392+ __u16 __reserved_2; /* align to __u64 */
389393 };
390394
391395 #define perf_flags(attr) (*(&(attr)->read_format + 1))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t