JDevlieghere wrote:

Let me try to provide a bit more context. Darwin has the concept of a 
[sysdiagnose](https://it-training.apple.com/tutorials/support/sup075/). It's 
essentially an archive with diagnostic files, including crashlogs and a dump of 
the last few minutes of the system log. On our platform, the majority of bug 
reports (feedback reports/radars) are accompanied by a sysdiagnose. We already 
rely heavily on them for crashes (crashlogs for `lldb` and `debugserver`) and 
logging in `debugserver` (which logs to the system log). I want to start using 
this for logging from `lldb` as well. 

As I mentioned in #108495, Swift was already doing something similar, and we've 
found this to be extremely useful. To give a concrete example, the Swift fork 
starts by logging the used lldb version to the system log. We've found that 
this was a lot  more reliable than trusting the version reported by the user, 
if they mention a version in their bug report at all. When there's a 
sysdiagnose attached, we don't have to send the bug back, asking for more 
information. My goal for the always-on log channel (which logs to the system 
log) is to log high-value/low-bandwidth information. 

Separately, we had a few instances recently where we received bug reports that 
were hard to investigate and where we discovered that deep down we had created 
a meaningful Error (which would've told us the problem right away) but got 
dropped somewhere or at least not shown to the user. @adrian-prantl has put up 
several patches to propagate those errors. The goal of this patch is to catch 
those errors so we can quickly spot them in the sysdiagnose. To be clear, the 
goal is not to rely on that, but to save us from having to spend two days 
debugging LLDB when we could've spotted the issue from a dropped error right 
away, and use that time instead to improve LLDB and propagate the error to the 
user. 

Although this is all motivated by sysdiagnoses, I didn't want to do something 
too bespoke for our platform and want to be able to reuse the existing logging 
infrastructure. I figured this might be useful on Linux as well, but as I'm 
hearing more about how the system log is used there, I think it's much less 
appealing. I'm starting to wonder if we should just make the system log a NOOP 
on Linux too like we did on Windows and make the system log in LLDB and


https://github.com/llvm/llvm-project/pull/111911
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to