qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] d01c05: trace: Allocate cpu->trace_dstate in


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d01c05: trace: Allocate cpu->trace_dstate in place
Date: Tue, 18 Jul 2017 01:16:25 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d01c05c955f7736952c13d85edaae0b262b7a0a3
      
https://github.com/qemu/qemu/commit/d01c05c955f7736952c13d85edaae0b262b7a0a3
  Author: Lluís Vilanova <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M include/qom/cpu.h
    M qom/cpu.c
    M trace/control.c

  Log Message:
  -----------
  trace: Allocate cpu->trace_dstate in place

There's little point in dynamically allocating the bitmap if we
know at compile-time the max number of events we want to support.
Thus, make room in the struct for the bitmap, which will make things
easier later: this paves the way for upcoming changes, in which
we'll use a u32 to fully capture cpu->trace_dstate.

This change also increases performance by saving a dereference and
improving locality--note that this is important since upcoming work
makes reading this bitmap fairly common.

Signed-off-by: Emilio G. Cota <address@hidden>
Reviewed-by: Lluís Vilanova <address@hidden>
Signed-off-by: Lluís Vilanova <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d43811165df75571055dab7b602526a40404a63e
      
https://github.com/qemu/qemu/commit/d43811165df75571055dab7b602526a40404a63e
  Author: Lluís Vilanova <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M include/qom/cpu.h
    M trace/control-target.c

  Log Message:
  -----------
  trace: [tcg] Delay changes to dynamic state when translating

This keeps consistency across all decisions taken during translation
when the dynamic state of a vCPU is changed in the middle of translating
some guest code.

Signed-off-by: Lluís Vilanova <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Emilio G. Cota <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 61a67f71dd7e437212a2730c4462dff9b3b7b3da
      
https://github.com/qemu/qemu/commit/61a67f71dd7e437212a2730c4462dff9b3b7b3da
  Author: Lluís Vilanova <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/translate-all.c
    M include/exec/exec-all.h
    M include/exec/tb-hash-xx.h
    M include/exec/tb-hash.h
    M tcg/tcg-runtime.c
    M tests/qht-bench.c
    M trace/control-target.c
    M trace/control.h

  Log Message:
  -----------
  exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state

Every vCPU now uses a separate set of TBs for each set of dynamic
tracing event state values. Each set of TBs can be used by any number of
vCPUs to maximize TB reuse when vCPUs have the same tracing state.

This feature is later used by tracetool to optimize tracing of guest
code events.

The maximum number of TB sets is defined as 2^E, where E is the number
of events that have the 'vcpu' property (their state is stored in
CPUState->trace_dstate).

