feat: kprintf now goes into dedicated pseudo-dev rather than flooding the framebuffer
[lunaix-os.git] / lunaix-os / kernel / debug / trace.c
index 3d712c04db4d97531d5af52064500709e90b71cd..62ceb0ef723409d46c56c62ae88a5d65e761f48e 100644 (file)
@@ -113,11 +113,11 @@ trace_printstack_of(ptr_t fp)
     int n = trace_walkback(tbs, fp, NB_TRACEBACK, &fp);
 
     if (fp) {
-        kprintf(KDEBUG "...<truncated>\n");
+        kprintf(KDEBUG "...<truncated>");
     }
 
     for (int i = 0; i < n; i++) {
-        kprintf(KDEBUG "%p: %s\n", tbs[i].pc, tbs[i].symbol);
+        kprintf(KDEBUG "%p: %s", tbs[i].pc, tbs[i].symbol);
     }
 }
 
@@ -133,11 +133,11 @@ trace_printswctx(const isr_param* p, char* direction)
 
     struct ksym_entry* sym = trace_sym_lookup(p->execp->eip);
 
-    kprintf(KDEBUG ">> (sw:%s) iv:%d, errno:%p <<\n",
+    kprintf(KDEBUG ">> (sw:%s) iv:%d, errno:%p <<",
             direction,
             p->execp->vector,
             p->execp->err_code);
-    kprintf(KDEBUG "%p:%s\n", p->execp->eip, ksym_getstr(sym));
+    kprintf(KDEBUG "%p:%s", p->execp->eip, ksym_getstr(sym));
 }
 
 void
@@ -145,9 +145,8 @@ trace_printstack_isr(const isr_param* isrm)
 {
     isr_param* p = isrm;
     ptr_t fp = cpu_get_fp();
-    int prev_fromusr = uspace_context(p);
+    int prev_fromusr = 0;
 
-    kprintf(KDEBUG "\n");
     kprintf(KDEBUG "stack trace (pid=%d)\n", __current->pid);
 
     trace_printstack_of(fp);
@@ -170,5 +169,4 @@ trace_printstack_isr(const isr_param* isrm)
 
         p = p->execp->saved_prev_ctx;
     }
-    kprintf(KDEBUG "\n");
 }
\ No newline at end of file