h.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. trace/generated-tracers.h
  5. """
  6. __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
  7. __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
  8. __license__ = "GPL version 2 or (at your option) any later version"
  9. __maintainer__ = "Stefan Hajnoczi"
  10. __email__ = "stefanha@linux.vnet.ibm.com"
  11. from tracetool import out
  12. def generate(events, backend):
  13. out('/* This file is autogenerated by tracetool, do not edit. */',
  14. '',
  15. '#ifndef TRACE__GENERATED_TRACERS_H',
  16. '#define TRACE__GENERATED_TRACERS_H',
  17. '',
  18. '#include "qemu-common.h"',
  19. '')
  20. backend.generate_begin(events)
  21. for e in events:
  22. out('',
  23. 'static inline void %(api)s(%(args)s)',
  24. '{',
  25. api=e.api(),
  26. args=e.args)
  27. if "disable" not in e.properties:
  28. backend.generate(e)
  29. out('}')
  30. backend.generate_end(events)
  31. out('#endif /* TRACE__GENERATED_TRACERS_H */')