summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
810f2a5)
Now that libcfs_debug_vmsg2 has no (external) users, we can remove it.
It is used to implement libcfs_debug_msg(), so simply move
the body of the function (suitably modified) into that one caller.
Linux-commit:
d42a3aded317c97594c19995879999428de53c46
Signed-off-by: NeilBrown <neilb@suse.com>
Change-Id: I80d24abcc23a8f6e2f8b995d1337ba5038318d5a
Reviewed-on: https://review.whamcloud.com/35225
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
const char *format1, ...)
__attribute__ ((format (printf, 2, 3)));
const char *format1, ...)
__attribute__ ((format (printf, 2, 3)));
-extern int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
- const char *format1,
- va_list args, const char *format2, ...)
- __attribute__ ((format (printf, 4, 5)));
-
/* other external symbols that tracefile provides: */
extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
const char __user *usr_buffer,
/* other external symbols that tracefile provides: */
extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
const char __user *usr_buffer,
int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format, ...)
{
int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format, ...)
{
- va_list args;
- int rc;
-
- va_start(args, format);
- rc = libcfs_debug_vmsg2(msgdata, format, args, NULL);
- va_end(args);
-
- return rc;
-}
-EXPORT_SYMBOL(libcfs_debug_msg);
-
-int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
- const char *format1, va_list args,
- const char *format2, ...)
-{
struct cfs_trace_cpu_data *tcd = NULL;
struct ptldebug_header header = {0};
struct cfs_trace_page *tage;
struct cfs_trace_cpu_data *tcd = NULL;
struct ptldebug_header header = {0};
struct cfs_trace_page *tage;
}
string_buf = (char *)page_address(tage->page) +
}
string_buf = (char *)page_address(tage->page) +
- tage->used + known_size;
+ tage->used + known_size;
max_nob = PAGE_SIZE - tage->used - known_size;
if (max_nob <= 0) {
max_nob = PAGE_SIZE - tage->used - known_size;
if (max_nob <= 0) {
- if (format1) {
- va_copy(ap, args);
- needed = vsnprintf(string_buf, max_nob, format1, ap);
- va_end(ap);
- }
-
- if (format2) {
- remain = max_nob - needed;
- if (remain < 0)
- remain = 0;
+ remain = max_nob - needed;
+ if (remain < 0)
+ remain = 0;
- va_start(ap, format2);
- needed += vsnprintf(string_buf + needed, remain,
- format2, ap);
- va_end(ap);
- }
+ va_start(ap, format);
+ needed += vsnprintf(string_buf + needed, remain,
+ format, ap);
+ va_end(ap);
if (needed < max_nob) /* well. printing ok.. */
break;
if (needed < max_nob) /* well. printing ok.. */
break;
string_buf = cfs_trace_get_console_buffer();
needed = 0;
string_buf = cfs_trace_get_console_buffer();
needed = 0;
- if (format1 != NULL) {
- va_copy(ap, args);
- needed = vsnprintf(string_buf,
- CFS_TRACE_CONSOLE_BUFFER_SIZE,
- format1, ap);
- va_end(ap);
- }
- if (format2 != NULL) {
- remain = CFS_TRACE_CONSOLE_BUFFER_SIZE - needed;
- if (remain > 0) {
- va_start(ap, format2);
- needed += vsnprintf(string_buf+needed, remain,
- format2, ap);
- va_end(ap);
- }
+ remain = CFS_TRACE_CONSOLE_BUFFER_SIZE - needed;
+ if (remain > 0) {
+ va_start(ap, format);
+ needed += vsnprintf(string_buf+needed, remain,
+ format, ap);
+ va_end(ap);
cfs_print_to_console(&header, mask,
string_buf, needed, file, msgdata->msg_fn);
cfs_print_to_console(&header, mask,
string_buf, needed, file, msgdata->msg_fn);
-EXPORT_SYMBOL(libcfs_debug_vmsg2);
+EXPORT_SYMBOL(libcfs_debug_msg);
void
cfs_trace_assertion_failed(const char *str,
void
cfs_trace_assertion_failed(const char *str,
* Even though this structure is meant to be per-CPU, locking
* is needed because in some places the data may be accessed
* from other CPUs. This lock is directly used in trace_get_tcd
* Even though this structure is meant to be per-CPU, locking
* is needed because in some places the data may be accessed
* from other CPUs. This lock is directly used in trace_get_tcd
- * and trace_put_tcd, which are called in libcfs_debug_vmsg2 and
+ * and trace_put_tcd, which are called in libcfs_debug_msg and
* tcd_for_each_type_lock
*/
spinlock_t tcd_lock;
* tcd_for_each_type_lock
*/
spinlock_t tcd_lock;