2
0

ust.py 800 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. LTTng User Space Tracing backend.
  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. PUBLIC = True
  13. def generate_h_begin(events):
  14. out('#include <lttng/tracepoint.h>',
  15. '#include "trace/generated-ust-provider.h"',
  16. '')
  17. def generate_h(event):
  18. argnames = ", ".join(event.args.names())
  19. if len(event.args) > 0:
  20. argnames = ", " + argnames
  21. out(' tracepoint(qemu, %(name)s%(tp_args)s);',
  22. name=event.name,
  23. tp_args=argnames)