From 8903adb164ce6e6c554dc9cb9634a725dabcceb0 Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 18 Jul 2018 18:14:42 +0200 Subject: [PATCH] Added OpenCL device utilization to status information in machine readable output --- docs/changes.txt | 1 + src/terminal.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index f92831f3d..fb1b3668e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -14,6 +14,7 @@ - OpenCL kernels: Abort session if kernel self-test failed - OpenCL kernels: Add '-pure' prefix to kernel filenames to avoid problems caused by reusing existing hashcat installation folder - Added JtR-compatible support for hex notation in rules engine +- Added OpenCL device utilization to status information in machine readable output ## ## Bugs diff --git a/src/terminal.c b/src/terminal.c index d6192e97f..75b8fd65c 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -848,6 +848,21 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx) printf ("REJECTED\t%" PRIu64 "\t", hashcat_status->progress_rejected); + printf ("UTIL\t"); + + for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++) + { + const device_info_t *device_info = hashcat_status->device_info_buf + device_id; + + if (device_info->skipped_dev == true) continue; + + // ok, little cheat here again... + + const int util = hm_get_utilization_with_device_id (hashcat_ctx, device_id); + + printf ("%d\t", util); + } + hc_fwrite (EOL, strlen (EOL), 1, stdout); fflush (stdout);