1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-27 02:18:21 +00:00

switch autotune.c to event_log_*

This commit is contained in:
jsteube 2016-10-08 23:44:05 +02:00
parent 88565b4a5e
commit 25a1f7ab84

View File

@ -5,7 +5,7 @@
#include "common.h"
#include "types.h"
#include "logging.h"
#include "event.h"
#include "opencl.h"
#include "status.h"
#include "terminal.h"
@ -99,7 +99,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
if (CL_err != CL_SUCCESS)
{
log_error ("ERROR: clEnqueueWriteBuffer(): %s\n", val2cstr_cl (CL_err));
event_log_error (hashcat_ctx, "ERROR: clEnqueueWriteBuffer(): %s\n", val2cstr_cl (CL_err));
return -1;
}
@ -113,7 +113,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
if (CL_err != CL_SUCCESS)
{
log_error ("ERROR: clEnqueueCopyBuffer(): %s\n", val2cstr_cl (CL_err));
event_log_error (hashcat_ctx, "ERROR: clEnqueueCopyBuffer(): %s\n", val2cstr_cl (CL_err));
return -1;
}
@ -284,10 +284,13 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
{
clear_prompt ();
log_info ("- Device #%u: autotuned kernel-accel to %u\n"
"- Device #%u: autotuned kernel-loops to %u\n",
device_param->device_id + 1, kernel_accel,
device_param->device_id + 1, kernel_loops);
printf
(
"- Device #%u: autotuned kernel-accel to %u\n"
"- Device #%u: autotuned kernel-loops to %u\n",
device_param->device_id + 1, kernel_accel,
device_param->device_id + 1, kernel_loops
);
send_prompt ();
}
@ -311,7 +314,12 @@ void *thread_autotune (void *p)
if (device_param->skipped) return NULL;
autotune (hashcat_ctx, device_param);
const int rc_autotune = autotune (hashcat_ctx, device_param);
if (rc_autotune == -1)
{
// we should do something here, tell hashcat main that autotune failed to abort
}
return NULL;
}