Skip to content
Snippets Groups Projects
  1. Apr 10, 2013
  2. Apr 09, 2013
  3. Apr 08, 2013
    • Avi Kivity's avatar
      trace: test serialization · aefda14d
      Avi Kivity authored
      Strangely, the compiler is able to remove the test code (including the
      assert) entirely, as it is able to deduce it passed at compile time.
      aefda14d
    • Avi Kivity's avatar
      trace: add function for serializing tracepoint data · a4e877ae
      Avi Kivity authored
      Use the native alignment for speed.
      a4e877ae
    • Nadav Har'El's avatar
      Fix bug running all threads on CPU 0 ;-) · 63ba9b80
      Nadav Har'El authored
      All child threads start running on the CPU which started them, until
      migrated later in load_balancer(). Threads with pinned=true are not
      migrated. Unfortunately, we forgot to initialize the pinned field
      (POD fields are not initialized in C++) - so all threads started
      with random, usually nonzero, "pinned" value and as a result all
      threads remained on CPU 0!
      Now thread migration works as expected.
      63ba9b80
    • Avi Kivity's avatar
      trace: store signature in tracepoint_base class · 99a4f8ed
      Avi Kivity authored
      This allows the log to refer to the tracepoint and thus also the type
      signature.
      99a4f8ed
    • Avi Kivity's avatar
      trace: extract common tracepoint members into a base class · 4d4da678
      Avi Kivity authored
      This allows the trace log to refer to the tracepoint.
      4d4da678
    • Nadav Har'El's avatar
      Avoid recursive use of wait_guard · ef420c0d
      Nadav Har'El authored
      wait_until made recursive use of wait_guard: It held one around the code
      calling wait(), but while still holding it also called mutex_lock() which
      also uses a wait_guard internally. This sort of recursive use of wait_guard
      is theoretically supported, but messy to debug, so I now changed the code a
      bit so only one of them are held at a time (the lock() is outside wait_guard).
      ef420c0d
    • Nadav Har'El's avatar
      Fix broken preemption · a59d1bc7
      Nadav Har'El authored
      In some cases, stop_wait() forgot to call preempt_enable(), leaving
      the preemption of this thread disabled, and causing CPU-heavy threads
      to continue running for a long time without other threads (or even
      load_balance()) getting a chance to run.
      a59d1bc7
    • Avi Kivity's avatar
      trace: add test for tracepoint signature · 71111a60
      Avi Kivity authored
      71111a60
    • Avi Kivity's avatar
      trace: compute the type signature of a tracepoint · 2709b426
      Avi Kivity authored
      This can be used to recover the data types from a raw buffer (i.e. from a
      debugger).  We use the Python struct module encoding (I=u32, etc.).
      2709b426
    • Avi Kivity's avatar
      trace: add tracepoint test · f16342de
      Avi Kivity authored
      f16342de
    • Avi Kivity's avatar
      trace: add static tracepoint definitions · a5dc3aa5
      Avi Kivity authored
      Two styles are supported, a simple one and a flexible one.
      
      To declare and use a simple tracepoint, use:
      
        tracepoint<u32, u64, char> trace_my_event("my_event", "%d %x '%s'");
      
        ...
      
        void my_function(u32 a0, u64 a1)
        {
            trace_my_event(a0, a1, 'x');
        }
      
      where:
      
        u32/u64/char: the types of the parameters to be used in the tracepoint
        trace_my_event: an identifier (commonly prefixed by trace_)
        "my_event": how the tracepoint is shown in the logs
        "%d %x '%s'": printf/boost::format style format string (auto deduces
                      argument types)
        a0, a1, 'x': runtime arguments to be traced
      
      The flexible style allows different type lists used in the tracepoint
      function, and in storing.  This allows having the tracepoint snapshot fields
      from some object.  You will need to supply a function to convert from the
      runtime types to the storage types:
      
        std::tuple<u32, u64, char> snapshot_my_object(my_object& obj)
        {
          return std::make_tuple(obj.field1, obj.field2, obj.field3);
        }
      
        tracepointv<storage_args<u32, u64, char>,
                    runtime_args<my_object&>,
                    snapshot_my_object> trace_my_object("my_object", "%d %x '%s'");
      
        void my_function(my_object& obj)
        {
          trace_my_object(obj);
        }
      
      Using this style reduces the runtime overhead since 'snapshot_my_object' is
      only run if tracing is enabled.
      a5dc3aa5
    • Nadav Har'El's avatar
      Fix memory leak in thread creation · 68284de3
      Nadav Har'El authored
      Thread object creation used to leak one page for the FPU state (thanks
      Avi for spotting this). Fix this (add a destructor which frees the page)
      and add to the test-suite a test for checking that thread creation doesn't
      leak memory - and while we're at it, also checked that alloc_page() and
      malloc() at various sizes do not leak memory.
      68284de3
    • Nadav Har'El's avatar
      Free TCB (and thread-local storage) area on thread destruction. · 1f68d677
      Nadav Har'El authored
      We forgot to free the TCB allocated buffer on thread destruction, causing
      a leak of around 1000 bytes per thread creation. We still have another
      leak (exactly one page per thread object creation) that I'm trying to find :(
      1f68d677
  4. Apr 07, 2013
Loading