Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Jun 30, 2018

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 9caaf02b06deecf0b0a13c16b6d59dddc64b8c35:

Merge branch 'doc-norandommap' of https://github.com/larrystevenwise/fio (2018-06-21 11:22:41 -0600)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 354d50e771451f510e5886275768abb63b602798:

Fix compilation without cgroups (2018-06-29 08:00:29 -0600)

----------------------------------------------------------------
Jens Axboe (1):
Fix compilation without cgroups

Josef Bacik (2):
fio: work with cgroup2 as well
fio: add job_runtime to the thread json output

 backend.c |  5 ++---
 cgroup.c  | 64 ++++++++++++++++++++++++++++++++++++++++++++-------------------
 cgroup.h  | 15 +++++++++++----
 stat.c    |  1 +
 4 files changed, 59 insertions(+), 26 deletions(-)

---

Diff of recent changes:

backend.c +2 -3
index c52eba5..a7e9184 100644
@@ -50,7 +50,7 @@
 
 static struct fio_sem *startup_sem;
 static struct flist_head *cgroup_list;
-static char *cgroup_mnt;
+static struct cgroup_mnt *cgroup_mnt;
 static int exit_value;
 static volatile int fio_abort;
 static unsigned int nr_process = 0;
@@ -1886,7 +1886,7 @@ err:
 	close_and_free_files(td);
 	cleanup_io_u(td);
 	close_ioengine(td);
-	cgroup_shutdown(td, &cgroup_mnt);
+	cgroup_shutdown(td, cgroup_mnt);
 	verify_free_state(td);
 
 	if (td->zone_state_index) {
@@ -2508,7 +2508,6 @@ int fio_backend(struct sk_out *sk_out)
 		cgroup_kill(cgroup_list);
 		sfree(cgroup_list);
 	}
-	sfree(cgroup_mnt);
 
 	fio_sem_remove(startup_sem);
 	stat_exit();
cgroup.c +45 -19

135 lines not on this page · raw message

cgroup.h +11 -4
index 0bbe25a..10313b7 100644
@@ -3,21 +3,28 @@
 
 #ifdef FIO_HAVE_CGROUPS
 
-int cgroup_setup(struct thread_data *, struct flist_head *, char **);
-void cgroup_shutdown(struct thread_data *, char **);
+struct cgroup_mnt {
+	char *path;
+	bool cgroup2;
+};
+
+int cgroup_setup(struct thread_data *, struct flist_head *, struct cgroup_mnt **);
+void cgroup_shutdown(struct thread_data *, struct cgroup_mnt *);
 
 void cgroup_kill(struct flist_head *list);
 
 #else
 
+struct cgroup_mnt;
+
 static inline int cgroup_setup(struct thread_data *td, struct flist_head *list,
-			       char **mnt)
+			       struct cgroup_mnt **mnt)
 {
 	td_verror(td, EINVAL, "cgroup_setup");
 	return 1;
 }
 
-static inline void cgroup_shutdown(struct thread_data *td, char **mnt)
+static inline void cgroup_shutdown(struct thread_data *td, struct cgroup_mnt *mnt)
 {
 }
 
stat.c +1 -0
index d5240d9..a308eb8 100644
@@ -1288,6 +1288,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
 		usr_cpu = 0;
 		sys_cpu = 0;
 	}
+	json_object_add_value_int(root, "job_runtime", ts->total_run_time);
 	json_object_add_value_float(root, "usr_cpu", usr_cpu);
 	json_object_add_value_float(root, "sys_cpu", sys_cpu);
 	json_object_add_value_int(root, "ctx", ts->ctx);