Debugging logs in chromium OS

353 views
Skip to first unread message

varsha vanga

unread,
Sep 22, 2020, 1:54:03 PM9/22/20
to Chromium-dev

Hi,
I am trying to add debugging logs in chromium OS. I am working on chromium OS booted through USB stick.
I have added some custom logs in many files, but to name a few eq2.c, drc.c, cras_dsp_pipeline.c , audio_thread.c.
I have referred below link to capture logs:
https://chromiI found rum.googlesource.com/chromium/src.git/+/master/docs/chrome_os_logging.md.

I have captured these files while playing a music track from the browser :  
/var/log/ui/ui.LATEST,
/var/log/chrome/chrome,
/var/log/messages

But I could not see any of my custom logs in these files.

1. Where can I find my logs? Is there any method to capture audio logs (audio daemon logs/CRAS)?
2. As we have ADB in android which helps us to get logs, is there any such provision in Chromium which can provide the platform/OS logs?

Please provide some inputs for the same.
Thanks for bearing with a newbie to chromium OS.

Regards,
Varsha

Harry Cutts

unread,
Sep 23, 2020, 5:31:23 AM9/23/20
to Chromium-dev, varsh...@gmail.com, Chromium OS Development, Hsinyu Chao
+chromium-os-dev, the mailing list for Chromium OS. (This list is for the browser only.)

/var/log/ui and /var/log/chrome only contain logs from the Chromium binary itself, so you won't find logs from CRAS there. Maybe +Hsinyu Chao would know where to find them.

Denny Lockhart

unread,
Sep 23, 2020, 12:31:37 PM9/23/20
to Chromium-dev, varsh...@gmail.com
I may be way off the mark here so please just ignore this n00b if I am but...

The config file /etc/init/cras.conf executes the script /usr/share/cros/init/cras.sh
The cras.sh script contains the following:

# Leave cras in the init pid namespace as it uses its PID as an IPC identifier.
exec minijail0 -u cras -g cras -G --uts -v -l \
        -T static \
        -P /mnt/empty \
        -b /,/ \
        -k 'tmpfs,/run,tmpfs,MS_NODEV|MS_NOEXEC|MS_NOSUID,mode=755,size=10M' \
        -b /run/cras,/run/cras,1 \
        -b /run/dbus,/run/dbus,1 \
        -b /run/systemd/journal \
        -b /run/udev,/run/udev \
        -b /dev,/dev \
        -b /dev/shm,/dev/shm,1 \
        -k proc,/proc,proc \
        -b /sys,/sys \
        -k 'tmpfs,/var,tmpfs,MS_NODEV|MS_NOEXEC|MS_NOSUID,mode=755,size=10M' \
        -b /var/lib/metrics/,/var/lib/metrics/,1 \
        -- \
        /sbin/minijail0 -n \
        -S /usr/share/policy/cras-seccomp.policy \
        -- \
        /usr/bin/cras \
        ${DSP_CONFIG} ${DEVICE_CONFIG_DIR} ${DISABLE_PROFILE} \
        ${INTERNAL_UCM_SUFFIX}

I don't know if you can tweak the line with 'exec minijail0 -u cras -g cras -G --uts -v -l' to increase the logging level or not since I know nothing about it but I thought this might be a place of interest.

~DennyL

Harry Cutts

unread,
Sep 23, 2020, 1:02:36 PM9/23/20
to denny.l...@gmail.com, Chromium-dev, varsh...@gmail.com
That line is actually the arguments to Minijail, the sandboxing system that many components run in, so the -v argument is one of its namespacing flags.

Harry Cutts
Chrome OS Touch/Input team
 
~DennyL
On Tuesday, September 22, 2020 at 1:54:03 PM UTC-4 varsh...@gmail.com wrote:

Hi,
I am trying to add debugging logs in chromium OS. I am working on chromium OS booted through USB stick.
I have added some custom logs in many files, but to name a few eq2.c, drc.c, cras_dsp_pipeline.c , audio_thread.c.
I have referred below link to capture logs:
https://chromiI found rum.googlesource.com/chromium/src.git/+/master/docs/chrome_os_logging.md.

I have captured these files while playing a music track from the browser :  
/var/log/ui/ui.LATEST,
/var/log/chrome/chrome,
/var/log/messages

But I could not see any of my custom logs in these files.

1. Where can I find my logs? Is there any method to capture audio logs (audio daemon logs/CRAS)?
2. As we have ADB in android which helps us to get logs, is there any such provision in Chromium which can provide the platform/OS logs?

Please provide some inputs for the same.
Thanks for bearing with a newbie to chromium OS.

Regards,
Varsha

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to a topic in the Google Groups "Chromium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-dev/D3fx7lZEV4M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/79d5de93-f27d-4fcf-a615-809e8a23cc33n%40chromium.org.

Cheng-yi Chiang

unread,
Sep 25, 2020, 2:00:01 AM9/25/20
to hcu...@chromium.org, denny.l...@gmail.com, Chromium-dev, varsh...@gmail.com
In cras.sh, please add

--syslog_mask 7

following

${INTERNAL_UCM_SUFFIX}

After that,  stop cras and start cras for cras to take that argument.

Thanks!




You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CA%2BjURctYVNtJvc5s%2B338r9FX2YKcy-fV8RzO8zk3ZtTGcNn9Hw%40mail.gmail.com.

varsha vanga

unread,
Sep 28, 2020, 2:45:33 AM9/28/20
to Chromium-dev, Cheng-Yi Chiang, denny.l...@gmail.com, Chromium-dev, varsha vanga, hcu...@chromium.org
Thank you CYChiang for your inputs.

After adding the flag, Can I know where should I search for my logs? As per previous reply, these files /var/log/ui/ui.LATEST, /var/log/chrome/chrome, /var/log/messages  will not have my custom logs.
Does system logs will show my custom logs ? If not, please let me know about the file.

Thanks !!

Regards,
Varsha

varsha vanga

unread,
Oct 1, 2020, 11:37:26 AM10/1/20
to Chromium-dev, varsha vanga, Cheng-Yi Chiang, denny.l...@gmail.com, Chromium-dev, hcu...@chromium.org
Hi,

I am stuck here... Please help me out.

Regards,
Varsha

varsha vanga

unread,
Oct 6, 2020, 9:52:56 AM10/6/20
to Chromium-dev, varsha vanga, Cheng-Yi Chiang, denny.l...@gmail.com, Chromium-dev, hcu...@chromium.org
Hi,

I have tried by adding " --syslog_mask 7" following  ${INTERNAL_UCM_SUFFIX} in cras.sh file. After that,  I have tried doing stop cras and start cras. but still I am not able to get any logs in files like /var/log/chrome/chrome and system logs.
Please let me know if I am missing any step or I am on the wrong track?  I have followed these steps on machine booted through USB stick and also on cros-vm (QEMU image).
Please let me know If there is any single file where we could find the debug logs added in the CRAS audio flow.

Hoping to get some reply on this.

Thanks,
Varsha

王伟东

unread,
May 2, 2023, 8:06:28 PM5/2/23
to ChromiumOS Development, Harry Cutts, varsh...@gmail.com, Chromium OS Development, Hsinyu Chao, Chromium-dev

Hi all,
I met the same problem. Did you solve it at last?
Best regards,
Weidong Wang
Reply all
Reply to author
Forward
0 new messages