[haiku-commits] r35834 - haiku/trunk/src/system/kernel

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 13 Mar 2010 13:31:01 +0100 (CET)

Author: bonefish
Date: 2010-03-13 13:31:01 +0100 (Sat, 13 Mar 2010)
New Revision: 35834
Changeset: http://dev.haiku-os.org/changeset/35834/haiku

Modified:
   haiku/trunk/src/system/kernel/signal.cpp
Log:
Added some kernel tracing for sigsuspend().


Modified: haiku/trunk/src/system/kernel/signal.cpp
===================================================================
--- haiku/trunk/src/system/kernel/signal.cpp    2010-03-13 05:14:14 UTC (rev 
35833)
+++ haiku/trunk/src/system/kernel/signal.cpp    2010-03-13 12:31:01 UTC (rev 
35834)
@@ -204,6 +204,47 @@
                sigset_t        fOldMask;
 };
 
+
+class SigSuspend : public AbstractTraceEntry {
+       public:
+               SigSuspend(sigset_t mask)
+                       :
+                       fMask(mask),
+                       fOldMask(thread_get_current_thread()->sig_block_mask)
+               {
+                       Initialized();
+               }
+
+               virtual void AddDump(TraceOutput& out)
+               {
+                       out.Print("signal suspend: %#" B_PRIx32 ", old mask: 
%#" B_PRIx32,
+                               fMask, fOldMask);
+               }
+
+       private:
+               sigset_t        fMask;
+               sigset_t        fOldMask;
+};
+
+
+class SigSuspendDone : public AbstractTraceEntry {
+       public:
+               SigSuspendDone()
+                       :
+                       fSignals(thread_get_current_thread()->sig_pending)
+               {
+                       Initialized();
+               }
+
+               virtual void AddDump(TraceOutput& out)
+               {
+                       out.Print("signal suspend done: %#" B_PRIx32, fSignals);
+               }
+
+       private:
+               uint32          fSignals;
+};
+
 }      // namespace SignalTracing
 
 #      define T(x)     new(std::nothrow) SignalTracing::x
@@ -845,6 +886,8 @@
 int
 sigsuspend(const sigset_t *mask)
 {
+       T(SigSuspend(*mask));
+
        struct thread *thread = thread_get_current_thread();
        sigset_t oldMask = atomic_get(&thread->sig_block_mask);
 
@@ -863,6 +906,8 @@
 
        update_current_thread_signals_flag();
 
+       T(SigSuspendDone());
+
        // we're not supposed to actually succeed
        return B_INTERRUPTED;
 }


Other related posts:

  • » [haiku-commits] r35834 - haiku/trunk/src/system/kernel - ingo_weinhold