perf: Introduce hw_perf_event->tp_target and ->tp_list
[firefly-linux-kernel-4.4.55.git] / kernel / events / core.c
index 301079d06f24ebe44081a286766436de104a3a91..e2d4323c6ae631edb2c3eb75f353f2df7c505f8c 100644 (file)
@@ -6162,11 +6162,14 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
 
        if (task) {
                event->attach_state = PERF_ATTACH_TASK;
+
+               if (attr->type == PERF_TYPE_TRACEPOINT)
+                       event->hw.tp_target = task;
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
                /*
                 * hw_breakpoint is a bit difficult here..
                 */
-               if (attr->type == PERF_TYPE_BREAKPOINT)
+               else if (attr->type == PERF_TYPE_BREAKPOINT)
                        event->hw.bp_target = task;
 #endif
        }