Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Logging events in Necko

13 views
Skip to first unread message

Valentin Gosu

unread,
Oct 12, 2012, 8:36:11 PM10/12/12
to dev-tech...@lists.mozilla.org
Hi,

I just filed bug 801209: Logging events in Necko

The idea is that Chrome has a pretty good and detailed way of logging
networking events.
It can be accessed from chrome://net-internals

The current logging system in firefox is completely functional, however,
it does not have the same flexibility. One needs to set certain
environment variables in order to enable it.

Any thoughts?

Jason Duell

unread,
Oct 15, 2012, 1:33:55 PM10/15/12
to dev-tech...@lists.mozilla.org
Our setup also is less than ideal with multiple processes: see

https://bugzilla.mozilla.org/show_bug.cgi?id=638375

https://bugzilla.mozilla.org/show_bug.cgi?id=534764
|*
* https://developer.mozilla.org/en-US/docs/HTTP_Logging#Creating_separate_logs_for_child_processes_(electrolysis-only)*

*If you want to grab bug |638375 and combine that with some way to
display log output in the network dashboard, that would be great. A
couple thoughts:

1) So does Chrome always have logging on, and it just stores the output
in case the user wants to see it (seems like a lot of overhead), or does
it only turn on once net-internals is opened?

2) For multi-process logging, it would best if there's a choice to view
either combined/interleaved logs, or to view the log for a given process
only.

We might as well pick this conversation up in bug 638375, so let's move
the conversation there (unless someone has some broadly different
approach they want to bring up)

cheers,

Jason

Jason Duell

unread,
Oct 15, 2012, 2:03:12 PM10/15/12
to dev-tech...@lists.mozilla.org
On 10/15/2012 10:33 AM, Jason Duell wrote:
> We might as well pick this conversation up in bug 638375,

Or better yet in your new bug 801209

:)

Gervase Markham

unread,
Oct 15, 2012, 2:46:32 PM10/15/12
to Valentin Gosu
On 13/10/12 01:36, Valentin Gosu wrote:
> I just filed bug 801209: Logging events in Necko
>
> The idea is that Chrome has a pretty good and detailed way of logging
> networking events.
> It can be accessed from chrome://net-internals

Wasn't there a Summer of Code project to do something like this? Or was
it aimed at a different problem?

Gerv


Patrick McManus

unread,
Oct 15, 2012, 2:51:45 PM10/15/12
to Gervase Markham, dev-tech...@lists.mozilla.org
Valentin is working on the continuation of the gsoc project.
> ______________________________**_________________
> dev-tech-network mailing list
> dev-tech-network@lists.**mozilla.org <dev-tech...@lists.mozilla.org>
> https://lists.mozilla.org/**listinfo/dev-tech-network<https://lists.mozilla.org/listinfo/dev-tech-network>
>

Brian Smith

unread,
Oct 15, 2012, 3:20:54 PM10/15/12
to Jason Duell, dev-tech...@lists.mozilla.org
Jason Duell wrote:
> Our setup also is less than ideal with multiple processes: see
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=638375
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=534764

Regarding multi-process NSPR logging, don't we just need to send the log output of child processes to a pipe that is consumed by the parent process, and then have the parent process PR_LOG() what it received with some information tacked on (child process ID)?

NSPR_LOG_FILE should NOT work for child processes anyway, because child processes aren't allowed to do disk I/O.

Cheers,
Brian

Jason Duell

unread,
Oct 15, 2012, 5:05:55 PM10/15/12
to Brian Smith, dev-tech...@lists.mozilla.org
On 10/15/2012 12:20 PM, Brian Smith wrote:
> Jason Duell wrote:
>> Our setup also is less than ideal with multiple processes: see
>>
>> https://bugzilla.mozilla.org/show_bug.cgi?id=638375
>>
>> https://bugzilla.mozilla.org/show_bug.cgi?id=534764
> Regarding multi-process NSPR logging, don't we just need to send the log output of child processes to a pipe that is consumed by the parent process, and then have the parent process PR_LOG() what it received with some information tacked on (child process ID)?

Sure, a pipe would be one solution. Some sort of IPC communication is
needed.

> NSPR_LOG_FILE should NOT work for child processes anyway, because child processes aren't allowed to do disk I/O.

Right--that's how we're doing it now, and it's not viable long-term.

Jason

Valentin Gosu

unread,
Oct 22, 2012, 4:46:57 PM10/22/12
to dev-tech...@lists.mozilla.org
I'm moving forward with implementing NetLog - for logging events in the
networking layer.
I'm currently using an nsObserverService to do all of the actual
notifying. However, nsObserverService methods are meant to be called
from the main thread. My current implementation posts the LOG calls to
the main thread, but this is obviously not good for performance.
My thinking is that I could extend nsObserverService to allow calls from
any thread, and use another separate thread to call the observer
methods. This thread could be created and active only while logging is
enabled.

Feedback is appreciated.
Thanks
0 new messages