• Robert Haas's avatar
    Extend framework from commit 53be0b1a to report latch waits. · 6f3bd98e
    Robert Haas authored
    WaitLatch, WaitLatchOrSocket, and WaitEventSetWait now taken an
    additional wait_event_info parameter; legal values are defined in
    pgstat.h.  This makes it possible to uniquely identify every point in
    the core code where we are waiting for a latch; extensions can pass
    WAIT_EXTENSION.
    
    Because latches were the major wait primitive not previously covered
    by this patch, it is now possible to see information in
    pg_stat_activity on a large number of important wait events not
    previously addressed, such as ClientRead, ClientWrite, and SyncRep.
    
    Unfortunately, many of the wait events added by this patch will fail
    to appear in pg_stat_activity because they're only used in background
    processes which don't currently appear in pg_stat_activity.  We should
    fix this either by creating a separate view for such information, or
    else by deciding to include them in pg_stat_activity after all.
    
    Michael Paquier and Robert Haas, reviewed by Alexander Korotkov and
    Thomas Munro.
    6f3bd98e
shm_mq.c 34.9 KB