qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] Add support for generating a systemtap taps


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 2/2] Add support for generating a systemtap tapset static probes
Date: Mon, 8 Nov 2010 21:24:24 +0000

On Mon, Nov 8, 2010 at 11:33 AM, Daniel P. Berrange <address@hidden> wrote:
> @@ -390,6 +396,54 @@ linetod_end_dtrace()
>  EOF
>  }
>
> +linetos_begin_dtrace()
> +{
> +    return
> +}
> +
> +linetos_dtrace()
> +{
> +    local name args arglist state

Missing binary, i, and arg.

> +    name=$(get_name "$1")
> +    args=$(get_args "$1")
> +    arglist=$(get_argnames "$1", "")
> +    state=$(get_state "$1")
> +    if [ "$state" = "0" ] ; then
> +        name=${name##disable }
> +    fi
> +
> +    if [ "$target" = "i386" ]
> +    then
> +      binary="qemu"
> +    else
> +      binary="qemu-system-$target"
> +    fi

Perhaps we should just pass in the binary name to avoid hardcoding "qemu" and
"qemu-system-$target" here.  If possible, let's make SystemTap also work for
userspace targets, not just for full-system softmmu targets.

> +
> +    # Define prototype for probe arguments
> +    cat <<EOF
> +probe qemu.system.$target.$name = process("$bindir/$binary").mark("$name")
> +{
> +EOF
> +
> +    i=1
> +    for arg in $arglist
> +    do
> +        cat <<EOF
> +  $arg = \$arg$i;
> +EOF
> +       i="$((i+1))"
> +    done
> +
> +    cat <<EOF
> +}
> +EOF
> +}
> +
> +linetos_end_dtrace()
> +{
> +    return
> +}
> +
>  # Process stdin by calling begin, line, and end functions for the backend
>  convert()
>  {
> @@ -455,6 +509,24 @@ tracetod()
>     convert d
>  }
>
> +tracetos()

How about using 'stap' instead of 's' so it's clear we're not generating
assembly?

Stefan



reply via email to

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