Whamcloud - gitweb
LU-9859 libcfs: remove libcfs_debug_vmsg2
[fs/lustre-release.git] / libcfs / libcfs / tracefile.c
index 81e9fb2..9669e87 100644 (file)
@@ -247,21 +247,6 @@ static struct cfs_trace_page *cfs_trace_get_tage(struct cfs_trace_cpu_data *tcd,
 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;
@@ -324,7 +309,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
                 }
 
                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) {
@@ -337,22 +322,14 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
                }
 
                 needed = 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;
@@ -438,22 +415,14 @@ console:
                 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);
 
@@ -478,7 +447,7 @@ console:
 
         return 0;
 }
-EXPORT_SYMBOL(libcfs_debug_vmsg2);
+EXPORT_SYMBOL(libcfs_debug_msg);
 
 void
 cfs_trace_assertion_failed(const char *str,