6060 recent_slots_per_file configuration. The default is 128 slots per
6161 file. The files are named recent_0.solcap, recent_1.solcap,. The
6262 files are rotated when the current file reaches the number of slots
63- per file.
63+ per file.
6464*/
6565
6666struct fd_capture_tile_ctx {
@@ -122,10 +122,10 @@ populate_allowed_seccomp( fd_topo_t const * topo,
122122 struct sock_filter * out ) {
123123 void * scratch = fd_topo_obj_laddr ( topo , tile -> tile_obj_id );
124124 fd_capture_tile_ctx_t const * ctx = (fd_capture_tile_ctx_t const * )scratch ;
125-
125+
126126 uint solcap_fd_0 = ctx -> recent_only ? (uint )ctx -> recent_fds [0 ] : (uint )ctx -> fd ;
127127 uint solcap_fd_1 = ctx -> recent_only ? (uint )ctx -> recent_fds [1 ] : (uint )ctx -> fd ;
128-
128+
129129 populate_sock_filter_policy_fd_capture_tile ( out_cnt ,
130130 out ,
131131 (uint )fd_log_private_logfile_fd (),
@@ -141,13 +141,13 @@ populate_allowed_fds( fd_topo_t const * topo,
141141 int * out_fds ) {
142142 void * scratch = fd_topo_obj_laddr ( topo , tile -> tile_obj_id );
143143 fd_capture_tile_ctx_t const * ctx = (fd_capture_tile_ctx_t const * )scratch ;
144-
144+
145145 ulong out_cnt = 0UL ;
146146
147147 out_fds [ out_cnt ++ ] = 2 ; /* stderr */
148148 if ( FD_LIKELY ( -1 != fd_log_private_logfile_fd () ) )
149149 out_fds [ out_cnt ++ ] = fd_log_private_logfile_fd ();
150-
150+
151151 if ( ctx -> recent_only ) {
152152 /* In recent_only mode, allow both flip-flop file descriptors */
153153 if ( FD_LIKELY ( -1 != ctx -> recent_fds [0 ] ) )
@@ -226,7 +226,7 @@ fd_capctx_buf_process_msg(fd_capture_tile_ctx_t * ctx,
226226 - SOM (Start of Message): Set on the first fragment of a message
227227 - EOM (End of Message): Set on the last fragment of a message
228228
229- For a single-fragment message:
229+ For a single-fragment message:
230230 Single Fragment: SOM=1, EOM=1
231231 For a multi-fragment message:
232232 First fragment: SOM=1, EOM=0
@@ -310,8 +310,8 @@ returnable_frag( fd_capture_tile_ctx_t * ctx,
310310 int next_fd = ctx -> recent_fds [next_idx ];
311311
312312 /* The following is a series of checks to ensure the file is
313- synced and truncated correctly. This occurs via:
314- 1. Syncing the current file
313+ synced and truncated correctly. This occurs via:
314+ 1. Syncing the current file
315315 2. Syncing the next file
316316 3. Truncating the next file
317317 4. Resetting the file descriptor position to 0
@@ -321,7 +321,7 @@ returnable_frag( fd_capture_tile_ctx_t * ctx,
321321 FD_TEST ( fsync ( next_fd ) == 0 );
322322 FD_TEST ( ftruncate ( next_fd , 0L ) == 0 );
323323 FD_TEST ( lseek ( next_fd , 0L , SEEK_SET ) == 0L );
324-
324+
325325 fd_solcap_writer_init ( ctx -> capture_ctx -> capture , next_fd );
326326 ctx -> recent_current_idx = next_idx ;
327327 ctx -> recent_file_start_slot = msg_hdr -> slot ;
@@ -386,41 +386,41 @@ privileged_init( fd_topo_t * topo,
386386 /* recent_only=1: Ensure path is a directory, create if not exists */
387387 if ( stat_result != 0 ) {
388388 if ( FD_UNLIKELY ( mkdir (tile -> capctx .solcap_capture , 0755 ) != 0 ) ) {
389- FD_LOG_ERR (( "solcap_recent_only=1 but could not create directory: %s (%i-%s)" ,
389+ FD_LOG_ERR (( "solcap_recent_only=1 but could not create directory: %s (%i-%s)" ,
390390 tile -> capctx .solcap_capture , errno , strerror (errno ) ));
391391 }
392392 } else if ( FD_UNLIKELY ( !S_ISDIR (path_stat .st_mode ) ) ) {
393393 FD_LOG_ERR (( "solcap_recent_only=1 but path is not a directory: %s" , tile -> capctx .solcap_capture ));
394394 }
395-
395+
396396 ctx -> recent_current_idx = 0 ;
397397 ctx -> recent_file_start_slot = 0UL ; /* Will be set on first fragment */
398-
398+
399399 for ( ulong i = 0 ; i < 2 ; i ++ ) {
400400 char filepath [PATH_MAX ];
401401 int ret = snprintf ( filepath , PATH_MAX , "%s/recent_%lu.solcap" , tile -> capctx .solcap_capture , i );
402402 if ( FD_UNLIKELY ( ret < 0 || ret >=PATH_MAX ) ) {
403403 FD_LOG_ERR (( "snprintf failed or path too long for recent file %lu" , i ));
404404 }
405-
405+
406406 ctx -> recent_fds [i ] = open ( filepath , O_RDWR | O_CREAT | O_TRUNC , 0644 );
407407 if ( FD_UNLIKELY ( ctx -> recent_fds [i ] == -1 ) ) {
408- FD_LOG_ERR (( "failed to open or create solcap recent file %s (%i-%s)" ,
408+ FD_LOG_ERR (( "failed to open or create solcap recent file %s (%i-%s)" ,
409409 filepath , errno , strerror (errno ) ));
410410 }
411411 }
412-
412+
413413 ctx -> fd = ctx -> recent_fds [0 ];
414-
414+
415415 } else {
416416 /* recent_only=0: Validate that path is a file*/
417417 if ( FD_UNLIKELY ( stat_result == 0 && S_ISDIR (path_stat .st_mode ) ) ) {
418418 FD_LOG_ERR (( "solcap_recent_only=0 but path is a directory: %s (should be a file path)" , tile -> capctx .solcap_capture ));
419419 }
420-
420+
421421 ctx -> fd = open ( tile -> capctx .solcap_capture , O_RDWR | O_CREAT | O_TRUNC , 0644 );
422422 if ( FD_UNLIKELY ( ctx -> fd == -1 ) ) {
423- FD_LOG_ERR (( "failed to open or create solcap capture file %s (%i-%s)" ,
423+ FD_LOG_ERR (( "failed to open or create solcap capture file %s (%i-%s)" ,
424424 tile -> capctx .solcap_capture , errno , strerror (errno ) ));
425425 }
426426 }
0 commit comments