From 00b42dde0df9596dc9a63798a09e2efde2598c5b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 7 Dec 2013 15:43:07 +0100 Subject: [PATCH] FD kernel tracing: Capture kernel-only stack traces * When exec()'ing we'd otherwise get (harmless but annoying) messages from vm_page_fault(). With syscall tracing enabled we can get userland stack traces anyway. * Simplify by using TRACE_ENTRY_SELECTOR(). --- src/system/kernel/fs/vfs_tracing.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/system/kernel/fs/vfs_tracing.h b/src/system/kernel/fs/vfs_tracing.h index 2358a7c1fb..0de0489e7f 100644 --- a/src/system/kernel/fs/vfs_tracing.h +++ b/src/system/kernel/fs/vfs_tracing.h @@ -20,32 +20,20 @@ namespace FileDescriptorTracing { -class FDTraceEntry : public AbstractTraceEntry { +class FDTraceEntry + : public TRACE_ENTRY_SELECTOR(FILE_DESCRIPTOR_TRACING_STACK_TRACE) { public: FDTraceEntry(file_descriptor* descriptor) : + TraceEntryBase(FILE_DESCRIPTOR_TRACING_STACK_TRACE, 0, true), fDescriptor(descriptor), fReferenceCount(descriptor->ref_count) { -#if FILE_DESCRIPTOR_TRACING_STACK_TRACE - fStackTrace = capture_tracing_stack_trace( - FILE_DESCRIPTOR_TRACING_STACK_TRACE, 0, false); -#endif } -#if FILE_DESCRIPTOR_TRACING_STACK_TRACE - virtual void DumpStackTrace(TraceOutput& out) - { - out.PrintStackTrace(fStackTrace); - } -#endif - protected: file_descriptor* fDescriptor; int32 fReferenceCount; -#if FILE_DESCRIPTOR_TRACING_STACK_TRACE - tracing_stack_trace* fStackTrace; -#endif };