Lines Matching +full:event +full:- +full:name
1 # -*- coding: utf-8 -*-
4 Machinery for generating tracing-related intermediate files.
8 __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>"
91 def validate_type(name): argument
92 bits = name.split(" ")
104 "declared as 'void *'" % name)
107 """Event arguments description."""
112 ----------
114 List of (type, name) tuples or Arguments objects.
132 ----------
134 String describing the event arguments.
162 """Iterate over the (type, name) pairs."""
182 return [ name for _, name in self._args ]
190 return ["(%s)%s" % (type_, name) for type_, name in self._args]
193 class Event(object): class
194 """Event description.
197 ----------
198 name : str
199 The event name.
201 The event format string.
203 Properties of the event.
205 The event arguments.
214 r"(?P<name>\w+)"
222 def __init__(self, name, props, fmt, args, lineno, filename, orig=None, argument
226 ----------
227 name : string
228 Event name.
232 Event printing format string(s).
234 Event arguments.
239 orig : Event or None
240 Original Event before transformation/generation.
241 event_trans : Event or None
242 Generated translation-time event ("tcg" property).
243 event_exec : Event or None
244 Generated execution-time event ("tcg" property).
247 self.name = name
257 raise ValueError("Event '%s' has more than maximum permitted "
258 "argument count" % name)
265 unknown_props = set(self.properties) - self._VALID_PROPS
273 return Event(self.name, list(self.properties), self.fmt,
279 """Build an Event instance from a string.
282 ----------
284 Line describing the event.
290 m = Event._CRE.match(line_str)
294 name = groups["name"]
298 if fmt.find("%m") != -1 or fmt_trans.find("%m") != -1:
299 raise ValueError("Event format '%m' is forbidden, pass the error "
302 raise ValueError("Event format must not end with a newline "
305 raise ValueError("Event format must not use new line character")
311 return Event(name, props, fmt, args, lineno, filename)
319 return "Event('%s %s(%s) %s')" % (" ".join(self.properties),
320 self.name,
324 # arguments with that format, hence the non-greedy version of it.
332 QEMU_TRACE = "trace_%(name)s"
335 QEMU_DSTATE = "_TRACE_%(NAME)s_DSTATE"
336 QEMU_BACKEND_DSTATE = "TRACE_%(NAME)s_BACKEND_DSTATE"
337 QEMU_EVENT = "_TRACE_%(NAME)s_EVENT"
341 fmt = Event.QEMU_TRACE
342 return fmt % {"name": self.name, "NAME": self.name.upper()}
349 ----------
351 Event description file.
353 Name of event file
355 Returns a list of Event objects
360 if line[-1] != '\n':
368 event = Event.build(line, lineno, fname)
374 events.append(event)
388 ----------
390 Module name.
392 Name of an attribute in the module.
397 -------
415 ----------
417 list of Event objects to generate for
419 Name of the tracing group
421 Output format name.