diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-06 10:36:41 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-07-21 10:27:35 -0600 |
commit | 03ebc20de3b30fca5230a4c73cf4494b0d8d8d08 (patch) | |
tree | 8c87352b4d0b4605df1765b3964aff2d2e0c42c5 /tools/binman/etype/blob.py | |
parent | c31d0cb68c1c29f210ab44803f5e5fdcdcfa250b (diff) |
binman: Add basic support for debugging performance
One of binman's attributes is that it is extremely fast, at least for a
Python program. Add some simple timing around operations that might take
a while, such as reading an image and compressing it. This should help
to maintain the performance as new features are added.
This is for debugging purposes only.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype/blob.py')
-rw-r--r-- | tools/binman/etype/blob.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py index 018f8c9a31..fae86ca3ec 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -6,6 +6,7 @@ # from binman.entry import Entry +from binman import state from dtoc import fdt_util from patman import tools from patman import tout @@ -59,8 +60,12 @@ class Entry_blob(Entry): the data in chunks and avoid reading it all at once. For now this seems like an unnecessary complication. """ + state.TimingStart('read') indata = tools.ReadFile(self._pathname) + state.TimingAccum('read') + state.TimingStart('compress') data = self.CompressData(indata) + state.TimingAccum('compress') self.SetContents(data) return True |