Recent changes (master)
The following changes since commit e0409d5ffe6127961ddc4c495ec32b72a65e11bf:
thread_options: drop fadvise_stream from thread_options (2017-12-01 14:54:49 -0700)
are available in the git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to af7fb4aa2835b82847701237783c9ebe8ec8239a:
steadystate: style cleanup (2017-12-02 16:29:44 -0700)
----------------------------------------------------------------
Jens Axboe (2):
steadystate: add free helper
steadystate: style cleanup
backend.c | 7 +------ helper_thread.c | 3 +-- steadystate.c | 16 +++++++++++----- steadystate.h | 1 + 4 files changed, 14 insertions(+), 13 deletions(-)
---
Diff of recent changes:
backend.c +1 -6
@@ -2480,12 +2480,7 @@ int fio_backend(struct sk_out *sk_out) }for_each_td (td, i) { -if (td->ss.dur) { -if (td->ss.iops_data !=NULL ) { -free (td->ss.iops_data); -free (td->ss.bw_data); - } - } +steadystate_free (td);fio_options_free (td);if (td->rusage_sem) {fio_mutex_remove (td->rusage_sem);
helper_thread.c +1 -2
@@ -134,8 +134,7 @@ static void *helper_thread_main(void *data) next_ss =STEADYSTATE_MSEC - (since_ss -STEADYSTATE_MSEC ); else next_ss =STEADYSTATE_MSEC ; - } -else + }else next_ss =STEADYSTATE_MSEC - since_ss; }
steadystate.c +11 -5
@@ -6,6 +6,14 @@bool steadystate_enabled = false; +void steadystate_free (struct thread_data *td) +{ +free (td->ss.iops_data); +free (td->ss.bw_data); + td->ss.iops_data =NULL ; + td->ss.bw_data =NULL ; +} +static void steadystate_alloc (struct thread_data *td) { td->ss.bw_data =calloc (td->ss.dur,sizeof (uint64_t ));
@@ -16,8 +24,8 @@ static void steadystate_alloc(struct thread_data *td)void steadystate_setup (void ) { -int i, prev_groupid;struct thread_data *td, *prev_td; +int i, prev_groupid;if (!steadystate_enabled)return ;
@@ -39,17 +47,15 @@ void steadystate_setup(void) }if (prev_groupid != td->groupid) { -if (prev_td !=NULL ) { +if (prev_td)steadystate_alloc (prev_td); - } prev_groupid = td->groupid; } prev_td = td; } -if (prev_td !=NULL && prev_td->o.group_reporting) { +if (prev_td && prev_td->o.group_reporting)steadystate_alloc (prev_td); - } } static bool steadystate_slope(uint64_t iops, uint64_t bw,
steadystate.h +1 -0
@@ -5,6 +5,7 @@#include "thread_options.h" #include "lib/ieee754.h" +extern void steadystate_free (struct thread_data *);extern void steadystate_check (void );extern void steadystate_setup (void );extern int td_steadystate_init (struct thread_data *);