* [Qemu-devel] [PATCH v4] New trace-event backend: stderr
@ 2011-01-27 9:24 Fabien Chouteau
2011-01-28 13:55 ` Fabien Chouteau
2011-01-29 22:53 ` Blue Swirl
0 siblings, 2 replies; 4+ messages in thread
From: Fabien Chouteau @ 2011-01-27 9:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Fabien Chouteau
This backend sends trace events to standard error output during the emulation.
Also add a "--list-backends" option to tracetool, so configure script can
display the list of available backends.
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
---
configure | 3 +-
docs/tracing.txt | 5 ++++
scripts/tracetool | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 65 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 210670c..fcc5a71 100755
--- a/configure
+++ b/configure
@@ -907,7 +907,8 @@ echo " --enable-docs enable documentation build"
echo " --disable-docs disable documentation build"
echo " --disable-vhost-net disable vhost-net acceleration support"
echo " --enable-vhost-net enable vhost-net acceleration support"
-echo " --enable-trace-backend=B Trace backend nop simple ust dtrace"
+echo " --enable-trace-backend=B Set trace backend"
+echo " Available backends:" $("$source_path"/scripts/tracetool --list-backends)
echo " --with-trace-file=NAME Full PATH,NAME of file to store traces"
echo " Default:trace-<pid>"
echo " --disable-spice disable spice"
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 963c504..21183f9 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -133,6 +133,11 @@ source tree. It may not be as powerful as platform-specific or third-party
trace backends but it is portable. This is the recommended trace backend
unless you have specific needs for more advanced backends.
+=== Stderr ===
+
+The "stderr" backend sends trace events directly to standard error output
+during emulation.
+
==== Monitor commands ====
* info trace
diff --git a/scripts/tracetool b/scripts/tracetool
index fce491c..e046683 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -13,12 +13,13 @@ set -f
usage()
{
cat >&2 <<EOF
-usage: $0 [--nop | --simple | --ust] [-h | -c]
+usage: $0 [--nop | --simple | --stderr | --ust | --dtrace] [-h | -c]
Generate tracing code for a file on stdin.
Backends:
--nop Tracing disabled
--simple Simple built-in backend
+ --stderr Stderr built-in backend
--ust LTTng User Space Tracing backend
--dtrace DTrace/SystemTAP backend
@@ -236,6 +237,56 @@ linetoc_end_simple()
EOF
}
+#STDERR
+linetoh_begin_stderr()
+{
+ cat <<EOF
+#include <stdio.h>
+EOF
+}
+
+linetoh_stderr()
+{
+ local name args argnames argc fmt
+ name=$(get_name "$1")
+ args=$(get_args "$1")
+ argnames=$(get_argnames "$1" ",")
+ argc=$(get_argc "$1")
+ fmt=$(get_fmt "$1")
+
+ if [ "$argc" -gt 0 ]; then
+ argnames=", $argnames"
+ fi
+
+ cat <<EOF
+static inline void trace_$name($args)
+{
+ fprintf(stderr, "$name $fmt\n" $argnames);
+}
+EOF
+}
+
+linetoh_end_stderr()
+{
+return
+}
+
+linetoc_begin_stderr()
+{
+return
+}
+
+linetoc_stderr()
+{
+return
+}
+
+linetoc_end_stderr()
+{
+return
+}
+#END OF STDERR
+
# Clean up after UST headers which pollute the namespace
ust_clean_namespace() {
cat <<EOF
@@ -546,7 +597,7 @@ targetarch=
until [ -z "$1" ]
do
case "$1" in
- "--nop" | "--simple" | "--ust" | "--dtrace") backend="${1#--}" ;;
+ "--nop" | "--simple" | "--stderr" | "--ust" | "--dtrace") backend="${1#--}" ;;
"--binary") shift ; binary="$1" ;;
"--target-arch") shift ; targetarch="$1" ;;
@@ -557,6 +608,11 @@ do
"--check-backend") exit 0 ;; # used by ./configure to test for backend
+ "--list-backends") # used by ./configure to list available backends
+ echo "nop simple stderr ust dtrace"
+ exit 0
+ ;;
+
*)
usage;;
esac
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v4] New trace-event backend: stderr
2011-01-27 9:24 [Qemu-devel] [PATCH v4] New trace-event backend: stderr Fabien Chouteau
@ 2011-01-28 13:55 ` Fabien Chouteau
2011-01-28 16:19 ` Stefan Hajnoczi
2011-01-29 22:53 ` Blue Swirl
1 sibling, 1 reply; 4+ messages in thread
From: Fabien Chouteau @ 2011-01-28 13:55 UTC (permalink / raw)
To: qemu-devel
On 01/27/2011 10:24 AM, Fabien Chouteau wrote:
> This backend sends trace events to standard error output during the emulation.
>
> Also add a "--list-backends" option to tracetool, so configure script can
> display the list of available backends.
>
> Signed-off-by: Fabien Chouteau<chouteau@adacore.com>
> ---
> configure | 3 +-
> docs/tracing.txt | 5 ++++
> scripts/tracetool | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 65 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 210670c..fcc5a71 100755
> --- a/configure
> +++ b/configure
> @@ -907,7 +907,8 @@ echo " --enable-docs enable documentation build"
> echo " --disable-docs disable documentation build"
> echo " --disable-vhost-net disable vhost-net acceleration support"
> echo " --enable-vhost-net enable vhost-net acceleration support"
> -echo " --enable-trace-backend=B Trace backend nop simple ust dtrace"
> +echo " --enable-trace-backend=B Set trace backend"
> +echo " Available backends:" $("$source_path"/scripts/tracetool --list-backends)
> echo " --with-trace-file=NAME Full PATH,NAME of file to store traces"
> echo " Default:trace-<pid>"
> echo " --disable-spice disable spice"
> diff --git a/docs/tracing.txt b/docs/tracing.txt
> index 963c504..21183f9 100644
> --- a/docs/tracing.txt
> +++ b/docs/tracing.txt
> @@ -133,6 +133,11 @@ source tree. It may not be as powerful as platform-specific or third-party
> trace backends but it is portable. This is the recommended trace backend
> unless you have specific needs for more advanced backends.
>
> +=== Stderr ===
> +
> +The "stderr" backend sends trace events directly to standard error output
> +during emulation.
> +
> ==== Monitor commands ====
>
> * info trace
> diff --git a/scripts/tracetool b/scripts/tracetool
> index fce491c..e046683 100755
> --- a/scripts/tracetool
> +++ b/scripts/tracetool
> @@ -13,12 +13,13 @@ set -f
> usage()
> {
> cat>&2<<EOF
> -usage: $0 [--nop | --simple | --ust] [-h | -c]
> +usage: $0 [--nop | --simple | --stderr | --ust | --dtrace] [-h | -c]
> Generate tracing code for a file on stdin.
>
> Backends:
> --nop Tracing disabled
> --simple Simple built-in backend
> + --stderr Stderr built-in backend
> --ust LTTng User Space Tracing backend
> --dtrace DTrace/SystemTAP backend
>
> @@ -236,6 +237,56 @@ linetoc_end_simple()
> EOF
> }
>
> +#STDERR
> +linetoh_begin_stderr()
> +{
> + cat<<EOF
> +#include<stdio.h>
> +EOF
> +}
> +
> +linetoh_stderr()
> +{
> + local name args argnames argc fmt
> + name=$(get_name "$1")
> + args=$(get_args "$1")
> + argnames=$(get_argnames "$1" ",")
> + argc=$(get_argc "$1")
> + fmt=$(get_fmt "$1")
> +
> + if [ "$argc" -gt 0 ]; then
> + argnames=", $argnames"
> + fi
> +
> + cat<<EOF
> +static inline void trace_$name($args)
> +{
> + fprintf(stderr, "$name $fmt\n" $argnames);
> +}
> +EOF
> +}
> +
> +linetoh_end_stderr()
> +{
> +return
> +}
> +
> +linetoc_begin_stderr()
> +{
> +return
> +}
> +
> +linetoc_stderr()
> +{
> +return
> +}
> +
> +linetoc_end_stderr()
> +{
> +return
> +}
> +#END OF STDERR
> +
> # Clean up after UST headers which pollute the namespace
> ust_clean_namespace() {
> cat<<EOF
> @@ -546,7 +597,7 @@ targetarch=
> until [ -z "$1" ]
> do
> case "$1" in
> - "--nop" | "--simple" | "--ust" | "--dtrace") backend="${1#--}" ;;
> + "--nop" | "--simple" | "--stderr" | "--ust" | "--dtrace") backend="${1#--}" ;;
>
> "--binary") shift ; binary="$1" ;;
> "--target-arch") shift ; targetarch="$1" ;;
> @@ -557,6 +608,11 @@ do
>
> "--check-backend") exit 0 ;; # used by ./configure to test for backend
>
> + "--list-backends") # used by ./configure to list available backends
> + echo "nop simple stderr ust dtrace"
> + exit 0
> + ;;
> +
> *)
> usage;;
> esac
Any comment for this version?
--
Fabien Chouteau
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v4] New trace-event backend: stderr
2011-01-28 13:55 ` Fabien Chouteau
@ 2011-01-28 16:19 ` Stefan Hajnoczi
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-01-28 16:19 UTC (permalink / raw)
To: Fabien Chouteau; +Cc: qemu-devel
On Fri, Jan 28, 2011 at 1:55 PM, Fabien Chouteau <chouteau@adacore.com> wrote:
> On 01/27/2011 10:24 AM, Fabien Chouteau wrote:
>>
>> This backend sends trace events to standard error output during the
>> emulation.
>>
>> Also add a "--list-backends" option to tracetool, so configure script can
>> display the list of available backends.
>>
>> Signed-off-by: Fabien Chouteau<chouteau@adacore.com>
>> ---
>> configure | 3 +-
>> docs/tracing.txt | 5 ++++
>> scripts/tracetool | 60
>> +++++++++++++++++++++++++++++++++++++++++++++++++++-
>> 3 files changed, 65 insertions(+), 3 deletions(-)
Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v4] New trace-event backend: stderr
2011-01-27 9:24 [Qemu-devel] [PATCH v4] New trace-event backend: stderr Fabien Chouteau
2011-01-28 13:55 ` Fabien Chouteau
@ 2011-01-29 22:53 ` Blue Swirl
1 sibling, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2011-01-29 22:53 UTC (permalink / raw)
To: Fabien Chouteau; +Cc: qemu-devel
Thanks, applied.
On Thu, Jan 27, 2011 at 9:24 AM, Fabien Chouteau <chouteau@adacore.com> wrote:
> This backend sends trace events to standard error output during the emulation.
>
> Also add a "--list-backends" option to tracetool, so configure script can
> display the list of available backends.
>
> Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
> ---
> configure | 3 +-
> docs/tracing.txt | 5 ++++
> scripts/tracetool | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 65 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 210670c..fcc5a71 100755
> --- a/configure
> +++ b/configure
> @@ -907,7 +907,8 @@ echo " --enable-docs enable documentation build"
> echo " --disable-docs disable documentation build"
> echo " --disable-vhost-net disable vhost-net acceleration support"
> echo " --enable-vhost-net enable vhost-net acceleration support"
> -echo " --enable-trace-backend=B Trace backend nop simple ust dtrace"
> +echo " --enable-trace-backend=B Set trace backend"
> +echo " Available backends:" $("$source_path"/scripts/tracetool --list-backends)
> echo " --with-trace-file=NAME Full PATH,NAME of file to store traces"
> echo " Default:trace-<pid>"
> echo " --disable-spice disable spice"
> diff --git a/docs/tracing.txt b/docs/tracing.txt
> index 963c504..21183f9 100644
> --- a/docs/tracing.txt
> +++ b/docs/tracing.txt
> @@ -133,6 +133,11 @@ source tree. It may not be as powerful as platform-specific or third-party
> trace backends but it is portable. This is the recommended trace backend
> unless you have specific needs for more advanced backends.
>
> +=== Stderr ===
> +
> +The "stderr" backend sends trace events directly to standard error output
> +during emulation.
> +
> ==== Monitor commands ====
>
> * info trace
> diff --git a/scripts/tracetool b/scripts/tracetool
> index fce491c..e046683 100755
> --- a/scripts/tracetool
> +++ b/scripts/tracetool
> @@ -13,12 +13,13 @@ set -f
> usage()
> {
> cat >&2 <<EOF
> -usage: $0 [--nop | --simple | --ust] [-h | -c]
> +usage: $0 [--nop | --simple | --stderr | --ust | --dtrace] [-h | -c]
> Generate tracing code for a file on stdin.
>
> Backends:
> --nop Tracing disabled
> --simple Simple built-in backend
> + --stderr Stderr built-in backend
> --ust LTTng User Space Tracing backend
> --dtrace DTrace/SystemTAP backend
>
> @@ -236,6 +237,56 @@ linetoc_end_simple()
> EOF
> }
>
> +#STDERR
> +linetoh_begin_stderr()
> +{
> + cat <<EOF
> +#include <stdio.h>
> +EOF
> +}
> +
> +linetoh_stderr()
> +{
> + local name args argnames argc fmt
> + name=$(get_name "$1")
> + args=$(get_args "$1")
> + argnames=$(get_argnames "$1" ",")
> + argc=$(get_argc "$1")
> + fmt=$(get_fmt "$1")
> +
> + if [ "$argc" -gt 0 ]; then
> + argnames=", $argnames"
> + fi
> +
> + cat <<EOF
> +static inline void trace_$name($args)
> +{
> + fprintf(stderr, "$name $fmt\n" $argnames);
> +}
> +EOF
> +}
> +
> +linetoh_end_stderr()
> +{
> +return
> +}
> +
> +linetoc_begin_stderr()
> +{
> +return
> +}
> +
> +linetoc_stderr()
> +{
> +return
> +}
> +
> +linetoc_end_stderr()
> +{
> +return
> +}
> +#END OF STDERR
> +
> # Clean up after UST headers which pollute the namespace
> ust_clean_namespace() {
> cat <<EOF
> @@ -546,7 +597,7 @@ targetarch=
> until [ -z "$1" ]
> do
> case "$1" in
> - "--nop" | "--simple" | "--ust" | "--dtrace") backend="${1#--}" ;;
> + "--nop" | "--simple" | "--stderr" | "--ust" | "--dtrace") backend="${1#--}" ;;
>
> "--binary") shift ; binary="$1" ;;
> "--target-arch") shift ; targetarch="$1" ;;
> @@ -557,6 +608,11 @@ do
>
> "--check-backend") exit 0 ;; # used by ./configure to test for backend
>
> + "--list-backends") # used by ./configure to list available backends
> + echo "nop simple stderr ust dtrace"
> + exit 0
> + ;;
> +
> *)
> usage;;
> esac
> --
> 1.7.1
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-29 22:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 9:24 [Qemu-devel] [PATCH v4] New trace-event backend: stderr Fabien Chouteau
2011-01-28 13:55 ` Fabien Chouteau
2011-01-28 16:19 ` Stefan Hajnoczi
2011-01-29 22:53 ` Blue Swirl
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.