diff options
author | Matti Hamalainen <ccr@tnsp.org> | 2021-04-21 17:12:26 +0300 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-05-07 15:48:03 +0000 |
commit | 7ef828b56322d584dc70c384b9865ea8c8a3ed81 (patch) | |
tree | a265660ead980c0ee891275c00d601bd524bd320 /src/gallium/tools/trace/model.py | |
parent | 0112e3c7eacab09159f1a950648bd425dfb44f9b (diff) |
gallium/tools: implement "high-level" overview mode option in dump scripts
As per the suggestion in #4609, implement mode/option -M/--method-only
which only prints call method names, for quick overview of what is
happening in the trace. The same option can be used with both
dump.py and tracediff.sh.
Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
Diffstat (limited to 'src/gallium/tools/trace/model.py')
-rwxr-xr-x | src/gallium/tools/trace/model.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/gallium/tools/trace/model.py b/src/gallium/tools/trace/model.py index 6a338b53012..aedad1218f4 100755 --- a/src/gallium/tools/trace/model.py +++ b/src/gallium/tools/trace/model.py @@ -228,22 +228,26 @@ class PrettyPrinter: def visit_call(self, node): if not self.options.suppress_variants: self.formatter.text('%s ' % node.no) + if node.klass is not None: self.formatter.function(node.klass + '::' + node.method) else: self.formatter.function(node.method) - self.formatter.text('(') - sep = '' - for name, value in node.args: - self.formatter.text(sep) - self.formatter.variable(name) - self.formatter.text(' = ') - value.visit(self) - sep = ', ' - self.formatter.text(')') - if node.ret is not None: - self.formatter.text(' = ') - node.ret.visit(self) + + if not self.options.method_only: + self.formatter.text('(') + sep = '' + for name, value in node.args: + self.formatter.text(sep) + self.formatter.variable(name) + self.formatter.text(' = ') + value.visit(self) + sep = ', ' + self.formatter.text(')') + if node.ret is not None: + self.formatter.text(' = ') + node.ret.visit(self) + if not self.options.suppress_variants and node.time is not None: self.formatter.text(' // time ') node.time.visit(self) |