axeld + bonefish:
Make ktrace_printf() available in the kernel, too. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23979 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d63cbbe2df
commit
7d2d758d46
@ -341,6 +341,25 @@ AbstractTraceEntry::AddDump(TraceOutput& out)
|
|||||||
|
|
||||||
#if ENABLE_TRACING
|
#if ENABLE_TRACING
|
||||||
|
|
||||||
|
class KernelTraceEntry : public AbstractTraceEntry {
|
||||||
|
public:
|
||||||
|
KernelTraceEntry(const char* message)
|
||||||
|
{
|
||||||
|
fMessage = alloc_tracing_buffer_strcpy(message, 256, false);
|
||||||
|
|
||||||
|
Initialized();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void AddDump(TraceOutput& out)
|
||||||
|
{
|
||||||
|
out.Print("kern: %s", fMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
char* fMessage;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class UserTraceEntry : public AbstractTraceEntry {
|
class UserTraceEntry : public AbstractTraceEntry {
|
||||||
public:
|
public:
|
||||||
UserTraceEntry(const char* message)
|
UserTraceEntry(const char* message)
|
||||||
@ -1087,6 +1106,23 @@ tracing_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ktrace_printf(const char *format, ...)
|
||||||
|
{
|
||||||
|
#if ENABLE_TRACING
|
||||||
|
va_list list;
|
||||||
|
va_start(list, format);
|
||||||
|
|
||||||
|
char buffer[256];
|
||||||
|
vsnprintf(buffer, sizeof(buffer), format, list);
|
||||||
|
|
||||||
|
va_end(list);
|
||||||
|
|
||||||
|
new(nothrow) KernelTraceEntry(buffer);
|
||||||
|
#endif // ENABLE_TRACING
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_user_ktrace_output(const char *message)
|
_user_ktrace_output(const char *message)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user