@@ -73,17 +73,20 @@ HTTP Callbacks (see later)
73
73
static void http_respond (fio_http_s * h );
74
74
75
75
/* *****************************************************************************
76
- Main
76
+ Timers
77
77
***************************************************************************** */
78
-
79
78
static int heartbeat (void * i1 , void * i2 ) {
80
79
(void )i1 , (void )i2 ;
81
- if (!fio_io_is_master ())
80
+ if (i1 && !fio_io_is_master ())
82
81
return -1 ;
83
82
FIO_LOG_INFO ("(%d) heartbeat" , fio_io_pid ());
84
83
return 0 ;
85
84
}
86
85
86
+ /* *****************************************************************************
87
+ Main
88
+ ***************************************************************************** */
89
+
87
90
int main (int argc , char const * argv []) {
88
91
static fio_io_async_s http_queue ; /* async queue for worker threads. */
89
92
@@ -166,16 +169,20 @@ int main(int argc, char const *argv[]) {
166
169
"Containers sometimes impose file-system restrictions, i.e.," ),
167
170
FIO_CLI_PRINT ("the IPC Unix Socket might need to be placed in `/tmp`." ),
168
171
FIO_CLI_INT ("--heartbeat -ph Prints a heartbeat every requested number "
169
- "of seconds." ));
172
+ "of seconds." ),
173
+ FIO_CLI_BOOL ("-phw Prints the heartbeat also on worker processes." ));
170
174
171
175
/* review CLI for logging */
172
176
if (fio_cli_get_bool ("-V" )) {
173
177
FIO_LOG_LEVEL = FIO_LOG_LEVEL_DEBUG ;
174
178
}
179
+ if (fio_cli_get_bool ("-phw" ) && !fio_cli_get_i ("-ph" ))
180
+ fio_cli_set_i ("-ph" , 1 );
175
181
/* schedule heartbeat */
176
182
if (fio_cli_get_i ("-ph" ))
177
183
fio_io_run_every (.every = (fio_cli_get_i ("-ph" ) * 1000 ),
178
184
.fn = heartbeat ,
185
+ .udata1 = (void * )(uintptr_t )fio_cli_get_bool ("-phw" ),
179
186
.repetitions = -1 );
180
187
181
188
if (fio_cli_get_bool ("-C" )) { /* container - place pub/sub socket in tmp */
0 commit comments