• P
    perf: Untangle 'owner' confusion · 60beda84
    Peter Zijlstra 提交于
    There are two concepts of owner wrt an event and they are conflated:
    
     - event::owner / event::owner_list,
       used by prctl(.option = PR_TASK_PERF_EVENTS_{EN,DIS}ABLE).
    
     - the 'owner' of the event object, typically the file descriptor.
    
    Currently these two concepts are conflated, which gives trouble with
    scm_rights passing of file descriptors. Passing the event and then
    closing the creating task would render the event 'orphan' and would
    have it cleared out. Unlikely what is expectd.
    
    This patch untangles these two concepts by using PERF_EVENT_STATE_EXIT
    to denote the second type.
    Reported-by: NAlexei Starovoitov <alexei.starovoitov@gmail.com>
    Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vince Weaver <vincent.weaver@maine.edu>
    Signed-off-by: NIngo Molnar <mingo@kernel.org>
    60beda84
core.c 220.8 KB