static struct fio_mutex *startup_mutex, *disk_thread_mutex, *writeout_mutex

static struct fio_mutex *stat_mutex;
static struct fio_mutex *disk_util_mutex;

1job4k.fio :  ioengine = libaio

parse_options
   |
   +-- parse_jobs_ini
         +-- get_new_job(global, &def_thread, 0)
               +-- setup_thread_area
               +-- *td = *parent    (threads[i] = def_thread)        !  thread_data *threads


fio_backend()
   |
   |--- stat_init()                 stat_mutex    
   |--- create_disk_util_thread();
   |      +-- disk_thread_main    __s   
   |            +-- while loop
   |                +-- 1 second delay
   |                +-- update_io_ticks();                             *
   |                      +-- for disk_util
   |                           +-- update_io_tick_disk(du)
   |                +-- print_thread_status();  --> Jobs: 1 (f=1): [r] [100.0% done] [803.4MB/0KB/0KB /s]
   |
   |--- run_threads();
   |      +-- fio_idle_prof_init()
   |      +-- todo = nr_process = thread_number
   |      +-- setup_files => fio_file_open()
   |      +-- while loop
   |            +-- one time 'for' loop if TD_NOT_CREATED
   |                   +-- init_disk_util
   |                   +-- td_set_runstate(td, TD_CREATED)
   |                   +-- map[this_job++] = td;
   |                   +-- fork_main(shm_id, i);
   |                    +-- thread_main(td);
   |                               +-- td_set_runstate(td, TD_INITIALIZED)
   |                               +-- fio_mutex_up(startup_mutex)                ++
   |                               +-- while(keep_running(td))
   |                                      +-- do_io(td)                        !
   |                                                 +-- td_io_queue
   |                              +-- io_u_queued_complete              
   |                                      +-- ios_completed
   |                                                                +-- io_completed
   |                                                                       +-- account_io_completion
   |                                                                             +-- add_clat_sampled
   |                                                                             +-- io_u_mark_latency(td, lus);
   |                                                                             +-- ...
   |                                      +-- td_read(td) / tdq_write(td) / td_trim(td)
   |                                      +-- do_verify(td)
   |                               +-- td_set_runstate(td, TD_EXITED)                   
   |                   +-- fio_mutex_down_timeout(startup_mutex, 10)                --
   |            +-- td_set_runstate(td, TD_RUNNING) if TD_INITIALIZED, nr_running++;
   |            +-- while(nr_running)
   |                   +--reap_threads(&nr_running, ...)
   |                         +-- waitpid
   |                         +-- nr_running--;
   |
   +--- show_run_stats();  -->  rand-read: (groupid=0, jobs=1): err= 0: pid=13061: Fri Jun  3 12:19:26 2016

          +-- __show_run_stats();
                  +-- struct json_object *root = NULL;
          +-- init_group_run_stat  : group_run_stats   runstats
          +-- init_thread_stat     : thread_stat       threadstats

            +-- 'for' sum_thread_stats(ts, &td->ts, idx);
            +-- 'for' io
            +-- 'for' agg

                  +-- root = json_create_object();
              json_object_add_value_string (root, "fio version", fio_version_string);
              array = json_create_array();
              json_object_add_value_array  (root, "jobs", array);

                +-- 'for' (i = 0; i < nr_ts; i++) {
                ts = &threadstats[i]; rs = &runstats[ts->groupid];                 

    *            json_array_add_value_object(array, show_thread_status_json(ts, rs));      
                                 +-- add_ddir_status_json
                                       +-- calc_clat_percentiles

              }

            +-- show_disk_util(1, root);                   X
              show_idle_prof_stats(FIO_OUTPUT_JSON, root);        X        
              json_print_object(root);                         *

            +-- 'for' show_group_stats