Line data Source code
1 : #include "fd_event_report.h" 2 : 3 : /* Thread-local reporter state. fd_event_tl points at fd_event_tl_storage 4 : for tiles that have an event link, else stays NULL. */ 5 : 6 : FD_TL fd_event_reporter_t * fd_event_tl = NULL; 7 : 8 : static FD_TL fd_event_reporter_t fd_event_tl_storage[1]; 9 : 10 : void 11 : fd_event_register( fd_topo_t const * topo, 12 0 : fd_topo_tile_t const * tile ) { 13 0 : fd_event_tl = NULL; 14 : 15 0 : if( FD_LIKELY( tile->event_link_id==ULONG_MAX ) ) return; /* no event link */ 16 : 17 0 : fd_topo_link_t const * link = &topo->links[ tile->event_link_id ]; 18 0 : FD_TEST( link->mcache ); 19 0 : FD_TEST( link->dcache ); 20 : 21 0 : fd_event_reporter_t * r = fd_event_tl_storage; 22 0 : r->mcache = link->mcache; 23 0 : r->depth = fd_mcache_depth( link->mcache ); 24 0 : r->seq = 0UL; 25 0 : r->mem = fd_wksp_containing( link->dcache ); 26 0 : FD_TEST( r->mem ); 27 0 : r->chunk0 = fd_dcache_compact_chunk0( r->mem, link->dcache ); 28 0 : r->wmark = fd_dcache_compact_wmark ( r->mem, link->dcache, link->mtu ); 29 0 : r->chunk = r->chunk0; 30 0 : r->mtu = link->mtu; 31 : 32 0 : fd_event_tl = r; 33 0 : }