* [Qemu-devel] [PULL 00/15] Tracing patches
@ 2011-09-01 8:06 Stefan Hajnoczi
2011-09-01 19:08 ` Anthony Liguori
0 siblings, 1 reply; 25+ messages in thread
From: Stefan Hajnoczi @ 2011-09-01 8:06 UTC (permalink / raw)
To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi
The following changes since commit f0fb8b7180fdcf536ea635a0720e1496110ecb3b:
Merge branch 'omap-for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm into pm (2011-08-29 23:59:06 +0200)
are available in the git repository at:
ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing
Lluís (14):
build: Fix linkage of QEMU_PROG
build: [simple] Include qemu-timer-common.o in trace-obj-y
trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*
trace: [make] replace 'ifeq' with values in CONFIG_TRACE_*
trace: move backend-specific code into the trace/ directory
trace: avoid conditional code compilation during option parsing
trace: generalize the "property" concept in the trace-events file
trace: separate trace event control and query routines from the simple backend
trace: always compile support for controlling and querying trace event states
trace: add "-trace events" argument to control initial state
trace: always use the "nop" backend on events with the "disable" keyword
trace: [simple] disable all trace points by default
trace: [stderr] add support for dynamically enabling/disabling events
trace: enable all events
Stefan Hajnoczi (1):
simpletrace: fix process() argument count
Makefile | 1 +
Makefile.objs | 22 +-
Makefile.target | 8 +-
configure | 27 ++-
docs/tracing.txt | 73 +++--
hmp-commands.hx | 11 +-
monitor.c | 26 +-
qemu-config.c | 7 +-
qemu-options.hx | 27 ++-
scripts/simpletrace.py | 4 +-
scripts/tracetool | 116 ++++----
tests/test_path.c | 2 +-
trace-events | 651 +++++++++++++++++++--------------------
trace/control.c | 42 +++
trace/control.h | 41 +++
trace/default.c | 41 +++
simpletrace.c => trace/simple.c | 27 +-
simpletrace.h => trace/simple.h | 16 +-
trace/stderr.c | 37 +++
trace/stderr.h | 11 +
vl.c | 19 +-
21 files changed, 719 insertions(+), 490 deletions(-)
create mode 100644 trace/control.c
create mode 100644 trace/control.h
create mode 100644 trace/default.c
rename simpletrace.c => trace/simple.c (94%)
rename simpletrace.h => trace/simple.h (75%)
create mode 100644 trace/stderr.c
create mode 100644 trace/stderr.h
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Tracing patches
2011-09-01 8:06 Stefan Hajnoczi
@ 2011-09-01 19:08 ` Anthony Liguori
2011-09-02 9:39 ` Stefan Hajnoczi
0 siblings, 1 reply; 25+ messages in thread
From: Anthony Liguori @ 2011-09-01 19:08 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel
On 09/01/2011 03:06 AM, Stefan Hajnoczi wrote:
> The following changes since commit f0fb8b7180fdcf536ea635a0720e1496110ecb3b:
>
> Merge branch 'omap-for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm into pm (2011-08-29 23:59:06 +0200)
>
> are available in the git repository at:
>
> ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing
Pulled. Thanks.
Regards,
Anthony Liguori
>
> Lluís (14):
> build: Fix linkage of QEMU_PROG
> build: [simple] Include qemu-timer-common.o in trace-obj-y
> trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*
> trace: [make] replace 'ifeq' with values in CONFIG_TRACE_*
> trace: move backend-specific code into the trace/ directory
> trace: avoid conditional code compilation during option parsing
> trace: generalize the "property" concept in the trace-events file
> trace: separate trace event control and query routines from the simple backend
> trace: always compile support for controlling and querying trace event states
> trace: add "-trace events" argument to control initial state
> trace: always use the "nop" backend on events with the "disable" keyword
> trace: [simple] disable all trace points by default
> trace: [stderr] add support for dynamically enabling/disabling events
> trace: enable all events
>
> Stefan Hajnoczi (1):
> simpletrace: fix process() argument count
>
> Makefile | 1 +
> Makefile.objs | 22 +-
> Makefile.target | 8 +-
> configure | 27 ++-
> docs/tracing.txt | 73 +++--
> hmp-commands.hx | 11 +-
> monitor.c | 26 +-
> qemu-config.c | 7 +-
> qemu-options.hx | 27 ++-
> scripts/simpletrace.py | 4 +-
> scripts/tracetool | 116 ++++----
> tests/test_path.c | 2 +-
> trace-events | 651 +++++++++++++++++++--------------------
> trace/control.c | 42 +++
> trace/control.h | 41 +++
> trace/default.c | 41 +++
> simpletrace.c => trace/simple.c | 27 +-
> simpletrace.h => trace/simple.h | 16 +-
> trace/stderr.c | 37 +++
> trace/stderr.h | 11 +
> vl.c | 19 +-
> 21 files changed, 719 insertions(+), 490 deletions(-)
> create mode 100644 trace/control.c
> create mode 100644 trace/control.h
> create mode 100644 trace/default.c
> rename simpletrace.c => trace/simple.c (94%)
> rename simpletrace.h => trace/simple.h (75%)
> create mode 100644 trace/stderr.c
> create mode 100644 trace/stderr.h
>
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Tracing patches
2011-09-01 19:08 ` Anthony Liguori
@ 2011-09-02 9:39 ` Stefan Hajnoczi
2011-09-02 14:54 ` Anthony Liguori
0 siblings, 1 reply; 25+ messages in thread
From: Stefan Hajnoczi @ 2011-09-02 9:39 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Stefan Hajnoczi, qemu-devel
On Thu, Sep 1, 2011 at 8:08 PM, Anthony Liguori <aliguori@us.ibm.com> wrote:
> On 09/01/2011 03:06 AM, Stefan Hajnoczi wrote:
>>
>> The following changes since commit
>> f0fb8b7180fdcf536ea635a0720e1496110ecb3b:
>>
>> Merge branch 'omap-for-upstream' of
>> git://git.linaro.org/people/pmaydell/qemu-arm into pm (2011-08-29 23:59:06
>> +0200)
>>
>> are available in the git repository at:
>>
>> ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing
>
> Pulled. Thanks.
Your email was 14 hours ago but I don't see the commits in qemu.git. Any ideas?
Stefan
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Tracing patches
2011-09-02 9:39 ` Stefan Hajnoczi
@ 2011-09-02 14:54 ` Anthony Liguori
2011-09-02 15:00 ` Anthony Liguori
2011-09-02 15:30 ` Lluís Vilanova
0 siblings, 2 replies; 25+ messages in thread
From: Anthony Liguori @ 2011-09-02 14:54 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Stefan Hajnoczi, qemu-devel
On 09/02/2011 04:39 AM, Stefan Hajnoczi wrote:
> On Thu, Sep 1, 2011 at 8:08 PM, Anthony Liguori<aliguori@us.ibm.com> wrote:
>> On 09/01/2011 03:06 AM, Stefan Hajnoczi wrote:
>>>
>>> The following changes since commit
>>> f0fb8b7180fdcf536ea635a0720e1496110ecb3b:
>>>
>>> Merge branch 'omap-for-upstream' of
>>> git://git.linaro.org/people/pmaydell/qemu-arm into pm (2011-08-29 23:59:06
>>> +0200)
>>>
>>> are available in the git repository at:
>>>
>>> ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing
>>
>> Pulled. Thanks.
>
> Your email was 14 hours ago but I don't see the commits in qemu.git. Any ideas?
$ git log origin/master
commit 625f9e1f54cd78ee98ac22030da527c9a1cc9d2b
Merge: a952c57 2542bfd
Author: Anthony Liguori <aliguori@us.ibm.com>
Date: Thu Sep 1 13:57:19 2011 -0500
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Not sure why you don't see it. Did you not fetch?
Regards,
Anthony Liguori
> Stefan
>
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Tracing patches
2011-09-02 14:54 ` Anthony Liguori
@ 2011-09-02 15:00 ` Anthony Liguori
2011-09-02 15:30 ` Lluís Vilanova
1 sibling, 0 replies; 25+ messages in thread
From: Anthony Liguori @ 2011-09-02 15:00 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Stefan Hajnoczi, Stefan Hajnoczi, qemu-devel
On 09/02/2011 09:54 AM, Anthony Liguori wrote:
> On 09/02/2011 04:39 AM, Stefan Hajnoczi wrote:
>> On Thu, Sep 1, 2011 at 8:08 PM, Anthony Liguori<aliguori@us.ibm.com>
>> wrote:
>>> On 09/01/2011 03:06 AM, Stefan Hajnoczi wrote:
>>>>
>>>> The following changes since commit
>>>> f0fb8b7180fdcf536ea635a0720e1496110ecb3b:
>>>>
>>>> Merge branch 'omap-for-upstream' of
>>>> git://git.linaro.org/people/pmaydell/qemu-arm into pm (2011-08-29
>>>> 23:59:06
>>>> +0200)
>>>>
>>>> are available in the git repository at:
>>>>
>>>> ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing
>>>
>>> Pulled. Thanks.
>>
>> Your email was 14 hours ago but I don't see the commits in qemu.git.
>> Any ideas?
>
> $ git log origin/master
>
> commit 625f9e1f54cd78ee98ac22030da527c9a1cc9d2b
> Merge: a952c57 2542bfd
> Author: Anthony Liguori <aliguori@us.ibm.com>
> Date: Thu Sep 1 13:57:19 2011 -0500
>
> Merge remote-tracking branch 'stefanha/trivial-patches' into staging
>
> Not sure why you don't see it. Did you not fetch?
Er, muscle memory. I just assumed this was a trivial patch request.
Sorry about that.
Regards,
Anthony Liguori
>
> Regards,
>
> Anthony Liguori
>
>> Stefan
>>
>>
>
>
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Tracing patches
2011-09-02 14:54 ` Anthony Liguori
2011-09-02 15:00 ` Anthony Liguori
@ 2011-09-02 15:30 ` Lluís Vilanova
1 sibling, 0 replies; 25+ messages in thread
From: Lluís Vilanova @ 2011-09-02 15:30 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Stefan Hajnoczi, Stefan Hajnoczi, qemu-devel
Anthony Liguori writes:
> On 09/02/2011 04:39 AM, Stefan Hajnoczi wrote:
>> On Thu, Sep 1, 2011 at 8:08 PM, Anthony Liguori<aliguori@us.ibm.com> wrote:
>>> On 09/01/2011 03:06 AM, Stefan Hajnoczi wrote:
>>>>
>>>> The following changes since commit
>>>> f0fb8b7180fdcf536ea635a0720e1496110ecb3b:
>>>>
>>>> Merge branch 'omap-for-upstream' of
>>>> git://git.linaro.org/people/pmaydell/qemu-arm into pm (2011-08-29 23:59:06
>>>> +0200)
>>>>
>>>> are available in the git repository at:
>>>>
>>>> ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing
>>>
>>> Pulled. Thanks.
>>
>> Your email was 14 hours ago but I don't see the commits in qemu.git. Any ideas?
> $ git log origin/master
> commit 625f9e1f54cd78ee98ac22030da527c9a1cc9d2b
> Merge: a952c57 2542bfd
> Author: Anthony Liguori <aliguori@us.ibm.com>
> Date: Thu Sep 1 13:57:19 2011 -0500
> Merge remote-tracking branch 'stefanha/trivial-patches' into staging
> Not sure why you don't see it. Did you not fetch?
I think Stefan's pull request was for the 'tracing' head, not
'trivial-patches'.
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 00/15] Tracing patches
@ 2015-11-10 13:31 Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 01/15] trace: fix make foo-timestamp rules Stefan Hajnoczi
` (15 more replies)
0 siblings, 16 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi
The following changes since commit a8b4f9585a0bf5186fca793ce2c5d754cd8ec49a:
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-11-10' into staging (2015-11-10 09:39:24 +0000)
are available in the git repository at:
git://github.com/stefanha/qemu.git tags/tracing-pull-request
for you to fetch changes up to bd0e34e715bcc784fe732945d011cb36645d7f12:
log: add "-d trace:PATTERN" (2015-11-10 13:23:09 +0000)
----------------------------------------------------------------
----------------------------------------------------------------
Denis V. Lunev (2):
trace: no need to call trace_backend_init in different branches now
log: move qemu-log.c into util/ directory
Paolo Bonzini (11):
trace: count number of enabled events
trace: track enabled events in a separate array
trace: fix documentation
trace: split trace_init_events out of trace_init_backends
trace: split trace_init_file out of trace_init_backends
trace: add "-trace enable=..."
trace: add "-trace help"
log: do not unnecessarily include qom/cpu.h
trace: convert stderr backend to log
trace: switch default backend to "log"
log: add "-d trace:PATTERN"
Stefan Hajnoczi (2):
trace: fix make foo-timestamp rules
trace: add make dependencies on tracetool source
Makefile.objs | 1 -
bsd-user/main.c | 1 +
configure | 6 +-
cpu-exec.c | 1 +
exec.c | 1 +
hw/acpi/cpu_hotplug.c | 1 +
hw/timer/a9gtimer.c | 1 +
include/exec/log.h | 60 +++++++++++
include/qemu/log.h | 60 +----------
linux-user/main.c | 1 +
qemu-io.c | 2 +-
qemu-log.c | 177 --------------------------------
qemu-options.hx | 22 ++--
qom/cpu.c | 1 +
scripts/tracetool/backend/stderr.py | 47 ---------
scripts/tracetool/format/events_c.py | 2 +-
target-alpha/translate.c | 1 +
target-arm/translate.c | 1 +
target-cris/translate.c | 1 +
target-i386/seg_helper.c | 1 +
target-i386/smm_helper.c | 1 +
target-i386/translate.c | 1 +
target-lm32/helper.c | 1 +
target-lm32/translate.c | 1 +
target-m68k/translate.c | 1 +
target-microblaze/helper.c | 1 +
target-microblaze/translate.c | 1 +
target-mips/helper.c | 1 +
target-mips/translate.c | 1 +
target-moxie/translate.c | 1 +
target-openrisc/translate.c | 1 +
target-ppc/mmu-hash32.c | 1 +
target-ppc/mmu-hash64.c | 1 +
target-ppc/mmu_helper.c | 1 +
target-ppc/translate.c | 1 +
target-s390x/translate.c | 1 +
target-sh4/helper.c | 1 +
target-sh4/translate.c | 1 +
target-sparc/int32_helper.c | 1 +
target-sparc/int64_helper.c | 1 +
target-sparc/translate.c | 1 +
target-tilegx/translate.c | 1 +
target-tricore/translate.c | 1 +
target-unicore32/translate.c | 1 +
target-xtensa/translate.c | 1 +
tcg/tcg.c | 1 +
trace/Makefile.objs | 48 +++++----
trace/control-internal.h | 15 ++-
trace/control.c | 98 +++++++++++++-----
trace/control.h | 44 +++++++-
trace/event-internal.h | 2 -
trace/simple.c | 6 +-
trace/simple.h | 4 +-
translate-all.c | 1 +
util/Makefile.objs | 1 +
util/log.c | 190 +++++++++++++++++++++++++++++++++++
vl.c | 38 ++++---
57 files changed, 488 insertions(+), 373 deletions(-)
create mode 100644 include/exec/log.h
delete mode 100644 qemu-log.c
delete mode 100644 scripts/tracetool/backend/stderr.py
create mode 100644 util/log.c
--
2.5.0
^ permalink raw reply [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 01/15] trace: fix make foo-timestamp rules
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 02/15] trace: add make dependencies on tracetool source Stefan Hajnoczi
` (14 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi
The Makefile uses intermediate timestamp files to avoid rebuilding if
tracetool output is unchanged.
Timestamps are implemented incorrectly. This was fixed for rules.mak in
commit 4b25966ab976f3a7fd9008193b2defcc82f8f04d ("rules.mak: cleanup
config generation rules") but never fixed in trace/Makefile.objs.
The problem with the old timestamp implementation was that make doesn't
notice the updated file modification time until the next time it is run.
It was necessary to run make twice in a row to achieve a full rebuild.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1446198795-6081-2-git-send-email-stefanha@redhat.com
---
trace/Makefile.objs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/trace/Makefile.objs b/trace/Makefile.objs
index 32f7a32..73bec38 100644
--- a/trace/Makefile.objs
+++ b/trace/Makefile.objs
@@ -5,20 +5,20 @@
ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
$(obj)/generated-ust-provider.h: $(obj)/generated-ust-provider.h-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-ust-provider.h-timestamp: $(SRC_PATH)/trace-events
$(call quiet-command,$(TRACETOOL) \
--format=ust-events-h \
--backends=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
$(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-ust.c-timestamp: $(SRC_PATH)/trace-events
$(call quiet-command,$(TRACETOOL) \
--format=ust-events-c \
--backends=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
$(obj)/generated-events.h: $(obj)/generated-ust-provider.h
$(obj)/generated-events.c: $(obj)/generated-ust.c
@@ -28,20 +28,20 @@ endif
# Auto-generated event descriptions
$(obj)/generated-events.h: $(obj)/generated-events.h-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events
$(call quiet-command,$(TRACETOOL) \
--format=events-h \
--backends=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
$(obj)/generated-events.c: $(obj)/generated-events.c-timestamp $(BUILD_DIR)/config-host.mak
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-events.c-timestamp: $(SRC_PATH)/trace-events
$(call quiet-command,$(TRACETOOL) \
--format=events-c \
--backends=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
util-obj-y += generated-events.o
@@ -81,12 +81,12 @@ $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.
# rule file. So we use '.dtrace' instead
ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
$(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--format=d \
--backends=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
$(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers-dtrace.dtrace
$(call quiet-command,dtrace -o $@ -h -s $<, " GEN $@")
@@ -100,28 +100,28 @@ endif
# Translation level
$(obj)/generated-helpers-wrappers.h: $(obj)/generated-helpers-wrappers.h-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-helpers-wrappers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-wrapper-h \
--backend=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
$(obj)/generated-helpers.h: $(obj)/generated-helpers.h-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-helpers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-h \
--backend=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
$(obj)/generated-helpers.c: $(obj)/generated-helpers.c-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-helpers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-c \
--backend=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
$(obj)/generated-helpers.o: $(obj)/generated-helpers.c
@@ -129,12 +129,12 @@ target-obj-y += generated-helpers.o
$(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
$(obj)/generated-tcg-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
$(call quiet-command,$(TRACETOOL) \
--format=tcg-h \
--backend=$(TRACE_BACKENDS) \
< $< > $@," GEN $(patsubst %-timestamp,%,$@)")
- @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
######################################################################
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 02/15] trace: add make dependencies on tracetool source
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 01/15] trace: fix make foo-timestamp rules Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 03/15] trace: count number of enabled events Stefan Hajnoczi
` (13 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi
Patches that change tracetool can break the build if old build output
files are lying around.
This happens because the Makefile does not specify dependencies on
tracetool. The build will use old object files that do not match the
current source code.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1446198795-6081-3-git-send-email-stefanha@redhat.com
---
trace/Makefile.objs | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/trace/Makefile.objs b/trace/Makefile.objs
index 73bec38..5145b34 100644
--- a/trace/Makefile.objs
+++ b/trace/Makefile.objs
@@ -1,12 +1,20 @@
# -*- mode: makefile -*-
######################################################################
+# tracetool source files
+# Every rule that invokes tracetool must depend on this so code is regenerated
+# if tracetool itself changes.
+
+tracetool-y = $(SRC_PATH)/scripts/tracetool.py
+tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
+
+######################################################################
# Auto-generated event descriptions for LTTng ust code
ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
$(obj)/generated-ust-provider.h: $(obj)/generated-ust-provider.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-ust-provider.h-timestamp: $(SRC_PATH)/trace-events
+$(obj)/generated-ust-provider.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=ust-events-h \
--backends=$(TRACE_BACKENDS) \
@@ -14,7 +22,7 @@ $(obj)/generated-ust-provider.h-timestamp: $(SRC_PATH)/trace-events
$(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-ust.c-timestamp: $(SRC_PATH)/trace-events
+$(obj)/generated-ust.c-timestamp: $(SRC_PATH)/trace-events $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=ust-events-c \
--backends=$(TRACE_BACKENDS) \
@@ -29,7 +37,7 @@ endif
$(obj)/generated-events.h: $(obj)/generated-events.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events
+$(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=events-h \
--backends=$(TRACE_BACKENDS) \
@@ -37,7 +45,7 @@ $(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events
$(obj)/generated-events.c: $(obj)/generated-events.c-timestamp $(BUILD_DIR)/config-host.mak
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-events.c-timestamp: $(SRC_PATH)/trace-events
+$(obj)/generated-events.c-timestamp: $(SRC_PATH)/trace-events $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=events-c \
--backends=$(TRACE_BACKENDS) \
@@ -54,7 +62,7 @@ util-obj-y += generated-events.o
$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
@cmp -s $< $@ || cp $< $@
-$(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+$(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=h \
--backends=$(TRACE_BACKENDS) \
@@ -65,7 +73,7 @@ $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/conf
$(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
@cmp -s $< $@ || cp $< $@
-$(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+$(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=c \
--backends=$(TRACE_BACKENDS) \
@@ -82,7 +90,7 @@ $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.
ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
$(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=d \
--backends=$(TRACE_BACKENDS) \
@@ -101,7 +109,7 @@ endif
$(obj)/generated-helpers-wrappers.h: $(obj)/generated-helpers-wrappers.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-helpers-wrappers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+$(obj)/generated-helpers-wrappers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-wrapper-h \
--backend=$(TRACE_BACKENDS) \
@@ -109,7 +117,7 @@ $(obj)/generated-helpers-wrappers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_
$(obj)/generated-helpers.h: $(obj)/generated-helpers.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-helpers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+$(obj)/generated-helpers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-h \
--backend=$(TRACE_BACKENDS) \
@@ -117,7 +125,7 @@ $(obj)/generated-helpers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/conf
$(obj)/generated-helpers.c: $(obj)/generated-helpers.c-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-helpers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+$(obj)/generated-helpers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-c \
--backend=$(TRACE_BACKENDS) \
@@ -130,7 +138,7 @@ target-obj-y += generated-helpers.o
$(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
-$(obj)/generated-tcg-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+$(obj)/generated-tcg-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=tcg-h \
--backend=$(TRACE_BACKENDS) \
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 03/15] trace: count number of enabled events
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 01/15] trace: fix make foo-timestamp rules Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 02/15] trace: add make dependencies on tracetool source Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 04/15] trace: track enabled events in a separate array Stefan Hajnoczi
` (12 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
This lets trace_event_get_state_dynamic quickly return false. Right
now there is hardly any benefit because there are also many assertions
and indirections, but the next patch will streamline all of this.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1446012388-9586-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
trace/control-internal.h | 4 +++-
trace/control.c | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/trace/control-internal.h b/trace/control-internal.h
index 5a8df28..271bddb 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -14,6 +14,7 @@
extern TraceEvent trace_events[];
+extern int trace_events_enabled_count;
static inline TraceEventID trace_event_count(void)
@@ -54,13 +55,14 @@ static inline bool trace_event_get_state_static(TraceEvent *ev)
static inline bool trace_event_get_state_dynamic(TraceEvent *ev)
{
assert(ev != NULL);
- return ev->dstate;
+ return unlikely(trace_events_enabled_count) && ev->dstate;
}
static inline void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
{
assert(ev != NULL);
assert(trace_event_get_state_static(ev));
+ trace_events_enabled_count += state - ev->dstate;
ev->dstate = state;
}
diff --git a/trace/control.c b/trace/control.c
index 995beb3..95fbc07 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -16,6 +16,8 @@
#endif
#include "qemu/error-report.h"
+int trace_events_enabled_count;
+
TraceEvent *trace_event_name(const char *name)
{
assert(name != NULL);
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 04/15] trace: track enabled events in a separate array
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (2 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 03/15] trace: count number of enabled events Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 05/15] trace: fix documentation Stefan Hajnoczi
` (11 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
This is more cache friendly on the fast path, where we already have
the event id available.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1446012388-9586-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
scripts/tracetool/format/events_c.py | 2 +-
trace/control-internal.h | 15 +++++++++++----
trace/control.c | 1 +
trace/control.h | 2 +-
trace/event-internal.h | 2 --
5 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py
index 2d97fa3..2717ea3 100644
--- a/scripts/tracetool/format/events_c.py
+++ b/scripts/tracetool/format/events_c.py
@@ -27,7 +27,7 @@ def generate(events, backend):
out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
for e in events:
- out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s, .dstate = 0 },',
+ out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s },',
id = "TRACE_" + e.name.upper(),
name = e.name,
sstate = "TRACE_%s_ENABLED" % e.name.upper())
diff --git a/trace/control-internal.h b/trace/control-internal.h
index 271bddb..07cb1c1 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -14,6 +14,7 @@
extern TraceEvent trace_events[];
+extern bool trace_events_dstate[];
extern int trace_events_enabled_count;
@@ -52,18 +53,24 @@ static inline bool trace_event_get_state_static(TraceEvent *ev)
return ev->sstate;
}
+static inline bool trace_event_get_state_dynamic_by_id(int id)
+{
+ return unlikely(trace_events_enabled_count) && trace_events_dstate[id];
+}
+
static inline bool trace_event_get_state_dynamic(TraceEvent *ev)
{
- assert(ev != NULL);
- return unlikely(trace_events_enabled_count) && ev->dstate;
+ int id = trace_event_get_id(ev);
+ return trace_event_get_state_dynamic_by_id(id);
}
static inline void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
{
+ int id = trace_event_get_id(ev);
assert(ev != NULL);
assert(trace_event_get_state_static(ev));
- trace_events_enabled_count += state - ev->dstate;
- ev->dstate = state;
+ trace_events_enabled_count += state - trace_events_dstate[id];
+ trace_events_dstate[id] = state;
}
#endif /* TRACE__CONTROL_INTERNAL_H */
diff --git a/trace/control.c b/trace/control.c
index 95fbc07..700440c 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -17,6 +17,7 @@
#include "qemu/error-report.h"
int trace_events_enabled_count;
+bool trace_events_dstate[TRACE_EVENT_COUNT];
TraceEvent *trace_event_name(const char *name)
{
diff --git a/trace/control.h b/trace/control.h
index da9bb6b..6af7ddc 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -104,7 +104,7 @@ static const char * trace_event_get_name(TraceEvent *ev);
* As a down side, you must always use an immediate #TraceEventID value.
*/
#define trace_event_get_state(id) \
- ((id ##_ENABLED) && trace_event_get_state_dynamic(trace_event_id(id)))
+ ((id ##_ENABLED) && trace_event_get_state_dynamic_by_id(id))
/**
* trace_event_get_state_static:
diff --git a/trace/event-internal.h b/trace/event-internal.h
index b2310d9..86f6a51 100644
--- a/trace/event-internal.h
+++ b/trace/event-internal.h
@@ -18,7 +18,6 @@
* @id: Unique event identifier.
* @name: Event name.
* @sstate: Static tracing state.
- * @dstate: Dynamic tracing state.
*
* Opaque generic description of a tracing event.
*/
@@ -26,7 +25,6 @@ typedef struct TraceEvent {
TraceEventID id;
const char * name;
const bool sstate;
- bool dstate;
} TraceEvent;
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 05/15] trace: fix documentation
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (3 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 04/15] trace: track enabled events in a separate array Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 06/15] trace: split trace_init_events out of trace_init_backends Stefan Hajnoczi
` (10 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
Mention the ftrace backend too.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-2-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
qemu-options.hx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 0eea4ee..a8fe78e 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3489,13 +3489,13 @@ Specify tracing options.
@table @option
@item events=@var{file}
Immediately enable events listed in @var{file}.
-The file must contain one event name (as listed in the @var{trace-events} file)
-per line.
-This option is only available if QEMU has been compiled with
-either @var{simple} or @var{stderr} tracing backend.
+The file must contain one event name (as listed in the @file{trace-events} file)
+per line; globbing patterns are accepted too. This option is only
+available if QEMU has been compiled with the @var{simple}, @var{stderr} or
+@var{ftrace} tracing backend.
+
@item file=@var{file}
Log output traces to @var{file}.
-
This option is only available if QEMU has been compiled with
the @var{simple} tracing backend.
@end table
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 06/15] trace: split trace_init_events out of trace_init_backends
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (4 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 05/15] trace: fix documentation Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 07/15] trace: split trace_init_file " Stefan Hajnoczi
` (9 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
This is cleaner and has two advantages. First, it improves error
reporting with -daemonize. Second, multiple "-trace events" options
now cumulate.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-3-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
qemu-io.c | 2 +-
trace/control.c | 5 ++---
trace/control.h | 15 ++++++++++++---
vl.c | 8 ++++----
4 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index 269f17c..d6fa11b 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -440,7 +440,7 @@ int main(int argc, char **argv)
}
break;
case 'T':
- if (!trace_init_backends(optarg, NULL)) {
+ if (!trace_init_backends(optarg)) {
exit(1); /* error message will have been printed */
}
break;
diff --git a/trace/control.c b/trace/control.c
index 700440c..931d64c 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -88,7 +88,7 @@ TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev)
return NULL;
}
-static void trace_init_events(const char *fname)
+void trace_init_events(const char *fname)
{
Location loc;
FILE *fp;
@@ -145,7 +145,7 @@ static void trace_init_events(const char *fname)
loc_pop(&loc);
}
-bool trace_init_backends(const char *events, const char *file)
+bool trace_init_backends(const char *file)
{
#ifdef CONFIG_TRACE_SIMPLE
if (!st_init(file)) {
@@ -167,6 +167,5 @@ bool trace_init_backends(const char *events, const char *file)
}
#endif
- trace_init_events(events);
return true;
}
diff --git a/trace/control.h b/trace/control.h
index 6af7ddc..7905917 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -150,8 +150,6 @@ static void trace_event_set_state_dynamic(TraceEvent *ev, bool state);
/**
* trace_init_backends:
- * @events: Name of file with events to be enabled at startup; may be NULL.
- * Corresponds to commandline option "-trace events=...".
* @file: Name of trace output file; may be NULL.
* Corresponds to commandline option "-trace file=...".
*
@@ -159,7 +157,18 @@ static void trace_event_set_state_dynamic(TraceEvent *ev, bool state);
*
* Returns: Whether the backends could be successfully initialized.
*/
-bool trace_init_backends(const char *events, const char *file);
+bool trace_init_backends(const char *file);
+
+/**
+ * trace_init_events:
+ * @events: Name of file with events to be enabled at startup; may be NULL.
+ * Corresponds to commandline option "-trace events=...".
+ *
+ * Read the list of enabled tracing events.
+ *
+ * Returns: Whether the backends could be successfully initialized.
+ */
+void trace_init_events(const char *file);
#include "trace/control-internal.h"
diff --git a/vl.c b/vl.c
index 21e8876..4df502c 100644
--- a/vl.c
+++ b/vl.c
@@ -2991,7 +2991,6 @@ int main(int argc, char **argv, char **envp)
bool userconfig = true;
const char *log_mask = NULL;
const char *log_file = NULL;
- const char *trace_events = NULL;
const char *trace_file = NULL;
ram_addr_t maxram_size;
uint64_t ram_slots = 0;
@@ -3908,8 +3907,9 @@ int main(int argc, char **argv, char **envp)
if (!opts) {
exit(1);
}
- trace_events = qemu_opt_get(opts, "events");
+ trace_init_events(qemu_opt_get(opts, "events"));
trace_file = qemu_opt_get(opts, "file");
+ qemu_opts_del(opts);
break;
}
case QEMU_OPTION_readconfig:
@@ -4109,7 +4109,7 @@ int main(int argc, char **argv, char **envp)
}
if (!is_daemonized()) {
- if (!trace_init_backends(trace_events, trace_file)) {
+ if (!trace_init_backends(trace_file)) {
exit(1);
}
}
@@ -4672,7 +4672,7 @@ int main(int argc, char **argv, char **envp)
os_setup_post();
if (is_daemonized()) {
- if (!trace_init_backends(trace_events, trace_file)) {
+ if (!trace_init_backends(trace_file)) {
exit(1);
}
}
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 07/15] trace: split trace_init_file out of trace_init_backends
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (5 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 06/15] trace: split trace_init_events out of trace_init_backends Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 08/15] trace: no need to call trace_backend_init in different branches now Stefan Hajnoczi
` (8 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
This is cleaner, and improves error reporting with -daemonize.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-4-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
qemu-io.c | 2 +-
trace/control.c | 17 ++++++++++++-----
trace/control.h | 13 ++++++++++++-
trace/simple.c | 6 ++----
trace/simple.h | 4 ++--
vl.c | 13 +++++++++----
6 files changed, 38 insertions(+), 17 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index d6fa11b..fbddf82 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -440,7 +440,7 @@ int main(int argc, char **argv)
}
break;
case 'T':
- if (!trace_init_backends(optarg)) {
+ if (!trace_init_backends()) {
exit(1); /* error message will have been printed */
}
break;
diff --git a/trace/control.c b/trace/control.c
index 931d64c..f5a497a 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -145,17 +145,24 @@ void trace_init_events(const char *fname)
loc_pop(&loc);
}
-bool trace_init_backends(const char *file)
+void trace_init_file(const char *file)
{
#ifdef CONFIG_TRACE_SIMPLE
- if (!st_init(file)) {
- fprintf(stderr, "failed to initialize simple tracing backend.\n");
- return false;
- }
+ st_set_trace_file(file);
#else
if (file) {
fprintf(stderr, "error: -trace file=...: "
"option not supported by the selected tracing backends\n");
+ exit(1);
+ }
+#endif
+}
+
+bool trace_init_backends(void)
+{
+#ifdef CONFIG_TRACE_SIMPLE
+ if (!st_init()) {
+ fprintf(stderr, "failed to initialize simple tracing backend.\n");
return false;
}
#endif
diff --git a/trace/control.h b/trace/control.h
index 7905917..d50f399 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -157,7 +157,7 @@ static void trace_event_set_state_dynamic(TraceEvent *ev, bool state);
*
* Returns: Whether the backends could be successfully initialized.
*/
-bool trace_init_backends(const char *file);
+bool trace_init_backends(void);
/**
* trace_init_events:
@@ -170,6 +170,17 @@ bool trace_init_backends(const char *file);
*/
void trace_init_events(const char *file);
+/**
+ * trace_init_file:
+ * @file: Name of trace output file; may be NULL.
+ * Corresponds to commandline option "-trace file=...".
+ *
+ * Record the name of the output file for the tracing backend.
+ * Exits if no selected backend does not support specifying the
+ * output file, and a non-NULL file was passed.
+ */
+void trace_init_file(const char *file);
+
#include "trace/control-internal.h"
diff --git a/trace/simple.c b/trace/simple.c
index 11ad030..a4bc705 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -322,7 +322,7 @@ void st_set_trace_file_enabled(bool enable)
* @file The trace file name or NULL for the default name-<pid> set at
* config time
*/
-bool st_set_trace_file(const char *file)
+void st_set_trace_file(const char *file)
{
st_set_trace_file_enabled(false);
@@ -335,7 +335,6 @@ bool st_set_trace_file(const char *file)
}
st_set_trace_file_enabled(true);
- return true;
}
void st_print_trace_file_status(FILE *stream, int (*stream_printf)(FILE *stream, const char *fmt, ...))
@@ -373,7 +372,7 @@ static GThread *trace_thread_create(GThreadFunc fn)
return thread;
}
-bool st_init(const char *file)
+bool st_init(void)
{
GThread *thread;
@@ -386,6 +385,5 @@ bool st_init(const char *file)
}
atexit(st_flush_trace_buffer);
- st_set_trace_file(file);
return true;
}
diff --git a/trace/simple.h b/trace/simple.h
index 6997996..8d1a32e 100644
--- a/trace/simple.h
+++ b/trace/simple.h
@@ -20,8 +20,8 @@
void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
void st_set_trace_file_enabled(bool enable);
-bool st_set_trace_file(const char *file);
-bool st_init(const char *file);
+void st_set_trace_file(const char *file);
+bool st_init(void);
void st_flush_trace_buffer(void);
typedef struct {
diff --git a/vl.c b/vl.c
index 4df502c..b567ed9 100644
--- a/vl.c
+++ b/vl.c
@@ -2991,7 +2991,7 @@ int main(int argc, char **argv, char **envp)
bool userconfig = true;
const char *log_mask = NULL;
const char *log_file = NULL;
- const char *trace_file = NULL;
+ char *trace_file = NULL;
ram_addr_t maxram_size;
uint64_t ram_slots = 0;
FILE *vmstate_dump_file = NULL;
@@ -3908,7 +3908,10 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
trace_init_events(qemu_opt_get(opts, "events"));
- trace_file = qemu_opt_get(opts, "file");
+ if (trace_file) {
+ g_free(trace_file);
+ }
+ trace_file = g_strdup(qemu_opt_get(opts, "file"));
qemu_opts_del(opts);
break;
}
@@ -4092,6 +4095,8 @@ int main(int argc, char **argv, char **envp)
exit(0);
}
+ trace_init_file(trace_file);
+
/* Open the logfile at this point and set the log mask if necessary.
*/
if (log_file) {
@@ -4109,7 +4114,7 @@ int main(int argc, char **argv, char **envp)
}
if (!is_daemonized()) {
- if (!trace_init_backends(trace_file)) {
+ if (!trace_init_backends()) {
exit(1);
}
}
@@ -4672,7 +4677,7 @@ int main(int argc, char **argv, char **envp)
os_setup_post();
if (is_daemonized()) {
- if (!trace_init_backends(trace_file)) {
+ if (!trace_init_backends()) {
exit(1);
}
}
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 08/15] trace: no need to call trace_backend_init in different branches now
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (6 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 07/15] trace: split trace_init_file " Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 09/15] trace: add "-trace enable=..." Stefan Hajnoczi
` (7 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Paolo Bonzini, Stefan Hajnoczi, Denis V. Lunev
From: "Denis V. Lunev" <den@openvz.org>
original idea to split calling locations was to spawn tracing thread
in the final child process according to
commit 8a745f2a9296ad2cf6bda33534ed298f2625a4ad
Author: Michael Mueller
Date: Mon Sep 23 16:36:54 2013 +0200
os_daemonize is now on top of both locations. Drop unneeded ifs.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1446151457-21157-5-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
vl.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/vl.c b/vl.c
index b567ed9..a9c3449 100644
--- a/vl.c
+++ b/vl.c
@@ -4113,10 +4113,8 @@ int main(int argc, char **argv, char **envp)
qemu_set_log(mask);
}
- if (!is_daemonized()) {
- if (!trace_init_backends()) {
- exit(1);
- }
+ if (!trace_init_backends()) {
+ exit(1);
}
/* If no data_dir is specified then try to find it relative to the
@@ -4676,12 +4674,6 @@ int main(int argc, char **argv, char **envp)
os_setup_post();
- if (is_daemonized()) {
- if (!trace_init_backends()) {
- exit(1);
- }
- }
-
main_loop();
replay_disable_events();
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 09/15] trace: add "-trace enable=..."
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (7 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 08/15] trace: no need to call trace_backend_init in different branches now Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 10/15] trace: add "-trace help" Stefan Hajnoczi
` (6 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
Allow enabling events without going through a file, for example:
qemu-system-x86_64 -trace bdrv_aio_writev -trace bdrv_aio_readv
or with globbing too:
qemu-system-x86_64 -trace 'bdrv_aio_*'
if an appropriate backend is enabled (simple, stderr, ftrace).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-6-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
qemu-options.hx | 10 +++++++++-
trace/control.c | 48 +++++++++++++++++++++++++++---------------------
trace/control.h | 9 +++++++++
vl.c | 11 +++++++++--
4 files changed, 54 insertions(+), 24 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index a8fe78e..45ddd27 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3475,7 +3475,7 @@ config files on @var{sysconfdir}, but won't make it skip the QEMU-provided confi
files from @var{datadir}.
ETEXI
DEF("trace", HAS_ARG, QEMU_OPTION_trace,
- "-trace [events=<file>][,file=<file>]\n"
+ "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
" specify tracing options\n",
QEMU_ARCH_ALL)
STEXI
@@ -3487,6 +3487,14 @@ HXCOMM HX does not support conditional compilation of text.
Specify tracing options.
@table @option
+@item [enable=]@var{pattern}
+Immediately enable events matching @var{pattern}.
+The file must contain one event name (as listed in the @file{trace-events} file)
+per line; globbing patterns are accepted too. This option is only
+available if QEMU has been compiled with the @var{simple}, @var{stderr}
+or @var{ftrace} tracing backend. To specify multiple events or patterns,
+specify the @option{-trace} option multiple times.
+
@item events=@var{file}
Immediately enable events listed in @var{file}.
The file must contain one event name (as listed in the @file{trace-events} file)
diff --git a/trace/control.c b/trace/control.c
index f5a497a..af92705 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -88,6 +88,32 @@ TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev)
return NULL;
}
+void trace_enable_events(const char *line_buf)
+{
+ const bool enable = ('-' != line_buf[0]);
+ const char *line_ptr = enable ? line_buf : line_buf + 1;
+
+ if (trace_event_is_pattern(line_ptr)) {
+ TraceEvent *ev = NULL;
+ while ((ev = trace_event_pattern(line_ptr, ev)) != NULL) {
+ if (trace_event_get_state_static(ev)) {
+ trace_event_set_state_dynamic(ev, enable);
+ }
+ }
+ } else {
+ TraceEvent *ev = trace_event_name(line_ptr);
+ if (ev == NULL) {
+ error_report("WARNING: trace event '%s' does not exist",
+ line_ptr);
+ } else if (!trace_event_get_state_static(ev)) {
+ error_report("WARNING: trace event '%s' is not traceable",
+ line_ptr);
+ } else {
+ trace_event_set_state_dynamic(ev, enable);
+ }
+ }
+}
+
void trace_init_events(const char *fname)
{
Location loc;
@@ -114,27 +140,7 @@ void trace_init_events(const char *fname)
if ('#' == line_buf[0]) { /* skip commented lines */
continue;
}
- const bool enable = ('-' != line_buf[0]);
- char *line_ptr = enable ? line_buf : line_buf + 1;
- if (trace_event_is_pattern(line_ptr)) {
- TraceEvent *ev = NULL;
- while ((ev = trace_event_pattern(line_ptr, ev)) != NULL) {
- if (trace_event_get_state_static(ev)) {
- trace_event_set_state_dynamic(ev, enable);
- }
- }
- } else {
- TraceEvent *ev = trace_event_name(line_ptr);
- if (ev == NULL) {
- error_report("WARNING: trace event '%s' does not exist",
- line_ptr);
- } else if (!trace_event_get_state_static(ev)) {
- error_report("WARNING: trace event '%s' is not traceable",
- line_ptr);
- } else {
- trace_event_set_state_dynamic(ev, enable);
- }
- }
+ trace_enable_events(line_buf);
}
}
if (fclose(fp) != 0) {
diff --git a/trace/control.h b/trace/control.h
index d50f399..d5081ce 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -181,6 +181,15 @@ void trace_init_events(const char *file);
*/
void trace_init_file(const char *file);
+/**
+ * trace_enable_events:
+ * @line_buf: A string with a glob pattern of events to be enabled or,
+ * if the string starts with '-', disabled.
+ *
+ * Enable or disable matching events.
+ */
+void trace_enable_events(const char *line_buf);
+
#include "trace/control-internal.h"
diff --git a/vl.c b/vl.c
index a9c3449..e391e1d 100644
--- a/vl.c
+++ b/vl.c
@@ -271,10 +271,14 @@ static QemuOptsList qemu_sandbox_opts = {
static QemuOptsList qemu_trace_opts = {
.name = "trace",
- .implied_opt_name = "trace",
+ .implied_opt_name = "enable",
.head = QTAILQ_HEAD_INITIALIZER(qemu_trace_opts.head),
.desc = {
{
+ .name = "enable",
+ .type = QEMU_OPT_STRING,
+ },
+ {
.name = "events",
.type = QEMU_OPT_STRING,
},{
@@ -3903,10 +3907,13 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_trace:
{
opts = qemu_opts_parse_noisily(qemu_find_opts("trace"),
- optarg, false);
+ optarg, true);
if (!opts) {
exit(1);
}
+ if (qemu_opt_get(opts, "enable")) {
+ trace_enable_events(qemu_opt_get(opts, "enable"));
+ }
trace_init_events(qemu_opt_get(opts, "events"));
if (trace_file) {
g_free(trace_file);
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 10/15] trace: add "-trace help"
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (8 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 09/15] trace: add "-trace enable=..." Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 11/15] log: do not unnecessarily include qom/cpu.h Stefan Hajnoczi
` (5 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
Print a list of trace points
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-7-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
qemu-options.hx | 2 ++
trace/control.c | 21 ++++++++++++++++++++-
trace/control.h | 7 +++++++
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 45ddd27..fff23dd 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3495,6 +3495,8 @@ available if QEMU has been compiled with the @var{simple}, @var{stderr}
or @var{ftrace} tracing backend. To specify multiple events or patterns,
specify the @option{-trace} option multiple times.
+Use @code{-trace help} to print a list of names of trace points.
+
@item events=@var{file}
Immediately enable events listed in @var{file}.
The file must contain one event name (as listed in the @file{trace-events} file)
diff --git a/trace/control.c b/trace/control.c
index af92705..bef7884 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -88,7 +88,16 @@ TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev)
return NULL;
}
-void trace_enable_events(const char *line_buf)
+void trace_list_events(void)
+{
+ int i;
+ for (i = 0; i < trace_event_count(); i++) {
+ TraceEvent *res = trace_event_id(i);
+ fprintf(stderr, "%s\n", trace_event_get_name(res));
+ }
+}
+
+static void do_trace_enable_events(const char *line_buf)
{
const bool enable = ('-' != line_buf[0]);
const char *line_ptr = enable ? line_buf : line_buf + 1;
@@ -114,6 +123,16 @@ void trace_enable_events(const char *line_buf)
}
}
+void trace_enable_events(const char *line_buf)
+{
+ if (is_help_option(line_buf)) {
+ trace_list_events();
+ exit(0);
+ } else {
+ do_trace_enable_events(line_buf);
+ }
+}
+
void trace_init_events(const char *fname)
{
Location loc;
diff --git a/trace/control.h b/trace/control.h
index d5081ce..d5bc86e 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -182,6 +182,13 @@ void trace_init_events(const char *file);
void trace_init_file(const char *file);
/**
+ * trace_list_events:
+ *
+ * List all available events.
+ */
+void trace_list_events(void);
+
+/**
* trace_enable_events:
* @line_buf: A string with a glob pattern of events to be enabled or,
* if the string starts with '-', disabled.
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 11/15] log: do not unnecessarily include qom/cpu.h
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (9 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 10/15] trace: add "-trace help" Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 12/15] log: move qemu-log.c into util/ directory Stefan Hajnoczi
` (4 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
Split the bits that require it to exec/log.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-8-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
bsd-user/main.c | 1 +
cpu-exec.c | 1 +
exec.c | 1 +
hw/acpi/cpu_hotplug.c | 1 +
hw/timer/a9gtimer.c | 1 +
include/exec/log.h | 60 +++++++++++++++++++++++++++++++++++++++++++
include/qemu/log.h | 59 ------------------------------------------
linux-user/main.c | 1 +
qom/cpu.c | 1 +
target-alpha/translate.c | 1 +
target-arm/translate.c | 1 +
target-cris/translate.c | 1 +
target-i386/seg_helper.c | 1 +
target-i386/smm_helper.c | 1 +
target-i386/translate.c | 1 +
target-lm32/helper.c | 1 +
target-lm32/translate.c | 1 +
target-m68k/translate.c | 1 +
target-microblaze/helper.c | 1 +
target-microblaze/translate.c | 1 +
target-mips/helper.c | 1 +
target-mips/translate.c | 1 +
target-moxie/translate.c | 1 +
target-openrisc/translate.c | 1 +
target-ppc/mmu-hash32.c | 1 +
target-ppc/mmu-hash64.c | 1 +
target-ppc/mmu_helper.c | 1 +
target-ppc/translate.c | 1 +
target-s390x/translate.c | 1 +
target-sh4/helper.c | 1 +
target-sh4/translate.c | 1 +
target-sparc/int32_helper.c | 1 +
target-sparc/int64_helper.c | 1 +
target-sparc/translate.c | 1 +
target-tilegx/translate.c | 1 +
target-tricore/translate.c | 1 +
target-unicore32/translate.c | 1 +
target-xtensa/translate.c | 1 +
tcg/tcg.c | 1 +
translate-all.c | 1 +
40 files changed, 98 insertions(+), 59 deletions(-)
create mode 100644 include/exec/log.h
diff --git a/bsd-user/main.c b/bsd-user/main.c
index adf2de0..520ce99 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -33,6 +33,7 @@
#include "tcg.h"
#include "qemu/timer.h"
#include "qemu/envlist.h"
+#include "exec/log.h"
int singlestep;
unsigned long mmap_min_addr;
diff --git a/cpu-exec.c b/cpu-exec.c
index c88d0ff..8e2e52b 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -27,6 +27,7 @@
#include "exec/address-spaces.h"
#include "qemu/rcu.h"
#include "exec/tb-hash.h"
+#include "exec/log.h"
#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
#include "hw/i386/apic.h"
#endif
diff --git a/exec.c b/exec.c
index a028961..dec6691 100644
--- a/exec.c
+++ b/exec.c
@@ -54,6 +54,7 @@
#include "exec/memory-internal.h"
#include "exec/ram_addr.h"
+#include "exec/log.h"
#include "qemu/range.h"
#ifndef _WIN32
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index f5b9972..16bacfc 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -11,6 +11,7 @@
*/
#include "hw/hw.h"
#include "hw/acpi/cpu_hotplug.h"
+#include "qom/cpu.h"
static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)
{
diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
index dd4aae8..b38c76a 100644
--- a/hw/timer/a9gtimer.c
+++ b/hw/timer/a9gtimer.c
@@ -24,6 +24,7 @@
#include "qemu/timer.h"
#include "qemu/bitops.h"
#include "qemu/log.h"
+#include "qom/cpu.h"
#ifndef A9_GTIMER_ERR_DEBUG
#define A9_GTIMER_ERR_DEBUG 0
diff --git a/include/exec/log.h b/include/exec/log.h
new file mode 100644
index 0000000..ba1c9b5
--- /dev/null
+++ b/include/exec/log.h
@@ -0,0 +1,60 @@
+#ifndef QEMU_EXEC_LOG_H
+#define QEMU_EXEC_LOG_H
+
+#include "qemu/log.h"
+#include "qom/cpu.h"
+#include "disas/disas.h"
+
+/* cpu_dump_state() logging functions: */
+/**
+ * log_cpu_state:
+ * @cpu: The CPU whose state is to be logged.
+ * @flags: Flags what to log.
+ *
+ * Logs the output of cpu_dump_state().
+ */
+static inline void log_cpu_state(CPUState *cpu, int flags)
+{
+ if (qemu_log_enabled()) {
+ cpu_dump_state(cpu, qemu_logfile, fprintf, flags);
+ }
+}
+
+/**
+ * log_cpu_state_mask:
+ * @mask: Mask when to log.
+ * @cpu: The CPU whose state is to be logged.
+ * @flags: Flags what to log.
+ *
+ * Logs the output of cpu_dump_state() if loglevel includes @mask.
+ */
+static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
+{
+ if (qemu_loglevel & mask) {
+ log_cpu_state(cpu, flags);
+ }
+}
+
+#ifdef NEED_CPU_H
+/* disas() and target_disas() to qemu_logfile: */
+static inline void log_target_disas(CPUState *cpu, target_ulong start,
+ target_ulong len, int flags)
+{
+ target_disas(qemu_logfile, cpu, start, len, flags);
+}
+
+static inline void log_disas(void *code, unsigned long size)
+{
+ disas(qemu_logfile, code, size);
+}
+
+#if defined(CONFIG_USER_ONLY)
+/* page_dump() output to the log file: */
+static inline void log_page_dump(void)
+{
+ page_dump(qemu_logfile);
+}
+#endif
+#endif
+
+#endif
diff --git a/include/qemu/log.h b/include/qemu/log.h
index 362cbc4..0fcdba9 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -5,10 +5,6 @@
#include <stdbool.h>
#include <stdio.h>
#include "qemu/compiler.h"
-#include "qom/cpu.h"
-#ifdef NEED_CPU_H
-#include "disas/disas.h"
-#endif
/* Private global variables, don't use */
extern FILE *qemu_logfile;
@@ -70,61 +66,6 @@ qemu_log_vprintf(const char *fmt, va_list va)
void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...);
-/* Special cases: */
-
-/* cpu_dump_state() logging functions: */
-/**
- * log_cpu_state:
- * @cpu: The CPU whose state is to be logged.
- * @flags: Flags what to log.
- *
- * Logs the output of cpu_dump_state().
- */
-static inline void log_cpu_state(CPUState *cpu, int flags)
-{
- if (qemu_log_enabled()) {
- cpu_dump_state(cpu, qemu_logfile, fprintf, flags);
- }
-}
-
-/**
- * log_cpu_state_mask:
- * @mask: Mask when to log.
- * @cpu: The CPU whose state is to be logged.
- * @flags: Flags what to log.
- *
- * Logs the output of cpu_dump_state() if loglevel includes @mask.
- */
-static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags)
-{
- if (qemu_loglevel & mask) {
- log_cpu_state(cpu, flags);
- }
-}
-
-#ifdef NEED_CPU_H
-/* disas() and target_disas() to qemu_logfile: */
-static inline void log_target_disas(CPUState *cpu, target_ulong start,
- target_ulong len, int flags)
-{
- target_disas(qemu_logfile, cpu, start, len, flags);
-}
-
-static inline void log_disas(void *code, unsigned long size)
-{
- disas(qemu_logfile, code, size);
-}
-
-#if defined(CONFIG_USER_ONLY)
-/* page_dump() output to the log file: */
-static inline void log_page_dump(void)
-{
- page_dump(qemu_logfile);
-}
-#endif
-#endif
-
-
/* Maintenance: */
/* fflush() the log file */
diff --git a/linux-user/main.c b/linux-user/main.c
index 8acfe0f..8430fb8 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -33,6 +33,7 @@
#include "qemu/timer.h"
#include "qemu/envlist.h"
#include "elf.h"
+#include "exec/log.h"
char *exec_path;
diff --git a/qom/cpu.c b/qom/cpu.c
index fb80d13..ce7dfa2 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -23,6 +23,7 @@
#include "sysemu/kvm.h"
#include "qemu/notify.h"
#include "qemu/log.h"
+#include "exec/log.h"
#include "qemu/error-report.h"
#include "sysemu/sysemu.h"
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 9909c70..635f129 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -27,6 +27,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#undef ALPHA_DEBUG_DISAS
diff --git a/target-arm/translate.c b/target-arm/translate.c
index ff262a2..0a80871 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -36,6 +36,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define ENABLE_ARCH_4T arm_dc_feature(s, ARM_FEATURE_V4T)
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 2d710cc..954a6f5 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -34,6 +34,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define DISAS_CRIS 0
diff --git a/target-i386/seg_helper.c b/target-i386/seg_helper.c
index 20ee892..e55694f 100644
--- a/target-i386/seg_helper.c
+++ b/target-i386/seg_helper.c
@@ -22,6 +22,7 @@
#include "qemu/log.h"
#include "exec/helper-proto.h"
#include "exec/cpu_ldst.h"
+#include "exec/log.h"
//#define DEBUG_PCALL
diff --git a/target-i386/smm_helper.c b/target-i386/smm_helper.c
index c272a98..1ab6637 100644
--- a/target-i386/smm_helper.c
+++ b/target-i386/smm_helper.c
@@ -19,6 +19,7 @@
#include "cpu.h"
#include "exec/helper-proto.h"
+#include "exec/log.h"
/* SMM support */
diff --git a/target-i386/translate.c b/target-i386/translate.c
index fbe4f80..6a3ab56 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -32,6 +32,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define PREFIX_REPZ 0x01
diff --git a/target-lm32/helper.c b/target-lm32/helper.c
index e26c133..978b99f 100644
--- a/target-lm32/helper.c
+++ b/target-lm32/helper.c
@@ -21,6 +21,7 @@
#include "qemu/host-utils.h"
#include "sysemu/sysemu.h"
#include "exec/semihost.h"
+#include "exec/log.h"
int lm32_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw,
int mmu_idx)
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index fa5b0b9..ad6bd20 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define DISAS_LM32 1
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 41ae2c6..03772cf 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
//#define DEBUG_DISPATCH 1
diff --git a/target-microblaze/helper.c b/target-microblaze/helper.c
index 8257b0e..ee65245 100644
--- a/target-microblaze/helper.c
+++ b/target-microblaze/helper.c
@@ -20,6 +20,7 @@
#include "cpu.h"
#include "qemu/host-utils.h"
+#include "exec/log.h"
#define D(x)
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 154b9d6..dfd6e32 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -27,6 +27,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define SIM_COMPAT 0
diff --git a/target-mips/helper.c b/target-mips/helper.c
index b3fe816..47af20b 100644
--- a/target-mips/helper.c
+++ b/target-mips/helper.c
@@ -25,6 +25,7 @@
#include "cpu.h"
#include "sysemu/kvm.h"
#include "exec/cpu_ldst.h"
+#include "exec/log.h"
enum {
TLBRET_XI = -6,
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 5626647..cfc993c 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -32,6 +32,7 @@
#include "exec/semihost.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define MIPS_DEBUG_DISAS 0
diff --git a/target-moxie/translate.c b/target-moxie/translate.c
index 6dedcb7..9e2ac47 100644
--- a/target-moxie/translate.c
+++ b/target-moxie/translate.c
@@ -35,6 +35,7 @@
#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
+#include "exec/log.h"
/* This is the state at translation time. */
typedef struct DisasContext {
diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c
index 606490a..b572eee 100644
--- a/target-openrisc/translate.c
+++ b/target-openrisc/translate.c
@@ -32,6 +32,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define OPENRISC_DISAS
diff --git a/target-ppc/mmu-hash32.c b/target-ppc/mmu-hash32.c
index dfee358..6453856 100644
--- a/target-ppc/mmu-hash32.c
+++ b/target-ppc/mmu-hash32.c
@@ -23,6 +23,7 @@
#include "sysemu/kvm.h"
#include "kvm_ppc.h"
#include "mmu-hash32.h"
+#include "exec/log.h"
//#define DEBUG_MMU
//#define DEBUG_BAT
diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c
index 7df6ede..73edde6 100644
--- a/target-ppc/mmu-hash64.c
+++ b/target-ppc/mmu-hash64.c
@@ -22,6 +22,7 @@
#include "sysemu/kvm.h"
#include "kvm_ppc.h"
#include "mmu-hash64.h"
+#include "exec/log.h"
//#define DEBUG_MMU
//#define DEBUG_SLB
diff --git a/target-ppc/mmu_helper.c b/target-ppc/mmu_helper.c
index e52d0e5..b4fea22 100644
--- a/target-ppc/mmu_helper.c
+++ b/target-ppc/mmu_helper.c
@@ -23,6 +23,7 @@
#include "mmu-hash64.h"
#include "mmu-hash32.h"
#include "exec/cpu_ldst.h"
+#include "exec/log.h"
//#define DEBUG_MMU
//#define DEBUG_BATS
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 308ad68..3078f88 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define CPU_SINGLE_STEP 0x1
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index c79a2cb..4c69ee3 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -43,6 +43,7 @@ static TCGv_ptr cpu_env;
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
/* Information that (most) every instruction needs to manipulate. */
diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index eaececd..90b4405 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -23,6 +23,7 @@
#include <inttypes.h>
#include "cpu.h"
+#include "exec/log.h"
#if !defined(CONFIG_USER_ONLY)
#include "hw/sh4/sh_intc.h"
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 7bc6216..b07904d 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -28,6 +28,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
typedef struct DisasContext {
diff --git a/target-sparc/int32_helper.c b/target-sparc/int32_helper.c
index 7c380ba..ac5e599 100644
--- a/target-sparc/int32_helper.c
+++ b/target-sparc/int32_helper.c
@@ -20,6 +20,7 @@
#include "cpu.h"
#include "trace.h"
#include "sysemu/sysemu.h"
+#include "exec/log.h"
#define DEBUG_PCALL
diff --git a/target-sparc/int64_helper.c b/target-sparc/int64_helper.c
index b02d22b..a753151 100644
--- a/target-sparc/int64_helper.c
+++ b/target-sparc/int64_helper.c
@@ -19,6 +19,7 @@
#include "cpu.h"
#include "exec/helper-proto.h"
+#include "exec/log.h"
#include "trace.h"
#define DEBUG_PCALL
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 41a3319..d484f1e 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -33,6 +33,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
#define DEBUG_DISAS
diff --git a/target-tilegx/translate.c b/target-tilegx/translate.c
index 354f25a..78befe8 100644
--- a/target-tilegx/translate.c
+++ b/target-tilegx/translate.c
@@ -20,6 +20,7 @@
#include "cpu.h"
#include "qemu/log.h"
+#include "exec/log.h"
#include "disas/disas.h"
#include "tcg-op.h"
#include "exec/cpu_ldst.h"
diff --git a/target-tricore/translate.c b/target-tricore/translate.c
index 135c583..1d29ea1 100644
--- a/target-tricore/translate.c
+++ b/target-tricore/translate.c
@@ -27,6 +27,7 @@
#include "exec/helper-gen.h"
#include "tricore-opcodes.h"
+#include "exec/log.h"
/*
* TCG registers
diff --git a/target-unicore32/translate.c b/target-unicore32/translate.c
index d2f92f0..8e9e434 100644
--- a/target-unicore32/translate.c
+++ b/target-unicore32/translate.c
@@ -24,6 +24,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
/* internal defines */
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 06b0163..f7ce238 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -43,6 +43,7 @@
#include "exec/helper-gen.h"
#include "trace-tcg.h"
+#include "exec/log.h"
typedef struct DisasContext {
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 682af8a..d614751 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -60,6 +60,7 @@
#endif
#include "elf.h"
+#include "exec/log.h"
/* Forward declarations for functions declared in tcg-target.c and used here. */
static void tcg_target_init(TCGContext *s);
diff --git a/translate-all.c b/translate-all.c
index a940bd2..bbf1b86 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -62,6 +62,7 @@
#include "translate-all.h"
#include "qemu/bitmap.h"
#include "qemu/timer.h"
+#include "exec/log.h"
//#define DEBUG_TB_INVALIDATE
//#define DEBUG_FLUSH
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 12/15] log: move qemu-log.c into util/ directory
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (10 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 11/15] log: do not unnecessarily include qom/cpu.h Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log Stefan Hajnoczi
` (3 subsequent siblings)
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Paolo Bonzini, Stefan Hajnoczi, Denis V. Lunev
From: "Denis V. Lunev" <den@openvz.org>
log will become common facility with tracepoints support in next step.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1446151457-21157-9-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
Makefile.objs | 1 -
qemu-log.c | 177 -----------------------------------------------------
util/Makefile.objs | 1 +
util/log.c | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 178 insertions(+), 178 deletions(-)
delete mode 100644 qemu-log.c
create mode 100644 util/log.c
diff --git a/Makefile.objs b/Makefile.objs
index 77be052..61d2798 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -83,7 +83,6 @@ endif
#######################################################################
# Target-independent parts used in system and user emulation
-common-obj-y += qemu-log.o
common-obj-y += tcg-runtime.o
common-obj-y += hw/
common-obj-y += qom/
diff --git a/qemu-log.c b/qemu-log.c
deleted file mode 100644
index 7cb01a8..0000000
--- a/qemu-log.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Logging support
- *
- * Copyright (c) 2003 Fabrice Bellard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "qemu-common.h"
-#include "qemu/log.h"
-
-static char *logfilename;
-FILE *qemu_logfile;
-int qemu_loglevel;
-static int log_append = 0;
-
-void qemu_log(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- if (qemu_logfile) {
- vfprintf(qemu_logfile, fmt, ap);
- }
- va_end(ap);
-}
-
-void qemu_log_mask(int mask, const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- if ((qemu_loglevel & mask) && qemu_logfile) {
- vfprintf(qemu_logfile, fmt, ap);
- }
- va_end(ap);
-}
-
-/* enable or disable low levels log */
-void do_qemu_set_log(int log_flags, bool use_own_buffers)
-{
- qemu_loglevel = log_flags;
- if (qemu_loglevel && !qemu_logfile) {
- if (logfilename) {
- qemu_logfile = fopen(logfilename, log_append ? "a" : "w");
- if (!qemu_logfile) {
- perror(logfilename);
- _exit(1);
- }
- } else {
- /* Default to stderr if no log file specified */
- qemu_logfile = stderr;
- }
- /* must avoid mmap() usage of glibc by setting a buffer "by hand" */
- if (use_own_buffers) {
- static char logfile_buf[4096];
-
- setvbuf(qemu_logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));
- } else {
-#if defined(_WIN32)
- /* Win32 doesn't support line-buffering, so use unbuffered output. */
- setvbuf(qemu_logfile, NULL, _IONBF, 0);
-#else
- setvbuf(qemu_logfile, NULL, _IOLBF, 0);
-#endif
- log_append = 1;
- }
- }
- if (!qemu_loglevel && qemu_logfile) {
- qemu_log_close();
- }
-}
-
-void qemu_set_log_filename(const char *filename)
-{
- g_free(logfilename);
- logfilename = g_strdup(filename);
- qemu_log_close();
- qemu_set_log(qemu_loglevel);
-}
-
-const QEMULogItem qemu_log_items[] = {
- { CPU_LOG_TB_OUT_ASM, "out_asm",
- "show generated host assembly code for each compiled TB" },
- { CPU_LOG_TB_IN_ASM, "in_asm",
- "show target assembly code for each compiled TB" },
- { CPU_LOG_TB_OP, "op",
- "show micro ops for each compiled TB" },
- { CPU_LOG_TB_OP_OPT, "op_opt",
- "show micro ops (x86 only: before eflags optimization) and\n"
- "after liveness analysis" },
- { CPU_LOG_INT, "int",
- "show interrupts/exceptions in short format" },
- { CPU_LOG_EXEC, "exec",
- "show trace before each executed TB (lots of logs)" },
- { CPU_LOG_TB_CPU, "cpu",
- "show CPU state before block translation" },
- { CPU_LOG_MMU, "mmu",
- "log MMU-related activities" },
- { CPU_LOG_PCALL, "pcall",
- "x86 only: show protected mode far calls/returns/exceptions" },
- { CPU_LOG_RESET, "cpu_reset",
- "show CPU state before CPU resets" },
- { LOG_UNIMP, "unimp",
- "log unimplemented functionality" },
- { LOG_GUEST_ERROR, "guest_errors",
- "log when the guest OS does something invalid (eg accessing a\n"
- "non-existent register)" },
- { CPU_LOG_TB_NOCHAIN, "nochain",
- "do not chain compiled TBs so that \"exec\" and \"cpu\" show\n"
- "complete traces" },
- { 0, NULL, NULL },
-};
-
-static int cmp1(const char *s1, int n, const char *s2)
-{
- if (strlen(s2) != n) {
- return 0;
- }
- return memcmp(s1, s2, n) == 0;
-}
-
-/* takes a comma separated list of log masks. Return 0 if error. */
-int qemu_str_to_log_mask(const char *str)
-{
- const QEMULogItem *item;
- int mask;
- const char *p, *p1;
-
- p = str;
- mask = 0;
- for (;;) {
- p1 = strchr(p, ',');
- if (!p1) {
- p1 = p + strlen(p);
- }
- if (cmp1(p,p1-p,"all")) {
- for (item = qemu_log_items; item->mask != 0; item++) {
- mask |= item->mask;
- }
- } else {
- for (item = qemu_log_items; item->mask != 0; item++) {
- if (cmp1(p, p1 - p, item->name)) {
- goto found;
- }
- }
- return 0;
- }
- found:
- mask |= item->mask;
- if (*p1 != ',') {
- break;
- }
- p = p1 + 1;
- }
- return mask;
-}
-
-void qemu_print_log_usage(FILE *f)
-{
- const QEMULogItem *item;
- fprintf(f, "Log items (comma separated):\n");
- for (item = qemu_log_items; item->mask != 0; item++) {
- fprintf(f, "%-10s %s\n", item->name, item->help);
- }
-}
diff --git a/util/Makefile.objs b/util/Makefile.objs
index d7cc399..a11915c 100644
--- a/util/Makefile.objs
+++ b/util/Makefile.objs
@@ -29,3 +29,4 @@ util-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
util-obj-y += qemu-coroutine-sleep.o
util-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
util-obj-y += buffer.o
+util-obj-y += log.o
diff --git a/util/log.c b/util/log.c
new file mode 100644
index 0000000..7cb01a8
--- /dev/null
+++ b/util/log.c
@@ -0,0 +1,177 @@
+/*
+ * Logging support
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu-common.h"
+#include "qemu/log.h"
+
+static char *logfilename;
+FILE *qemu_logfile;
+int qemu_loglevel;
+static int log_append = 0;
+
+void qemu_log(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ if (qemu_logfile) {
+ vfprintf(qemu_logfile, fmt, ap);
+ }
+ va_end(ap);
+}
+
+void qemu_log_mask(int mask, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ if ((qemu_loglevel & mask) && qemu_logfile) {
+ vfprintf(qemu_logfile, fmt, ap);
+ }
+ va_end(ap);
+}
+
+/* enable or disable low levels log */
+void do_qemu_set_log(int log_flags, bool use_own_buffers)
+{
+ qemu_loglevel = log_flags;
+ if (qemu_loglevel && !qemu_logfile) {
+ if (logfilename) {
+ qemu_logfile = fopen(logfilename, log_append ? "a" : "w");
+ if (!qemu_logfile) {
+ perror(logfilename);
+ _exit(1);
+ }
+ } else {
+ /* Default to stderr if no log file specified */
+ qemu_logfile = stderr;
+ }
+ /* must avoid mmap() usage of glibc by setting a buffer "by hand" */
+ if (use_own_buffers) {
+ static char logfile_buf[4096];
+
+ setvbuf(qemu_logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));
+ } else {
+#if defined(_WIN32)
+ /* Win32 doesn't support line-buffering, so use unbuffered output. */
+ setvbuf(qemu_logfile, NULL, _IONBF, 0);
+#else
+ setvbuf(qemu_logfile, NULL, _IOLBF, 0);
+#endif
+ log_append = 1;
+ }
+ }
+ if (!qemu_loglevel && qemu_logfile) {
+ qemu_log_close();
+ }
+}
+
+void qemu_set_log_filename(const char *filename)
+{
+ g_free(logfilename);
+ logfilename = g_strdup(filename);
+ qemu_log_close();
+ qemu_set_log(qemu_loglevel);
+}
+
+const QEMULogItem qemu_log_items[] = {
+ { CPU_LOG_TB_OUT_ASM, "out_asm",
+ "show generated host assembly code for each compiled TB" },
+ { CPU_LOG_TB_IN_ASM, "in_asm",
+ "show target assembly code for each compiled TB" },
+ { CPU_LOG_TB_OP, "op",
+ "show micro ops for each compiled TB" },
+ { CPU_LOG_TB_OP_OPT, "op_opt",
+ "show micro ops (x86 only: before eflags optimization) and\n"
+ "after liveness analysis" },
+ { CPU_LOG_INT, "int",
+ "show interrupts/exceptions in short format" },
+ { CPU_LOG_EXEC, "exec",
+ "show trace before each executed TB (lots of logs)" },
+ { CPU_LOG_TB_CPU, "cpu",
+ "show CPU state before block translation" },
+ { CPU_LOG_MMU, "mmu",
+ "log MMU-related activities" },
+ { CPU_LOG_PCALL, "pcall",
+ "x86 only: show protected mode far calls/returns/exceptions" },
+ { CPU_LOG_RESET, "cpu_reset",
+ "show CPU state before CPU resets" },
+ { LOG_UNIMP, "unimp",
+ "log unimplemented functionality" },
+ { LOG_GUEST_ERROR, "guest_errors",
+ "log when the guest OS does something invalid (eg accessing a\n"
+ "non-existent register)" },
+ { CPU_LOG_TB_NOCHAIN, "nochain",
+ "do not chain compiled TBs so that \"exec\" and \"cpu\" show\n"
+ "complete traces" },
+ { 0, NULL, NULL },
+};
+
+static int cmp1(const char *s1, int n, const char *s2)
+{
+ if (strlen(s2) != n) {
+ return 0;
+ }
+ return memcmp(s1, s2, n) == 0;
+}
+
+/* takes a comma separated list of log masks. Return 0 if error. */
+int qemu_str_to_log_mask(const char *str)
+{
+ const QEMULogItem *item;
+ int mask;
+ const char *p, *p1;
+
+ p = str;
+ mask = 0;
+ for (;;) {
+ p1 = strchr(p, ',');
+ if (!p1) {
+ p1 = p + strlen(p);
+ }
+ if (cmp1(p,p1-p,"all")) {
+ for (item = qemu_log_items; item->mask != 0; item++) {
+ mask |= item->mask;
+ }
+ } else {
+ for (item = qemu_log_items; item->mask != 0; item++) {
+ if (cmp1(p, p1 - p, item->name)) {
+ goto found;
+ }
+ }
+ return 0;
+ }
+ found:
+ mask |= item->mask;
+ if (*p1 != ',') {
+ break;
+ }
+ p = p1 + 1;
+ }
+ return mask;
+}
+
+void qemu_print_log_usage(FILE *f)
+{
+ const QEMULogItem *item;
+ fprintf(f, "Log items (comma separated):\n");
+ for (item = qemu_log_items; item->mask != 0; item++) {
+ fprintf(f, "%-10s %s\n", item->name, item->help);
+ }
+}
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (11 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 12/15] log: move qemu-log.c into util/ directory Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 16:56 ` Peter Maydell
2015-11-10 13:31 ` [Qemu-devel] [PULL 14/15] trace: switch default backend to "log" Stefan Hajnoczi
` (2 subsequent siblings)
15 siblings, 1 reply; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-10-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
configure | 4 ++--
include/qemu/log.h | 1 +
scripts/tracetool/backend/stderr.py | 47 -------------------------------------
trace/control.c | 10 ++++++++
util/log.c | 3 +++
vl.c | 2 ++
6 files changed, 18 insertions(+), 49 deletions(-)
delete mode 100644 scripts/tracetool/backend/stderr.py
diff --git a/configure b/configure
index 46fd8bd..6bd4edf 100755
--- a/configure
+++ b/configure
@@ -5309,8 +5309,8 @@ if have_backend "simple"; then
# Set the appropriate trace file.
trace_file="\"$trace_file-\" FMT_pid"
fi
-if have_backend "stderr"; then
- echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak
+if have_backend "log"; then
+ echo "CONFIG_TRACE_LOG=y" >> $config_host_mak
fi
if have_backend "ust"; then
echo "CONFIG_TRACE_UST=y" >> $config_host_mak
diff --git a/include/qemu/log.h b/include/qemu/log.h
index 0fcdba9..fdcfab0 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -37,6 +37,7 @@ static inline bool qemu_log_enabled(void)
#define LOG_GUEST_ERROR (1 << 11)
#define CPU_LOG_MMU (1 << 12)
#define CPU_LOG_TB_NOCHAIN (1 << 13)
+#define LOG_TRACE (1 << 14)
/* Returns true if a bit is set in the current loglevel mask
*/
diff --git a/scripts/tracetool/backend/stderr.py b/scripts/tracetool/backend/stderr.py
deleted file mode 100644
index ca58054..0000000
--- a/scripts/tracetool/backend/stderr.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Stderr built-in backend.
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
-__license__ = "GPL version 2 or (at your option) any later version"
-
-__maintainer__ = "Stefan Hajnoczi"
-__email__ = "stefanha@linux.vnet.ibm.com"
-
-
-from tracetool import out
-
-
-PUBLIC = True
-
-
-def generate_h_begin(events):
- out('#include <stdio.h>',
- '#include <sys/time.h>',
- '#include <sys/types.h>',
- '#include <unistd.h>',
- '#include "trace/control.h"',
- '')
-
-
-def generate_h(event):
- argnames = ", ".join(event.args.names())
- if len(event.args) > 0:
- argnames = ", " + argnames
-
- out(' if (trace_event_get_state(%(event_id)s)) {',
- ' struct timeval _now;',
- ' gettimeofday(&_now, NULL);',
- ' fprintf(stderr, "%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",',
- ' getpid(),',
- ' (size_t)_now.tv_sec, (size_t)_now.tv_usec',
- ' %(argnames)s);',
- ' }',
- event_id="TRACE_" + event.name.upper(),
- name=event.name,
- fmt=event.fmt.rstrip("\n"),
- argnames=argnames)
diff --git a/trace/control.c b/trace/control.c
index bef7884..84ea840 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -14,6 +14,9 @@
#ifdef CONFIG_TRACE_FTRACE
#include "trace/ftrace.h"
#endif
+#ifdef CONFIG_TRACE_LOG
+#include "qemu/log.h"
+#endif
#include "qemu/error-report.h"
int trace_events_enabled_count;
@@ -174,6 +177,13 @@ void trace_init_file(const char *file)
{
#ifdef CONFIG_TRACE_SIMPLE
st_set_trace_file(file);
+#elif defined CONFIG_TRACE_LOG
+ /* If both the simple and the log backends are enabled, "-trace file"
+ * only applies to the simple backend; use "-D" for the log backend.
+ */
+ if (file) {
+ qemu_set_log_filename(file);
+ }
#else
if (file) {
fprintf(stderr, "error: -trace file=...: "
diff --git a/util/log.c b/util/log.c
index 7cb01a8..5cc71eb 100644
--- a/util/log.c
+++ b/util/log.c
@@ -51,6 +51,9 @@ void qemu_log_mask(int mask, const char *fmt, ...)
void do_qemu_set_log(int log_flags, bool use_own_buffers)
{
qemu_loglevel = log_flags;
+#ifdef CONFIG_TRACE_LOG
+ qemu_loglevel |= LOG_TRACE;
+#endif
if (qemu_loglevel && !qemu_logfile) {
if (logfilename) {
qemu_logfile = fopen(logfilename, log_append ? "a" : "w");
diff --git a/vl.c b/vl.c
index e391e1d..8b602ea 100644
--- a/vl.c
+++ b/vl.c
@@ -4118,6 +4118,8 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
qemu_set_log(mask);
+ } else {
+ qemu_set_log(0);
}
if (!trace_init_backends()) {
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 14/15] trace: switch default backend to "log"
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (12 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 15/15] log: add "-d trace:PATTERN" Stefan Hajnoczi
2015-11-10 13:36 ` [Qemu-devel] [PULL 00/15] Tracing patches Peter Maydell
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
This enables integration with other QEMU logging facilities.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-11-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 6bd4edf..e73d94b 100755
--- a/configure
+++ b/configure
@@ -302,7 +302,7 @@ pkgversion=""
pie=""
zero_malloc=""
qom_cast_debug="yes"
-trace_backends="nop"
+trace_backends="log"
trace_file="trace"
spice=""
rbd=""
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [Qemu-devel] [PULL 15/15] log: add "-d trace:PATTERN"
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (13 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 14/15] trace: switch default backend to "log" Stefan Hajnoczi
@ 2015-11-10 13:31 ` Stefan Hajnoczi
2015-11-10 13:36 ` [Qemu-devel] [PULL 00/15] Tracing patches Peter Maydell
15 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-10 13:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Denis V. Lunev, Peter Maydell, Stefan Hajnoczi, Paolo Bonzini
From: Paolo Bonzini <pbonzini@redhat.com>
This is a bit easier to use than "-trace" if you are also enabling
other kinds of logging. It is also more discoverable for experienced
QEMU users, and accessible from user-mode emulators.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 1446151457-21157-12-git-send-email-den@openvz.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
util/log.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/util/log.c b/util/log.c
index 5cc71eb..c5f24ce 100644
--- a/util/log.c
+++ b/util/log.c
@@ -19,6 +19,7 @@
#include "qemu-common.h"
#include "qemu/log.h"
+#include "trace/control.h"
static char *logfilename;
FILE *qemu_logfile;
@@ -152,6 +153,11 @@ int qemu_str_to_log_mask(const char *str)
for (item = qemu_log_items; item->mask != 0; item++) {
mask |= item->mask;
}
+#ifdef CONFIG_TRACE_LOG
+ } else if (strncmp(p, "trace:", 6) == 0 && p + 6 != p1) {
+ trace_enable_events(p + 6);
+ mask |= LOG_TRACE;
+#endif
} else {
for (item = qemu_log_items; item->mask != 0; item++) {
if (cmp1(p, p1 - p, item->name)) {
@@ -159,9 +165,9 @@ int qemu_str_to_log_mask(const char *str)
}
}
return 0;
+ found:
+ mask |= item->mask;
}
- found:
- mask |= item->mask;
if (*p1 != ',') {
break;
}
@@ -175,6 +181,10 @@ void qemu_print_log_usage(FILE *f)
const QEMULogItem *item;
fprintf(f, "Log items (comma separated):\n");
for (item = qemu_log_items; item->mask != 0; item++) {
- fprintf(f, "%-10s %s\n", item->name, item->help);
+ fprintf(f, "%-15s %s\n", item->name, item->help);
}
+#ifdef CONFIG_TRACE_LOG
+ fprintf(f, "trace:PATTERN enable trace events\n");
+ fprintf(f, "\nUse \"-d trace:help\" to get a list of trace events.\n\n");
+#endif
}
--
2.5.0
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 00/15] Tracing patches
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
` (14 preceding siblings ...)
2015-11-10 13:31 ` [Qemu-devel] [PULL 15/15] log: add "-d trace:PATTERN" Stefan Hajnoczi
@ 2015-11-10 13:36 ` Peter Maydell
15 siblings, 0 replies; 25+ messages in thread
From: Peter Maydell @ 2015-11-10 13:36 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: QEMU Developers
On 10 November 2015 at 13:31, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit a8b4f9585a0bf5186fca793ce2c5d754cd8ec49a:
>
> Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-11-10' into staging (2015-11-10 09:39:24 +0000)
>
> are available in the git repository at:
>
> git://github.com/stefanha/qemu.git tags/tracing-pull-request
>
> for you to fetch changes up to bd0e34e715bcc784fe732945d011cb36645d7f12:
>
> log: add "-d trace:PATTERN" (2015-11-10 13:23:09 +0000)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
Fails to build on all platforms :-(
HEAD is now at b28cb9f... Merge remote-tracking branch
'remotes/stefanha/tags/tracing-pull-request' into staging
config-host.mak is out-of-date, running configure
GEN qemu-options.def
GEN qmp-commands.h
GEN qapi-types.h
GEN qapi-visit.h
GEN qapi-event.h
GEN qmp-introspect.h
GEN trace/generated-events.h
GEN trace/generated-tracers.h
GEN trace/generated-tcg-tracers.h
GEN trace/generated-helpers-wrappers.h
GEN trace/generated-helpers.h
ERROR: invalid trace backends
Please choose supported trace backends.
make: *** [config-host.mak] Error 1
thanks
-- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log
2015-11-10 13:31 ` [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log Stefan Hajnoczi
@ 2015-11-10 16:56 ` Peter Maydell
2015-11-11 6:41 ` Stefan Hajnoczi
0 siblings, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2015-11-10 16:56 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Paolo Bonzini, QEMU Developers, Denis V. Lunev
On 10 November 2015 at 13:31, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Message-id: 1446151457-21157-10-git-send-email-den@openvz.org
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> configure | 4 ++--
> include/qemu/log.h | 1 +
> scripts/tracetool/backend/stderr.py | 47 -------------------------------------
> trace/control.c | 10 ++++++++
> util/log.c | 3 +++
> vl.c | 2 ++
> 6 files changed, 18 insertions(+), 49 deletions(-)
> delete mode 100644 scripts/tracetool/backend/stderr.py
Denis's version of the patch on this list does a rename of
stderr.py to log.py. This patch is just deleting stderr.py,
and no other patch in this pullreq creates log.py. This means
that there is no defined 'log' backend and the build barfs...
thanks
-- PMM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log
2015-11-10 16:56 ` Peter Maydell
@ 2015-11-11 6:41 ` Stefan Hajnoczi
0 siblings, 0 replies; 25+ messages in thread
From: Stefan Hajnoczi @ 2015-11-11 6:41 UTC (permalink / raw)
To: Peter Maydell
Cc: Paolo Bonzini, QEMU Developers, Stefan Hajnoczi, Denis V. Lunev
On Tue, Nov 10, 2015 at 4:56 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 10 November 2015 at 13:31, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>> From: Paolo Bonzini <pbonzini@redhat.com>
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> Message-id: 1446151457-21157-10-git-send-email-den@openvz.org
>> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>> ---
>> configure | 4 ++--
>> include/qemu/log.h | 1 +
>> scripts/tracetool/backend/stderr.py | 47 -------------------------------------
>> trace/control.c | 10 ++++++++
>> util/log.c | 3 +++
>> vl.c | 2 ++
>> 6 files changed, 18 insertions(+), 49 deletions(-)
>> delete mode 100644 scripts/tracetool/backend/stderr.py
>
> Denis's version of the patch on this list does a rename of
> stderr.py to log.py. This patch is just deleting stderr.py,
> and no other patch in this pullreq creates log.py. This means
> that there is no defined 'log' backend and the build barfs...
Thanks for figuring it out. I see now that my working tree has an
untracked log.py file!
Will send v2.
Stefan
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2015-11-11 6:41 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-10 13:31 [Qemu-devel] [PULL 00/15] Tracing patches Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 01/15] trace: fix make foo-timestamp rules Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 02/15] trace: add make dependencies on tracetool source Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 03/15] trace: count number of enabled events Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 04/15] trace: track enabled events in a separate array Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 05/15] trace: fix documentation Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 06/15] trace: split trace_init_events out of trace_init_backends Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 07/15] trace: split trace_init_file " Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 08/15] trace: no need to call trace_backend_init in different branches now Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 09/15] trace: add "-trace enable=..." Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 10/15] trace: add "-trace help" Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 11/15] log: do not unnecessarily include qom/cpu.h Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 12/15] log: move qemu-log.c into util/ directory Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 13/15] trace: convert stderr backend to log Stefan Hajnoczi
2015-11-10 16:56 ` Peter Maydell
2015-11-11 6:41 ` Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 14/15] trace: switch default backend to "log" Stefan Hajnoczi
2015-11-10 13:31 ` [Qemu-devel] [PULL 15/15] log: add "-d trace:PATTERN" Stefan Hajnoczi
2015-11-10 13:36 ` [Qemu-devel] [PULL 00/15] Tracing patches Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2011-09-01 8:06 Stefan Hajnoczi
2011-09-01 19:08 ` Anthony Liguori
2011-09-02 9:39 ` Stefan Hajnoczi
2011-09-02 14:54 ` Anthony Liguori
2011-09-02 15:00 ` Anthony Liguori
2011-09-02 15:30 ` Lluís Vilanova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).