trace-control.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Interface for configuring and controlling the state of tracing events.
  3. *
  4. * Copyright (C) 2014-2016 Lluís Vilanova <vilanova@ac.upc.edu>
  5. *
  6. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  7. * See the COPYING file in the top-level directory.
  8. */
  9. #include "qemu/osdep.h"
  10. #include "trace/control.h"
  11. void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state)
  12. {
  13. trace_event_set_state_dynamic(ev, state);
  14. }
  15. void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
  16. {
  17. bool state_pre;
  18. assert(trace_event_get_state_static(ev));
  19. /*
  20. * We ignore the "vcpu" property here, since there's no target code. Then
  21. * dstate can only be 1 or 0.
  22. */
  23. state_pre = *(ev->dstate);
  24. if (state_pre != state) {
  25. if (state) {
  26. trace_events_enabled_count++;
  27. *(ev->dstate) = 1;
  28. } else {
  29. trace_events_enabled_count--;
  30. *(ev->dstate) = 0;
  31. }
  32. }
  33. }
  34. void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
  35. TraceEvent *ev, bool state)
  36. {
  37. /* should never be called on non-target binaries */
  38. abort();
  39. }
  40. void trace_init_vcpu(CPUState *vcpu)
  41. {
  42. /* should never be called on non-target binaries */
  43. abort();
  44. }