diff options
author | Thomas Wood <thomas.wood@intel.com> | 2014-09-30 17:05:39 +0100 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2014-09-30 17:54:12 +0100 |
commit | 6a8d33c2bb81f071715864c2e563ac17ae4f9967 (patch) | |
tree | 655b284e6b73e0695fecd90b1d7a615255aff7d1 /lib | |
parent | c2d5519906f3b7d75b4fbf14c61c5f54d9d75214 (diff) |
lib: add a function to indicate activity
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_aux.c | 15 | ||||
-rw-r--r-- | lib/igt_aux.h | 1 |
2 files changed, 16 insertions, 0 deletions
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); |