From c4870676c45277adc926a889f208b3b80bb49f64 Mon Sep 17 00:00:00 2001 From: Paul Sheppard Date: Tue, 3 Jul 2012 10:40:02 -0700 Subject: [PATCH] Add api stats (sleep time) --- driver-bitforce.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/driver-bitforce.c b/driver-bitforce.c index 5d89028f..27494c46 100644 --- a/driver-bitforce.c +++ b/driver-bitforce.c @@ -442,10 +442,24 @@ static bool bitforce_thread_init(struct thr_info *thr) return true; } +static struct api_data *bitforce_api_stats(struct cgpu_info *cgpu) +{ + struct api_data *root = NULL; + + // Warning, access to these is not locked - but we don't really + // care since hashing performance is way more important than + // locking access to displaying API debug 'stats' + // If locking becomes an issue for any of them, use copy_data=true also + root = api_add_int(root, "Sleep Time", &(cgpu->sleep_ms), false); + + return root; +} + struct device_api bitforce_api = { .dname = "bitforce", .name = "BFL", .api_detect = bitforce_detect, + .get_api_stats = bitforce_api_stats, .reinit_device = bitforce_init, .get_statline_before = get_bitforce_statline_before, .get_stats = bitforce_get_stats,