> > ./trace.o, ./qapi/trace.o and ./util/trace.o are added into > > libqemuutil.a to avoid recursive dependencies between > > libqemuutil.a and libqemutrace.a. > > Why would libqemutrace.a depend on libqemuutil.a?
Each trace.c calls trace_event_register_group to register events, trace_event_register_group is defined in trace/control.c , which is linked into libqemuutil.a. > Tracing code shouldn't call other QEMU code. That would could create > infinite recursion when a trace event is fired. If all trace.o needed by libqemuutil.a are linked into libqemuutil.a, libqemuutil.a will not depend on libqemutrace.a. This is what this patch take to break the infinite recursion. Or we can link trace/*.o to libqemutrace.a, hope it breaks the infinite recursion. But trace/*.o may still depend on libqemuutil.a Or we can just link all trace.o to libqemuutil.a. Anthony