Skip to contentSkip to conversation

Build failure with trace-backend=ust

Qemu-devel Harsh Bora 2 participants 2 messages Nov 14, 2011

lore
Share & tools
lore

Harsh Bora

author
#0 lore raw

Hi,
I tried to explore LTTng UST with Qemu and built ust 0.15 (with urcu 0.16 as reqd) and observed that Qemu gives compilation errors when built for trace-backend = ust. See this:

[harsh@harshbora v9fs]$ ./configure '--target-list=x86_64-softmmu' '--enable-debug' '--enable-kvm' --enable-trace-backend=ust [harsh@harshbora v9fs]$ make

  GEN   x86_64-softmmu/config-devices.mak
  GEN   config-all-devices.mak
  GEN   qemu-options.texi

[.. snip ..]

  CC    qemu-option.o
  CC    cutils.o
  CC    osdep.o

In file included from osdep.c:49:
trace.h: In function ‘__trace_ust_slavio_misc_update_irq_raise’:
trace.h:277: error: ‘void’ must be the only parameter
trace.h:277: error: expected expression before ‘)’ token
trace.h:277: error: too many arguments to function ‘(void (*)(void *))__tp_it_func’ trace.h: At top level:
trace.h:277: error: ‘void’ must be the only parameter
trace.h:277: error: ‘void’ must be the only parameter
In file included from osdep.c:49:
trace.h: In function ‘__trace_ust_slavio_misc_update_irq_lower’:
trace.h:280: error: ‘void’ must be the only parameter
trace.h:280: error: expected expression before ‘)’ token
trace.h:280: error: too many arguments to function ‘(void (*)(void *))__tp_it_func’ trace.h: At top level:
trace.h:280: error: ‘void’ must be the only parameter
trace.h:280: error: ‘void’ must be the only parameter
In file included from osdep.c:49:
trace.h: In function ‘__trace_ust_slavio_timer_mem_writel_counter_invalid’:
trace.h:352: error: ‘void’ must be the only parameter
trace.h:352: error: expected expression before ‘)’ token
trace.h:352: error: too many arguments to function ‘(void (*)(void *))__tp_it_func’

[.. snip ..]

It appears that all trace-events with void parameter and a descriptive format string (in trace-events file) are thrown back with error. I explored LTTng's ust code and found that it also has a _DECLARE_TRACEPOINT_NOARGS to be used with events with no args (void arg). I see that in qemu we only use DECLARE_TRACE as in commit 7e24e92a0615ee6be036743f2a035554d2ceac56. See below:

+linetoh_ust()
+{

+    local name args argnames
+    name=$(get_name "$1")
+    args=$(get_args "$1")
+    argnames=$(get_argnames "$1")

+
+ cat <<EOF
+DECLARE_TRACE(ust_$name, TPPROTO($args), TPARGS($argnames)); +#define trace_$name trace_ust_$name
+EOF

Do we need to put a check on args and if its void, use _DECLARE_TRACEPOINT_NOARGS instead ? Please enlighten.

regards,
Harsh

#1 lore raw
Quoted 3 lines · Harsh Bora

I tried to explore LTTng UST with Qemu and built ust 0.15 (with urcu 0.16 as reqd) and observed that Qemu gives compilation errors when built for trace-backend = ust. See this:

Hi Harsh,
UST is not a stable library interface. It has not settled down yet, there are discussions about the library API on the project's mailing list.

Therefore I'm not actively worrying about keeping it working. If you wish to send patches, please consider using <ust/version.h> to identify the version of the library you are adding support for with appropriate #ifdefs.

Hopefully they will settle on a stable API soon and we can commit permanently working patches to QEMU.

I also encourage you to keep in touch with the upstream community because they are active and friendly. Perhaps they can help you get it working.

Stefan