pr_debug("%.*s %12.12s:%-4d:" fmt, \
8 - (int)sizeof(KBUILD_MODNAME), " ", \
kbasename(__FILE__), __LINE__, ##__VA_ARGS__); \
- CEPH_SAN_LOG("%12.12s:%-4d : " fmt, \
- kbasename(__FILE__), __LINE__, ##__VA_ARGS__); \
+ CEPH_SAN_LOG(fmt, ##__VA_ARGS__); \
} while (0)
# define doutc(client, fmt, ...) \
do { \
kbasename(__FILE__), __LINE__, \
&client->fsid, client->monc.auth->global_id, \
##__VA_ARGS__); \
- CEPH_SAN_LOG("%12.12s:%-4d:" fmt, \
- kbasename(__FILE__), __LINE__, ##__VA_ARGS__); \
+ CEPH_SAN_LOG("[%pU:%llu] " fmt, &client->fsid, \
+ client->monc.auth->global_id, ##__VA_ARGS__); \
} while (0)
# else
/* faux printk call just to see any compiler warnings. */
*/
# define dout(fmt, ...) CEPH_SAN_LOG(fmt, ##__VA_ARGS__)
# define doutc(client, fmt, ...) \
- CEPH_SAN_LOG(" [%pU %llu] %s: " fmt, &client->fsid, \
+ CEPH_SAN_LOG(" [%pU:%llu] %s: " fmt, &client->fsid, \
client->monc.auth->global_id, __func__, ##__VA_ARGS__)
#endif
unsigned int line; /* Line number */
unsigned int len; /* Length of the message */
const char *file; /* Source file */
- char buffer[0]; /* Flexible array for inline buffer */
+ const char *func; /* Source function */
+ char *buffer; /* Flexible array for inline buffer */
};
/* TLS context structure */
void ceph_san_logger_cleanup(void);
/* Log a message */
-void ceph_san_log(const char *file, unsigned int line, const char *fmt, ...);
+void ceph_san_log(const char *file, const char *func, unsigned int line, const char *fmt, ...);
/* Get current TLS context, creating if necessary */
struct ceph_san_tls_ctx *ceph_san_get_tls_ctx(void);
/* Helper macro for logging */
#define CEPH_SAN_LOG(fmt, ...) \
- ceph_san_log(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
+ ceph_san_log(kbasename(__FILE__), __func__, __LINE__, fmt, ##__VA_ARGS__)
/* Global logger instance */
extern struct ceph_san_logger g_logger;
return;
/* Add context to log batch */
+ ctx->task = NULL;
ceph_san_batch_put(&g_logger.log_batch, ctx);
/* If log_batch has too many full magazines, move one to alloc_batch */
/* Set up TLS */
current->tls.state = ctx;
current->tls.release = ceph_san_tls_release;
-
+ task_state_to_char(current);
+ ctx->task = current;
return ctx;
}
EXPORT_SYMBOL(ceph_san_get_tls_ctx);
*
* Logs a message to the current TLS context's log buffer
*/
-void ceph_san_log(const char *file, unsigned int line, const char *fmt, ...)
+void ceph_san_log(const char *file, const char *func, unsigned int line, const char *fmt, ...)
{
/* Format the message into local buffer first */
char buf[256];
entry->ts = jiffies;
entry->line = line;
entry->file = file;
+ entry->func = func;
+ entry->buffer = (char *)(entry + 1);
entry->len = cephsan_pagefrag_get_alloc_size(alloc);
spin_unlock(&ctx->pf.lock);