[vbox-dev] Logging question

Jos Backus jos at catnook.com
Sat Feb 19 01:09:24 GMT 2011


Hello Michael,

Thanks for the quick response.

On Fri, Feb 18, 2011 at 2:27 PM, Michael Thayer
<michael.thayer at oracle.com>wrote:

> Hello Jos,
>
> Le vendredi 18 février 2011 à 12:36 -0800, Jos Backus a écrit :
> > How do I write to the log file? I would expect LogAlways to always write
> to
> > the log, but it doesn't seem to work.
> One of the Log macros.  E.g. Log() for "standard" debug logging, Log2()
> for second-level debug logging, LogRel() for "standard" release logging.
> Standard release logging always hits the release log, regardless of log
> settings.  Other logging types appear in the release or debug logs
> depending on the groups and types of logging enabled.  E.g.
>
>    export VBOX_LOG=+shared_folders.e.l.l3.f
>
> causes standard (.e == enable), level 2 (l), level 3 (l3) and flow (f)
> logging (both debug and release logging) for the shared_folders log
> group to hit the debug log file.  Other types of logging will silently
> be dropped.
>
>    export VBOX_LOG_RELEASE=+shared_folders.e.l.l3.f
>
> does the same for the release log file, but only release logging (using
> the LogRel* macros) will go in.
> [Snip]
>
> > For example, I want to insert some logging into the following files:
> >
> > HostServices/SharedFolders/service.cpp
> > HostServices/SharedFolders/vbsf.cpp
> > Runtime/r3/posix/symlink-posix.cpp
> > Additions/linux/sharedfolders/dirops.c
> > Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
> [Snip]
> > But it's not at all clear what
> > LOG_GROUPs these files map to.
>
> src/VBox/HostServices/SharedFolders/shfl.h, which is included by the
> first two files, contains
>
>    #define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
>
> for which you need
>
>    VBOX_LOG=+shared_folders.*
>
> src/VBox/Runtime/r3/posix/symlink-posix.cpp contains
>
>    #define LOG_GROUP RTLOGGROUP_SYMLINK
>
> for which you need
>
>    VBOX_LOG=+rt_symlink.*
>

What do I do for files like Additions/linux/sharedfolders/dirops.c, which
has no LOG_GROUP define? When I turn on +all logging I see my Log messages
coming from EMT-0 so I tried `log +em.e.l.l2.f' in the debugger but that
doesn't seem to work.

I'm going to try adding a LOG_GROUP define next, with
LOG_GROUP_SHARED_FOLDERS. Maybe `log +shared_folders.*' will then work?

Alternatively, it seems LOG_GROUP defaults to DEFAULT, so would `log
+default.*' work in the debugger?

And is there a way to turn off logging in the debugger?

Guest logging inside kernel modules is a rather different kettle of

> fish, as it involved quite a bit more infrastructure.  To keep life
> simple, you are best to only use release logging if you want to be sure
> that it will be visible in the log file, but then it will always go to
> the release log file on the host.
>

Not sure I understand, I am using a debug build. Where do I find the release
log? Right now I am using VBOX_LOG_DEST=dir=/tmp.


> Hope that was alright for a start.  Our logging system is rather complex
> and it would take a while to describe it comprehensively.
>
> When I get round to it I may create a wiki entry about it.
>

That would be great. I don't see myself finishing this without working
logging, no matter how motivated I am :-/

It also doesn't help that the guest crashes or slows down seemingly randomly
even without any changes. Right now I am waiting for
./VBoxLinuxAdditions-x86.run to finish which seems to either take forever or
is simply hung. The problem is that every time I make a change to the vboxsf
driver I have to reinstall the additions, and with the system not working
reliably it is very time-consuming.

Thanks.
Jos


> Regards,
>
> Michael
> --
> ORACLE Deutschland B.V. & Co. KG   Michael Thayer
> Werkstrasse 24                     VirtualBox engineer
> 71384 Weinstadt, Germany           mailto:michael.thayer at oracle.com
>
> Hauptverwaltung: Riesstr. 25, D-80992 München
> Registergericht: Amtsgericht München, HRA 95603
>
> Komplementärin: ORACLE Deutschland Verwaltung B.V.
> Rijnzathe 6, 3454PV De Meern, Niederlande
> Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
> Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven
>
>


-- 
Jos Backus
jos at catnook.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20110218/d942db60/attachment.html>


More information about the vbox-dev mailing list