• Jonas Ådahl's avatar
    cogl: Add libsysprof capture based tracing · e5e58f80
    Jonas Ådahl authored
    Add the ability to add tracing instrumentation to the code. When
    enabled, trace entries will generate a file with timing information
    that will be processable by sysprof for generating visualization of
    traces over time.
    
    While enabled by default at compile time, it is possible to disable the
    expansion of the macros completely by passing --disable-tracing to
    ./configure.
    
    Tracing is so far only actually done if actually enabled on explicitly
    specified threads.
    
    This will be used by Mutter passing the write end of a pipe, where the
    read end is sent to Sysprof itself via the D-Bus method 'Capture()'.
    
    By passing that, we have to detect EPIPE that is sent when Sysprof stops
    recording. Fortunately, we already ignore the signal at meta_init(), so
    no need to add a custom signal handler.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/197
    e5e58f80