Update debug prints and methods
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
This commit is contained in:
parent
c17b587444
commit
367fcbfe4e
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user