-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-requ…
…est' into staging # gpg: Signature made Mon 17 Jul 2017 13:11:17 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <[email protected]>" # gpg: aka "Stefan Hajnoczi <[email protected]>" # 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 <[email protected]>
- Loading branch information
Showing
24 changed files
with
137 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
""" | ||
|
||
__author__ = "Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2016, Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2017, Lluís Vilanova <[email protected]>" | ||
__license__ = "GPL version 2 or (at your option) any later version" | ||
|
||
__maintainer__ = "Stefan Hajnoczi" | ||
|
@@ -268,6 +268,7 @@ def formats(self): | |
return self._FMT.findall(self.fmt) | ||
|
||
QEMU_TRACE = "trace_%(name)s" | ||
QEMU_TRACE_NOCHECK = "_nocheck__" + QEMU_TRACE | ||
QEMU_TRACE_TCG = QEMU_TRACE + "_tcg" | ||
QEMU_DSTATE = "_TRACE_%(NAME)s_DSTATE" | ||
QEMU_EVENT = "_TRACE_%(NAME)s_EVENT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
""" | ||
|
||
__author__ = "Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2016, Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2017, Lluís Vilanova <[email protected]>" | ||
__license__ = "GPL version 2 or (at your option) any later version" | ||
|
||
__maintainer__ = "Stefan Hajnoczi" | ||
|
@@ -46,6 +46,6 @@ def generate_h_begin(events, group): | |
|
||
|
||
def generate_h(event, group): | ||
out(' QEMU_%(uppername)s(%(argnames)s);', | ||
out(' QEMU_%(uppername)s(%(argnames)s);', | ||
uppername=event.name.upper(), | ||
argnames=", ".join(event.args.names())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
""" | ||
|
||
__author__ = "Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2016, Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2017, Lluís Vilanova <[email protected]>" | ||
__license__ = "GPL version 2 or (at your option) any later version" | ||
|
||
__maintainer__ = "Stefan Hajnoczi" | ||
|
@@ -35,14 +35,15 @@ def generate_h(event, group): | |
else: | ||
cond = "trace_event_get_state(%s)" % ("TRACE_" + event.name.upper()) | ||
|
||
out(' if (%(cond)s) {', | ||
' struct timeval _now;', | ||
' gettimeofday(&_now, NULL);', | ||
' qemu_log_mask(LOG_TRACE, "%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",', | ||
' getpid(),', | ||
' (size_t)_now.tv_sec, (size_t)_now.tv_usec', | ||
' %(argnames)s);', | ||
' }', | ||
out(' if (%(cond)s) {', | ||
' struct timeval _now;', | ||
' gettimeofday(&_now, NULL);', | ||
' qemu_log_mask(LOG_TRACE,', | ||
' "%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",', | ||
' getpid(),', | ||
' (size_t)_now.tv_sec, (size_t)_now.tv_usec', | ||
' %(argnames)s);', | ||
' }', | ||
cond=cond, | ||
name=event.name, | ||
fmt=event.fmt.rstrip("\n"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
""" | ||
|
||
__author__ = "Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2014, Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2017, Lluís Vilanova <[email protected]>" | ||
__license__ = "GPL version 2 or (at your option) any later version" | ||
|
||
__maintainer__ = "Stefan Hajnoczi" | ||
|
@@ -37,7 +37,7 @@ def generate_h_begin(events, group): | |
|
||
|
||
def generate_h(event, group): | ||
out(' _simple_%(api)s(%(args)s);', | ||
out(' _simple_%(api)s(%(args)s);', | ||
api=event.api(), | ||
args=", ".join(event.args.names())) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
""" | ||
|
||
__author__ = "Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2016, Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2017, Lluís Vilanova <[email protected]>" | ||
__license__ = "GPL version 2 or (at your option) any later version" | ||
|
||
__maintainer__ = "Stefan Hajnoczi" | ||
|
@@ -35,6 +35,6 @@ def generate_h(event, group): | |
if len(event.args) > 0: | ||
argnames = ", " + argnames | ||
|
||
out(' tracepoint(qemu, %(name)s%(tp_args)s);', | ||
out(' tracepoint(qemu, %(name)s%(tp_args)s);', | ||
name=event.name, | ||
tp_args=argnames) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
""" | ||
|
||
__author__ = "Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2016, Lluís Vilanova <[email protected]>" | ||
__copyright__ = "Copyright 2012-2017, Lluís Vilanova <[email protected]>" | ||
__license__ = "GPL version 2 or (at your option) any later version" | ||
|
||
__maintainer__ = "Stefan Hajnoczi" | ||
|
@@ -49,6 +49,19 @@ def generate(events, backend, group): | |
backend.generate_begin(events, group) | ||
|
||
for e in events: | ||
# tracer without checks | ||
out('', | ||
'static inline void %(api)s(%(args)s)', | ||
'{', | ||
api=e.api(e.QEMU_TRACE_NOCHECK), | ||
args=e.args) | ||
|
||
if "disable" not in e.properties: | ||
backend.generate(e, group) | ||
|
||
out('}') | ||
|
||
# tracer wrapper with checks (per-vCPU tracing) | ||
if "vcpu" in e.properties: | ||
trace_cpu = next(iter(e.args))[1] | ||
cond = "trace_event_get_vcpu_state(%(cpu)s,"\ | ||
|
@@ -63,16 +76,15 @@ def generate(events, backend, group): | |
'static inline void %(api)s(%(args)s)', | ||
'{', | ||
' if (%(cond)s) {', | ||
' %(api_nocheck)s(%(names)s);', | ||
' }', | ||
'}', | ||
api=e.api(), | ||
api_nocheck=e.api(e.QEMU_TRACE_NOCHECK), | ||
args=e.args, | ||
names=", ".join(e.args.names()), | ||
cond=cond) | ||
|
||
if "disable" not in e.properties: | ||
backend.generate(e, group) | ||
|
||
out(' }', | ||
'}') | ||
|
||
backend.generate_end(events, group) | ||
|
||
out('#endif /* TRACE_%s_GENERATED_TRACERS_H */' % group.upper()) |
Oops, something went wrong.