* Added nothrow to the new operator because otherwise the C++ compiler
will not accept if the allocator returns NULL and crashes instead (ie. not compiling in tracing would have crashed if some module tried to use it). * Added total entries count to the KDL command output. * Fixed computing the start index of the KDL command. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23460 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
#include <KernelExport.h>
|
||||
|
||||
|
||||
#define ENABLE_TRACING 0
|
||||
@@ -29,7 +30,29 @@ class TraceEntry : trace_entry {
|
||||
|
||||
void Initialized();
|
||||
|
||||
void* operator new(size_t size);
|
||||
void* operator new(size_t size, const std::nothrow_t&) throw();
|
||||
};
|
||||
|
||||
class AbstractTraceEntry : public TraceEntry {
|
||||
public:
|
||||
AbstractTraceEntry()
|
||||
:
|
||||
fThread(find_thread(NULL)),
|
||||
fTime(system_time())
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Dump()
|
||||
{
|
||||
kprintf("[%6ld] %Ld: ", fThread, fTime);
|
||||
}
|
||||
|
||||
thread_id Thread() const { return fThread; }
|
||||
bigtime_t Time() const { return fTime; }
|
||||
|
||||
protected:
|
||||
thread_id fThread;
|
||||
bigtime_t fTime;
|
||||
};
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user