#include "kern/system_events.hh"
#include "sim/system.hh"
+#include <sstream>
namespace Linux {
DebugPrintkEvent::process(ThreadContext *tc)
{
if (DTRACE(DebugPrintf)) {
- if (!raw) {
- StringWrap name(tc->getSystemPtr()->name() + ".dprintk");
- DPRINTFN("");
- }
-
+ std::stringstream ss;
TheISA::Arguments args(tc);
- Printk(args);
+ Printk(ss, args);
+ StringWrap name(tc->getSystemPtr()->name() + ".dprintk");
+ DPRINTFN("%s", ss.str());
}
SkipFuncEvent::process(tc);
}
class DebugPrintkEvent : public SkipFuncEvent
{
- private:
- bool raw;
-
public:
- DebugPrintkEvent(PCEventQueue *q, const std::string &desc, Addr addr,
- bool r = false)
- : SkipFuncEvent(q, desc, addr), raw(r) {}
+ DebugPrintkEvent(PCEventQueue *q, const std::string &desc, Addr addr)
+ : SkipFuncEvent(q, desc, addr) {}
virtual void process(ThreadContext *xc);
};
#include <sys/types.h>
#include <algorithm>
-#include "base/trace.hh"
#include "arch/arguments.hh"
+#include "base/trace.hh"
+#include "kern/linux/printk.hh"
using namespace std;
void
-Printk(TheISA::Arguments args)
+Printk(stringstream &out, TheISA::Arguments args)
{
- std::ostream &out = Trace::output();
char *p = (char *)args++;
- ios::fmtflags saved_flags = out.flags();
- char old_fill = out.fill();
- int old_precision = out.precision();
-
while (*p) {
switch (*p) {
case '%': {
}
}
- out.flags(saved_flags);
- out.fill(old_fill);
- out.precision(old_precision);
}
#include "arch/isa_specific.hh"
+#include <sstream>
+
class TheISA::Arguments;
-void Printk(TheISA::Arguments args);
+void Printk(std::stringstream &out, TheISA::Arguments args);
#endif // __PRINTK_HH__