*** midnight <midnight!~midnight@user/midnight> has quit IRC | 06:34 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 07:53 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.54.8> has joined #libre-soc | 07:53 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.54.8> has quit IRC | 08:03 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 10:29 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 11:11 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 11:12 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 11:42 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 11:43 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 11:50 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 11:50 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 12:10 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.41.15> has joined #libre-soc | 12:10 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@176.59.41.15> has quit IRC | 12:39 | |
*** ghostmansd[m] <ghostmansd[m]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 12:39 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 12:42 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 12:56 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 12:57 | |
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 14:54 | |
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 14:54 | |
*** ghostmansd <ghostmansd!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 14:57 | |
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 14:58 | |
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 15:26 | |
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 15:30 | |
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 15:36 | |
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 15:40 | |
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 16:14 | |
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 16:18 | |
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 16:29 | |
*** ghostmansd[hexch <ghostmansd[hexch!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 16:33 | |
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has quit IRC | 18:36 | |
*** ghostmansd[pc] <ghostmansd[pc]!~ghostmans@broadband-109-173-83-100.ip.moscow.rt.ru> has joined #libre-soc | 18:36 | |
ghostmansd[pc] | That's me again with execute_one. | 19:56 |
---|---|---|
ghostmansd[pc] | I read your comments folks. | 19:57 |
ghostmansd[pc] | But still cannot get. We start with an empty insnlog created inside execute_one. | 19:57 |
ghostmansd[pc] | https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/caller.py;h=da25bd1e4caa46cbbdb3726a3956727ca58c4b81;hb=refs/heads/master#l1708 | 19:59 |
ghostmansd[pc] | https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/decoder/isa/caller.py;h=da25bd1e4caa46cbbdb3726a3956727ca58c4b81;hb=refs/heads/master#l1751 | 19:59 |
ghostmansd[pc] | From my point of view, user of ISACaller class must pass trace file (path or writable stream, preferably the latter) upon ISACaller instantiation. | 19:59 |
ghostmansd[pc] | And all execute_one() invocations should simply populate this file. | 20:00 |
ghostmansd[pc] | It seems that we never use ISACaller directly, only via ISA class, which inherits from ISACaller (and also from couple of other classes). | 20:00 |
ghostmansd[pc] | For me `insnlog=[]` and `open(..., "a+")` are mutually exclusive. | 20:02 |
ghostmansd[pc] | Sorry, meant `self.insnlog`. If it was simply `insnlog`, I'd have considered it a temporary variable. | 20:02 |
ghostmansd[pc] | From my point of view, we should extend ISACaller.__init__ with `tracefile` argument, and then, whenever we intend to create a trace, we should instantiate ISA with this argument. | 20:04 |
ghostmansd[pc] | And, even with this in mind, I still don't get why do we keep self.insnlog. Do we really need it to be saved somewhere else other than trace file? Why bother saving it in member variable which survives only until execute_one is called again? | 20:06 |
ghostmansd[pc] | Ah wait, with self.insnlog I begin to understand. The code is split between methods. | 20:08 |
ghostmansd[pc] | Annoying. | 20:08 |
ghostmansd[pc] | OK, so, log _must_ be one per ISA instance, and `self.insnlog` just has to be per-instance and not just transient since we have several methods which can update this variable and we have no desire to pass trace file in each and every one of them. | 20:12 |
*** ghostmansd[pc] is now known as ghostmansd | 20:26 | |
lkcl | > We start with an empty insnlog created inside execute_one. | 20:34 |
lkcl | correct | 20:34 |
lkcl | > user of ISACaller class must pass trace file (path or writable stream, | 20:35 |
lkcl | correct | 20:35 |
lkcl | (with detection "if hasattr(self.inslog_stream, write)" | 20:35 |
lkcl | because it is possible to pass in a BytesIO instance | 20:35 |
lkcl | > upon ISACaller instantiation. | 20:36 |
lkcl | correct | 20:36 |
lkcl | > And all execute_one() invocations should simply populate this file | 20:36 |
lkcl | correct | 20:36 |
lkcl | > It seems that we never use ISACaller directly, only via ISA class | 20:36 |
lkcl | also correct | 20:36 |
lkcl | > For me `insnlog=[]` and `open(..., "a+")` are mutually exclusive. | 20:36 |
lkcl | that's incorrect. | 20:36 |
lkcl | > The code is split between methods. | 20:37 |
lkcl | indeed. thus self.insnlog is used as a deep-level accumulator. it is populated by functions that are several levels deep | 20:37 |
lkcl | > we have no desire to pass trace file in each and every one of them. | 20:37 |
lkcl | nnope. | 20:38 |
lkcl | the propagation would be extreme and intrusive and a maintenance nightmare. | 20:38 |
lkcl | i honestly can't think of a better way to do this. even a "return insnlog" or "return thing to add" is also intrusive | 20:39 |
lkcl | one option, though: it's a bit lame - just write *directly* to the file. | 20:39 |
lkcl | rip out self.insnlog and write literally the data required, at the time it is available (currently: wherever there is a self.insnlog.append(something)) | 20:40 |
lkcl | but the reason for not doing that is that putting in space-separators is a bit of a pain-in-the-ass... | 20:41 |
lkcl | except... you could do | 20:41 |
lkcl | self.insnlog_stream.write("\n%s" % (instruction)) # note the lack of a space after that | 20:42 |
lkcl | and for read/writes: | 20:42 |
lkcl | self.insnlog_stream.write(" rwGPR:%d:%d:%d" % (....)) # note the *inclusion* of the space at the start | 20:42 |
lkcl | that would be a little more intuitive | 20:43 |
lkcl | but please do use the "if hasattr(stream, "write")" trick, on the basis that "anything string-like" won't have a write() function | 20:43 |
lkcl | the only other thing is, don't close the file if it was passed-in (need a bool-detect var for that) | 20:44 |
lkcl | because the file was passed in, it should be caller's responsibility to close. or not. as they see fit | 20:45 |
*** midnight <midnight!~midnight@user/midnight> has joined #libre-soc | 21:12 |
Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!