[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG09dea546692f: [lldb] Support a buffered logging mode (authored by JDevlieghere). Herald added a project: LLDB. Changed prior to commit: https://re

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-22 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision. labath added a comment. In D127986#3600665 , @JDevlieghere wrote: > @labath let me know if this is what you had in mind Yes, that's pretty much it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127986/new/ https

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. @labath let me know if this is what you had in mind CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127986/new/ https://reviews.llvm.org/D127986 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lis

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-21 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127986/new/ https://reviews.llvm.org/D127986 ___ lldb-commits mailing list l

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 438831. JDevlieghere edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127986/new/ https://reviews.llvm.org/D127986 Files: lldb/include/lldb/Core/Debugger.h lldb/include/lldb/Utility/Log.h lldb/source/API/S

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 437786. JDevlieghere added a comment. Generalize support for buffering. You can see it in action below: (lldb) log enable -b 10 lldb default (lldb) target create ./bin/count Current executable set to '/Users/jonas/llvm/build-ra/bin/count' (arm64).

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. The delegate idea is fine too! No need to overload the base class with extra stuff if not needed. I would just like there to be no predispositions on the kinds of logs that can be used when buffering is enabled. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. In D127986#3590157 , @clayborg wrote: > The main questions is if we want --buffered for any log channel (file, > callback, or circular). If we add a --circular flag, then we just let things > accumulate in the LogHandler cl

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. For this idea to work we would need to change the Emit() function to be DoEmit(...), then add logic to LogHandler: void LogHandler::Emit(StringRef message) { if (m_circular) { // Fill buffer in circular fashion return; } if (m_buffer_size > 0)

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. The main questions is if we want --buffered for any log channel (file, callback, or circular). If we add a --circular flag, then we just let things accumulate in the LogHandler class. The idea would be to add more stuff to the LogHandler base class to support this: c

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 437679. JDevlieghere added a comment. Implement Greg's suggestion of integrating this with `log enable`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127986/new/ https://reviews.llvm.org/D127986 Files: lldb/include/lldb/Core/Debugger.h ll

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. I could also imagine having multiple options. For example --buffered would specify to buffer the output and only flush if we go over bytes. This could improve logging speeds. --circular would enable circular buffering where things are never flushed unless manually

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. Something like: (lldb) log enable --buffered 10 lldb process state thread step If we do this, then we need to be able to specify which buffers to dump somehow. In case someone did: (lldb) log enable --buffered 10 lldb ... (lldb) log enable --buffered 100

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. I would vote to add new options to "log enable" and enable any such features on a per "log enable" invocation if possible? Otherwise each time you want to enable this you need to do two commands, and if someone already enables buffered mode, then you wouldn't be able t

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. Adding a test is trivial, but I'm holding off on spending time on that until there's consensus about the approach. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127986/new/ https://reviews.llvm.org/D127986 ___ l

[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

2022-06-16 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision. JDevlieghere added reviewers: labath, clayborg, jingham, kastiglione. Herald added a project: All. JDevlieghere requested review of this revision. This patch adds a buffer logging mode to lldb. It can be enabled with `log buffered enable`, which enables logging