]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/blobdiff - include/linux/perf_event.h
perf: Fix inherit vs. context rotation bug
[lisovros/linux_canprio.git] / include / linux / perf_event.h
index 057bf22a8323463a6bd9279d6928d3fea7ed8eb8..142e3d6042c721dc1176ba6d8f484bf7d09617c0 100644 (file)
@@ -747,6 +747,16 @@ struct perf_event {
        u64                             tstamp_running;
        u64                             tstamp_stopped;
 
+       /*
+        * timestamp shadows the actual context timing but it can
+        * be safely used in NMI interrupt context. It reflects the
+        * context time as it was when the event was last scheduled in.
+        *
+        * ctx_time already accounts for ctx->timestamp. Therefore to
+        * compute ctx_time for a sample, simply add perf_clock().
+        */
+       u64                             shadow_ctx_time;
+
        struct perf_event_attr          attr;
        struct hw_perf_event            hw;
 
@@ -840,6 +850,7 @@ struct perf_event_context {
        int                             nr_active;
        int                             is_active;
        int                             nr_stat;
+       int                             rotate_disable;
        atomic_t                        refcount;
        struct task_struct              *task;