For this to work, a change on the dynamic tracing state of a vCPU will
force it to flush its virtual TB cache (which is only indexed by
address), and fall back to the physical TB cache (which now contains the
vCPU's dynamic tracing state as part of the hashing function).

Signed-off-by: Lluís Vilanova <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Emilio G. Cota <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 864a2178d4c014a217cacf76e42b818fe9feb1d4
      
https://github.com/qemu/qemu/commit/864a2178d4c014a217cacf76e42b818fe9feb1d4
  Author: Lluís Vilanova <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M scripts/tracetool/__init__.py
    M scripts/tracetool/format/h.py
    M scripts/tracetool/format/tcg_h.py
    M scripts/tracetool/format/tcg_helper_c.py

  Log Message:
  -----------
  trace: [tcg] Do not generate TCG code to trace dynamically-disabled events

If an event is dynamically disabled, the TCG code that calls the
execution-time tracer is not generated.

Removes the overheads of execution-time tracers for dynamically disabled
events. As a bonus, also avoids checking the event state when the
execution-time tracer is called from TCG-generated code (since otherwise
TCG would simply not call it).

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 1ff7b531963a71f10880d119db8fbcc591a2652a
      
https://github.com/qemu/qemu/commit/1ff7b531963a71f10880d119db8fbcc591a2652a
  Author: Lluís Vilanova <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M scripts/tracetool/backend/dtrace.py
    M scripts/tracetool/backend/ftrace.py
    M scripts/tracetool/backend/log.py
    M scripts/tracetool/backend/simple.py
    M scripts/tracetool/backend/syslog.py
    M scripts/tracetool/backend/ust.py

  Log Message:
  -----------
  trace: [tcg, trivial] Re-align generated code

Last patch removed a nesting level in generated code. Re-align all code
generated by backends to be 4-column aligned.

Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5caa262fdadae08f7c5af7f1328d424823811aaa
      
https://github.com/qemu/qemu/commit/5caa262fdadae08f7c5af7f1328d424823811aaa
  Author: Lluís Vilanova <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M trace-events

  Log Message:
  -----------
  trace: [trivial] Statically enable all guest events

The existing optimizations makes it feasible to have them available on all
builds.

Some quick'n'dirty numbers with 400.perlbench (SPECcpu2006) on the train input
(medium size - suns.pl) and the guest_mem_before event:

* vanilla, statically disabled
real    0m2,259s
user    0m2,252s
sys     0m0,004s

* vanilla, statically enabled (overhead: 2.18x)
real    0m4,921s
user    0m4,912s
sys     0m0,008s

* multi-tb, statically disabled (overhead: 0.99x) [within noise range]
real    0m2,228s
user    0m2,216s
sys     0m0,008s

* multi-tb, statically enabled (overhead: 0.99x) [within noise range]
real    0m2,229s
user    0m2,224s
sys     0m0,004s

Now enabling all events when booting an ARM system that immediately shuts down
(https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg04085.html):

* vanilla, statically disabled
real    0m32,153s
user    0m31,276s
sys     0m0,108s

* vanilla, statically enabled (overhead: 1.35x)
real    0m43,507s
user    0m42,680s
sys     0m0,168s

* multi-tb, statically disabled (overhead: 1.03x)
real    0m32,993s
user    0m32,516s
sys     0m0,104s

* multi-tb, statically enabled (overhead: 1.00x) [within noise range]
real    0m32,110s
user    0m31,176s
sys     0m0,156s

And finally enabling all events using Emilio's dbt-bench
(where orig == vanilla, new == multi-tb):
                                                   NBench score; higher is 
better

  180 
+-+--------+----------+----------+---------+----------+----------+----------+----------+----------+---------+----------+--------+-+
      |                                                                         
                                                        |
      |                                      *** $$$$%%                         
                                           orig         |
  160 
+-+....................................*.*.$..$.%............................................................orig-enabled
       +-+
      |                                      * * $  $ %                         
                                            new         |
  140 
+-+....................................*.*.$..$.%............................................................new-disabled.......+-+
      |                                      * * $  $ %                         
                                                        |
      |                                      * * $  $ %                         
                                                        |
  120 
+-+....................................*.*.$..$.%...............................................................................+-+
      |                                      * * $  $ %                         
                                                        |
      |                                      * * $  $ %                         
                                                        |
  100 
+-+....................................*.*.$..$.%.....$$$%%%....................................................................+-+
      |                                      * * $  $ % *** $ $  % *** $$$%%    
                                                        |
   80 
+-+....................................*.*.$..$.%.*.*.$.$..%.*.*.$.$.%..........................................................+-+
      |                                      * * $  $ % * * $ $  % * * $ $ %    
                                                        |
      |                                      * * $  $ % * * $ $  % * * $ $ %    
                                                        |
   60 
+-+.........................***..$$$%%.*.*##..$.%.*.*.$.$..%.*.*.$.$.%..***.$$$%%...............................................+-+
      |                **** $$$%% * *  $ $ % * * #  $ % * *## $  % * * $ $ %  * 
* $ $ %                                                 |
      |                *  * $ $ % * *  $ $ % * * #  $ % * * # $  % * *## $ %  * 
* $ $ %                                                 |
   40 
+-+..............*..*.$.$.%.*.*..$.$.%.*.*.#..$.%.*.*.#.$..%.*.*.#.$.%..*.*.$.$.%...............................................+-+
      |                *  * $ $ % * *  $ $ % * * #  $ % * * # $  % * * # $ %  * 
*## $ %                                  *** $$$%%%     |
   20 
+-+....***.$$$%%.*..*##.$.%.*.*###.$.%.*.*.#..$.%.*.*.#.$..%.*.*.#.$.%..*.*.#.$.%..................................*.*.$.$..%...+-+
      |      * *## $ % *  * # $ % * *  # $ % * * #  $ % * * # $  % * * # $ %  * 
* # $ %                                  * *## $  %     |
      |      * * # $ % *  * # $ % * *  # $ % * * #  $ % * * # $  % * * # $ %  * 
* # $ %            ***###$$%% ***##$$$%% * * # $  %     |
    0 
+-+----***##$$%%-****##$$%%-***###$$%%-***##$$$%%-***##$$%%%-***##$$%%--***##$$%%-****##$$%%-***###$$%%-***##$$$%%-***##$$%%%---+-+
     NUMERIC SORTSTRING SORT   BITFIEFP EMULATION ASSIGNMENT       IDEA    
HUFFMAN    FOURIER NEURLU DECOMPOSITION      gmean
png: http://imgur.com/a/8XG5S

Signed-off-by: Lluís Vilanova <address@hidden>
Reviewed-by: Emilio G. Cota <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 304187c51cfe1ffda1afc9b86c4ccae1cbac68cb
      
https://github.com/qemu/qemu/commit/304187c51cfe1ffda1afc9b86c4ccae1cbac68cb
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M docs/devel/tracing.txt

  Log Message:
  -----------
  trace: update old trace events in docs

Commit c5f1ad429cdf26023cf331075a7d327708e3db6d ("block: Remove
bdrv_aio_readv/writev/flush()") removed
bdrv_aio_readv()/bdrv_aio_writev() so the example in the tracing
documentation is no longer valid.

Reported-by: Wang Dong <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5a477a78060638b8433e9fb96a3ada100b1ab8e9
      
https://github.com/qemu/qemu/commit/5a477a78060638b8433e9fb96a3ada100b1ab8e9
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-17 (Mon, 17 Jul 2017)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/translate-all.c
    M docs/devel/tracing.txt
    M include/exec/exec-all.h
    M include/exec/tb-hash-xx.h
    M include/exec/tb-hash.h
    M include/qom/cpu.h
    M qom/cpu.c
    M scripts/tracetool/__init__.py
    M scripts/tracetool/backend/dtrace.py
    M scripts/tracetool/backend/ftrace.py
    M scripts/tracetool/backend/log.py
    M scripts/tracetool/backend/simple.py
    M scripts/tracetool/backend/syslog.py
    M scripts/tracetool/backend/ust.py
    M scripts/tracetool/format/h.py
    M scripts/tracetool/format/tcg_h.py
    M scripts/tracetool/format/tcg_helper_c.py
    M tcg/tcg-runtime.c
    M tests/qht-bench.c
    M trace-events
    M trace/control-target.c
    M trace/control.c
    M trace/control.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' 
into staging

# gpg: Signature made Mon 17 Jul 2017 13:11:17 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  trace: update old trace events in docs
  trace: [trivial] Statically enable all guest events
  trace: [tcg, trivial] Re-align generated code
  trace: [tcg] Do not generate TCG code to trace dynamically-disabled events
  exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state
  trace: [tcg] Delay changes to dynamic state when translating
  trace: Allocate cpu->trace_dstate in place

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/ca4e667dbf43...5a477a780606

reply via email to

[Prev in Thread] Current Thread [Next in Thread]