| 
									
										
										
										
											2012-04-03 20:48:06 +02:00
										 |  |  | #!/usr/bin/env python | 
					
						
							|  |  |  | # -*- coding: utf-8 -*- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | LTTng User Space Tracing backend. | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | __author__     = "Lluís Vilanova <vilanova@ac.upc.edu>" | 
					
						
							| 
									
										
										
										
											2016-07-11 12:53:46 +02:00
										 |  |  | __copyright__  = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>" | 
					
						
							| 
									
										
										
										
											2012-04-03 20:48:06 +02:00
										 |  |  | __license__    = "GPL version 2 or (at your option) any later version" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | __maintainer__ = "Stefan Hajnoczi" | 
					
						
							|  |  |  | __email__      = "stefanha@linux.vnet.ibm.com" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | from tracetool import out | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-05 14:47:26 +01:00
										 |  |  | PUBLIC = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-29 22:47:55 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-04 14:35:59 +01:00
										 |  |  | def generate_h_begin(events, group): | 
					
						
							| 
									
										
										
										
											2017-01-25 16:14:15 +00:00
										 |  |  |     if group == "root": | 
					
						
							|  |  |  |         header = "trace-ust-root.h" | 
					
						
							|  |  |  |     else: | 
					
						
							|  |  |  |         header = "trace-ust.h" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-29 22:47:55 -05:00
										 |  |  |     out('#include <lttng/tracepoint.h>', | 
					
						
							| 
									
										
										
										
											2017-01-25 16:14:15 +00:00
										 |  |  |         '#include "%s"' % header, | 
					
						
							| 
									
										
										
										
											2014-01-29 22:47:55 -05:00
										 |  |  |         '') | 
					
						
							| 
									
										
										
										
											2012-04-03 20:48:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-29 22:47:55 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-04 14:35:59 +01:00
										 |  |  | def generate_h(event, group): | 
					
						
							| 
									
										
										
										
											2014-02-23 20:37:40 +01:00
										 |  |  |     argnames = ", ".join(event.args.names()) | 
					
						
							|  |  |  |     if len(event.args) > 0: | 
					
						
							|  |  |  |         argnames = ", " + argnames | 
					
						
							| 
									
										
										
										
											2014-01-29 22:47:55 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-11 12:53:46 +02:00
										 |  |  |     out('        tracepoint(qemu, %(name)s%(tp_args)s);', | 
					
						
							| 
									
										
										
										
											2014-02-23 20:37:40 +01:00
										 |  |  |         name=event.name, | 
					
						
							|  |  |  |         tp_args=argnames) |