diff --git a/src/concurrency/ocf_cache_line_concurrency.c b/src/concurrency/ocf_cache_line_concurrency.c index 637eb88..ae66a1d 100644 --- a/src/concurrency/ocf_cache_line_concurrency.c +++ b/src/concurrency/ocf_cache_line_concurrency.c @@ -247,7 +247,7 @@ uint32_t ocf_cache_line_concurrency_suspended_no(struct ocf_alock *alock) return ocf_alock_waitlist_count(alock); } -#define ALLOCATOR_NAME_FMT "ocf_%s_cache_concurrency" +#define ALLOCATOR_NAME_FMT "ocf_%s_cl_conc" #define ALLOCATOR_NAME_MAX (sizeof(ALLOCATOR_NAME_FMT) + OCF_CACHE_NAME_SIZE) int ocf_cache_line_concurrency_init(struct ocf_alock **self, diff --git a/src/concurrency/ocf_mio_concurrency.c b/src/concurrency/ocf_mio_concurrency.c index 80cbbcc..f34aeb0 100644 --- a/src/concurrency/ocf_mio_concurrency.c +++ b/src/concurrency/ocf_mio_concurrency.c @@ -131,7 +131,7 @@ void ocf_mio_async_unlock(struct ocf_alock *alock, } -#define ALLOCATOR_NAME_FMT "ocf_%s_mio_concurrency" +#define ALLOCATOR_NAME_FMT "ocf_%s_mio_conc" #define ALLOCATOR_NAME_MAX (sizeof(ALLOCATOR_NAME_FMT) + OCF_CACHE_NAME_SIZE) int ocf_mio_concurrency_init(struct ocf_alock **self, diff --git a/src/utils/utils_alock.c b/src/utils/utils_alock.c index d00a5f4..0a25b1b 100644 --- a/src/utils/utils_alock.c +++ b/src/utils/utils_alock.c @@ -19,9 +19,16 @@ format"\n", OCF_READ == (req)->rw ? "RD" : "WR", req, \ __func__, ##__VA_ARGS__) +#define OCF_DEBUG_CACHE(cache, format, ...) \ + ocf_cache_log(cache, log_info, "[Concurrency][Cache][%s] - " \ + format"\n", \ + __func__, ##__VA_ARGS__) + + #else #define OCF_DEBUG_TRACE(cache) #define OCF_DEBUG_RQ(req, format, ...) +#define OCF_DEBUG_CACHE(cache, format, ...) #endif #define OCF_CACHE_LINE_ACCESS_WR INT_MAX @@ -558,7 +565,7 @@ void ocf_alock_unlock_one_rd(struct ocf_alock *alock, { unsigned long flags = 0; - OCF_DEBUG_RQ(alock->cache, "Cache entry = %u", entry); + OCF_DEBUG_CACHE(alock->cache, "Cache entry unlock one rd = %u", entry); /* Lock waiters list */ ocf_alock_waitlist_lock(alock, entry, flags); @@ -639,7 +646,7 @@ void ocf_alock_unlock_one_wr(struct ocf_alock *alock, { unsigned long flags = 0; - OCF_DEBUG_RQ(alock->cache, "Cache entry = %u", entry); + OCF_DEBUG_CACHE(alock->cache, "Cache entry unlock one wr = %u", entry); /* Lock waiters list */ ocf_alock_waitlist_lock(alock, entry, flags); diff --git a/tests/unit/tests/concurrency/ocf_cache_line_concurrency.c/ocf_cache_line_concurrency.c b/tests/unit/tests/concurrency/ocf_cache_line_concurrency.c/ocf_cache_line_concurrency.c index e9c39f7..b284f29 100644 --- a/tests/unit/tests/concurrency/ocf_cache_line_concurrency.c/ocf_cache_line_concurrency.c +++ b/tests/unit/tests/concurrency/ocf_cache_line_concurrency.c/ocf_cache_line_concurrency.c @@ -229,7 +229,18 @@ ocf_ctx_t ocf_cache_get_ctx(ocf_cache_t cache) int __wrap_ocf_log_raw(ocf_logger_t logger, ocf_logger_lvl_t lvl, const char *fmt, ...) { - function_called(); + char buf[1024]; + + va_list args; + int ret; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + + printf(buf); + + return 0; } unsigned long long progress;