[lldb-dev] Logging different channels to different files
Zachary Turner
zturner at google.com
Thu May 7 13:28:39 PDT 2015
Incidentally doing a git blame and looking at the commit, it appears
totally unrelated to logging (it was just something that snuck into a large
unrelated change), so it's hard to know what the actual deadlock was, or if
it's still an issue. The code was commented out about 4 years ago, so
there's a good chance it's not still a problem.
On Thu, May 7, 2015 at 1:25 PM Zachary Turner <zturner at google.com> wrote:
> void
> Log::VAPrintf(const char *format, va_list args)
> {
> // Make a copy of our stream shared pointer in case someone disables
> our
> // log while we are logging and releases the stream
> StreamSP stream_sp(m_stream_sp);
> if (stream_sp)
> {
> static uint32_t g_sequence_id = 0;
> StreamString header;
> * // Enabling the thread safe logging actually deadlocks right now.*
> * // Need to fix this at some point.*
> // static Mutex g_LogThreadedMutex(Mutex::eMutexTypeRecursive);
> // Mutex::Locker locker (g_LogThreadedMutex);
>
>
> On Thu, May 7, 2015 at 9:09 AM Ed Maste <emaste at freebsd.org> wrote:
>
>> On 7 May 2015 at 01:03, Vince Harron <vince at nethacker.com> wrote:
>> > Okay, I don't know what I was thinking.
>> >
>> > Debugger.cpp:1317
>> > It's re-using an existing stream if the filename is identical.
>> >
>> > The stomping that Ed is seeing might be solvable by using the -t flag
>> as Jim
>> > suggests.
>>
>> Possibly - I only looked into this when I was first getting started
>> with LLDB and enabled a large set of log channels to try to understand
>> how everything worked. I distinctly recall that log entries were
>> completely missing though, not just "interweaved" as the help for -t
>> suggests.
>>
>> Ah, this seems a bit bizarre:
>>
>> if (log_options == 0)
>> log_options = LLDB_LOG_OPTION_PREPEND_THREAD_NAME |
>> LLDB_LOG_OPTION_THREADSAFE;
>>
>> so by default we get the thread name and threadsafe logging, but if
>> any options are set then they are not automatically set.
>>
>> Oh, but I don't see anywhere LLDB_LOG_OPTION_THREADSAFE is checked.
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150507/77d67091/attachment.html>
More information about the lldb-dev
mailing list