From 6a8d33c2bb81f071715864c2e563ac17ae4f9967 Mon Sep 17 00:00:00 2001 From: Thomas Wood Date: Tue, 30 Sep 2014 17:05:39 +0100 Subject: lib: add a function to indicate activity Signed-off-by: Thomas Wood --- lib/igt_aux.c | 15 +++++++++++++++ lib/igt_aux.h | 1 + 2 files changed, 16 insertions(+) (limited to 'lib') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index c0ea0e20..7c07b7d0 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -246,6 +246,21 @@ void igt_progress(const char *header, uint64_t i, uint64_t total) (long long unsigned)i * 100 / total); } +/** + * igt_print_activity: + * + * Print a '.' to indicate activity. This is printed without a newline and + * only if output is to a terminal. + */ +void igt_print_activity(void) +{ + if (!isatty(STDOUT_FILENO)) + return; + + igt_info("."); + fflush(stdout); +} + /* mappable aperture trasher helper */ drm_intel_bo **trash_bos; int num_trash_bos; diff --git a/lib/igt_aux.h b/lib/igt_aux.h index d958abeb..d74bb8c4 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -41,6 +41,7 @@ void igt_permute_array(void *array, unsigned size, unsigned i, unsigned j)); void igt_progress(const char *header, uint64_t i, uint64_t total); +void igt_print_activity(void); bool igt_check_boolean_env_var(const char *env_var, bool default_value); bool igt_aub_dump_enabled(void); -- cgit v1.2.3