-
Notifications
You must be signed in to change notification settings - Fork 120
Collect dmesg when running tests #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collect dmesg when running tests #823
Conversation
5386ffa to
dc76a42
Compare
qais-yousef
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a cuople of questions but it looks good to me in general. Dmesg is useful to have for sure.
|
|
||
| self.dmesg_out = self.target.execute(cmd) | ||
|
|
||
| def get_trace(self, outfile): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be called get_log() instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was named to match the "abstract" method defined in the base class (TraceCollector), but it would indeed make more sense as get_log(). Can you post that comment on devlib's PR as well, so we can have the opinions of the maintainers there ?
ARM-software/devlib#376
| ) | ||
|
|
||
|
|
||
| class DmesgCollector(TraceCollector): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This inheritance relationship doesn't sound right to me. From naming point of view at least. What facilities in the parent class you care about here?
If it is to auto start/stop then it seems to me TraceCollector and DmesgCollector should have a common parent class.
e.g
BufferCollector
|
+------------- +----------------+
| |
TraceCollector DmesgCollector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are already a number of other collectors in devlib like LogcatCollector, which already inherit from TraceCollector. That hierarchy of names probably needs to be preserved for backward compatibilities, but if you think it's worth a rename, having aliases is possible if devlib maintainers are happy with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What facilities in the parent class you care about here?
Mostly the context manager (__enter__/__exit__) and the "promise on the API" (all collectors can be expected to behave roughly the same way without looking at each specific case). I initially tried to implement it as an instrument, but it was not suited at all. TraceCollector seemed to have a number of derived classes doing more or less the same thing as I do.
8512f116 trace: Add DmesgCollector be8b87d5 module/sched: Fix/simplify procfs packing behaviour d76c2d63 module/sched: Make get_capacities() work with hotplugged CPUs 8bfa0502 module/sched: SchedProcFSData: Don't assume SD name is always present git-subtree-dir: external/devlib git-subtree-split: 8512f116fc5de214fd73cacf474b3109323a5754
This gives a number of utilities, among them the real "dmesg" that supports more options than the BusyBox one.
Make sure the same name is used everywhere for trace and dmesg log files in the res_dir.
dc76a42 to
c77e728
Compare
EDIT: ready to merge, devlib's PR has been merged