|
@@ -378,7 +378,8 @@ struct perf_event_mmap_page {
|
|
|
struct {
|
|
|
__u64 cap_usr_time : 1,
|
|
|
cap_usr_rdpmc : 1,
|
|
|
- cap_____res : 62;
|
|
|
+ cap_usr_time_zero : 1,
|
|
|
+ cap_____res : 61;
|
|
|
};
|
|
|
};
|
|
|
|
|
@@ -420,12 +421,29 @@ struct perf_event_mmap_page {
|
|
|
__u16 time_shift;
|
|
|
__u32 time_mult;
|
|
|
__u64 time_offset;
|
|
|
+ /*
|
|
|
+ * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated
|
|
|
+ * from sample timestamps.
|
|
|
+ *
|
|
|
+ * time = timestamp - time_zero;
|
|
|
+ * quot = time / time_mult;
|
|
|
+ * rem = time % time_mult;
|
|
|
+ * cyc = (quot << time_shift) + (rem << time_shift) / time_mult;
|
|
|
+ *
|
|
|
+ * And vice versa:
|
|
|
+ *
|
|
|
+ * quot = cyc >> time_shift;
|
|
|
+ * rem = cyc & ((1 << time_shift) - 1);
|
|
|
+ * timestamp = time_zero + quot * time_mult +
|
|
|
+ * ((rem * time_mult) >> time_shift);
|
|
|
+ */
|
|
|
+ __u64 time_zero;
|
|
|
|
|
|
/*
|
|
|
* Hole for extension of the self monitor capabilities
|
|
|
*/
|
|
|
|
|
|
- __u64 __reserved[120]; /* align to 1k */
|
|
|
+ __u64 __reserved[119]; /* align to 1k */
|
|
|
|
|
|
/*
|
|
|
* Control data for the mmap() data buffer.
|