简体   繁体   English

用u-boot日志预填充内核日志

[英]prepanding kernel log with u-boot log

We are using beaglebone black based custom board, 我们正在使用基于beaglebone黑色的定制板,

I am trying to check possibility wherein we can prepand kernel log with u-boot bootlog. 我正在尝试检查是否可以使用u-boot bootlog预装内核日志。
This is required because during manufacturing and programming of the board we run some tests and we need to capture the u-boot bootlog for testlog and test results which goes on serial port. 这是必需的,因为在电路板的制造和编程过程中,我们运行一些测试,并且需要捕获u-boot引导日志以获取测试日志和通过串行端口传输的测试结果。 As serial port is not populated on the customer board its not possible to collect the bootlog, 由于串行端口未安装在客户板上,因此无法收集引导日志,

I found CONFIG_LOGBUFFER option for u-boot in google but i don't understand how do i use the same. 我在Google中找到了u-boot的CONFIG_LOGBUFFER选项,但我不知道该如何使用。

I found following links but "how to use" is not clear 我发现了以下链接,但“如何使用”尚不清楚
http://lists.denx.de/pipermail/u-boot/2004-August/006511.html http://lists.denx.de/pipermail/u-boot/2004-August/006511.html
https://lkml.org/lkml/2009/1/21/250 https://lkml.org/lkml/2009/1/21/250

can someone help understand if i am on right path or not ? 有人可以帮助我了解我是否走正确的道路吗? Any easy explanation of the options ? 对选项有任何简单的解释吗?

Thank you in advance! 先感谢您!

As I recall, the U-Boot logbuffer interface only worked with the DENX linux kernel tree, 5 to 10 years back. 我记得,U-Boot日志缓冲区接口仅适用于5至10年前的DENX linux内核树。 It may have been limited to a couple of platforms, you have some links above. 它可能仅限于两个平台,上面有一些链接。 Patches for linux kernel side did not make it into mainline, so even back then it was hard to get working. Linux内核方面的补丁程序没有进入主线,因此即使在那时,也很难开始工作。

Then around 3.5 kernel, the printk interfaces were redesigned to record-oriented output. 然后在3.5内核左右,将printk接口重新设计为面向记录的输出。 It looks to me that makes CONFIG_LOGBUFFER completely dead, absent large total redesign. 在我看来,这使得CONFIG_LOGBUFFER完全死了,而没有进行大量的重新设计。

For the goal you describe, there should be better options. 对于您描述的目标,应该有更好的选择。 If your target has ethernet, U-Boot NETCONSOLE works. 如果您的目标具有以太网,则U-Boot NETCONSOLE可以工作。 If your target has JTAG, manufacturing test could use that (you can blame the hardware design), that may open a lot of hacky but effective options such as U-Boot MEMCONSOLE. 如果您的目标设备具有JTAG,则可以使用制造测试(您可以将其归咎于硬件设计),这可能会打开许多​​骇人但有效的选项,例如U-Boot MEMCONSOLE。 U-Boot POST gets no love, but you could add some code to save its results to environment variable , that has worked for me. U-Boot POST毫无保留 ,但您可以添加一些代码以将其结果保存到环境变量中 ,这对我有用。

Warning !!! 警告 !!!

I didn't use this feature. 我没有使用此功能。

CONFIG_LOGBUFFER is a kernel configuration flag. CONFIG_LOGBUFFER是内核配置标志。 So compile your kernel with CONFIG_LOGBUFFER=y . 因此,使用CONFIG_LOGBUFFER=y编译内核。 This external logging support will be enabled in your kernel. 此外部日志记录支持将在您的内核中启用。

Make sure that the kernel has that configuration. 确保内核具有该配置。 If not, apply this patch to your kernel and try. 如果没有,请将此补丁应用到您的内核并尝试。

Well, i couldn't achieve what i have asked in question but i could extract the log(the test log and not full SPL log). 好吧,我无法实现我所问的问题,但是我可以提取日志(测试日志而不是完整的SPL日志)。

The test log was important for us to find out test results of failed HW units during manufacturing tests. 测试日志对于我们在制造测试期间找出发生故障的硬件单元的测试结果非常重要。

So Solution i adopted is as follows, 所以我采用的解决方案如下

  1. Along with printing results on terminal i wrote them on specific RAM locatione.g.0x80900000 from SPL.(obviously it should be done after RAM initialization.) 在终端上打印结果的同时,我将它们写在特定的RAM位置,例如SPL的0x80900000(显然应该在RAM初始化后完成)。
  2. Then from u-boot this RAM location values read and sent using tftpput . 然后从u-boot读取并使用tftpput发送此RAM位置值。 see tftpput command's usage . 请参阅tftpput命令的用法
  3. For uniqueness of the logfile name i used mac-id as filename set in u-boot environment variable. 为了使日志文件名唯一,我使用mac-id作为在u-boot环境变量中设置的文件名。

I believe that we can achieve what i asked in my question but currently we are satisfied with short-term solution I have achieved :) 我相信我们可以实现我在问题中提出的要求,但是目前,我们对我所实现的短期解决方案感到满意:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM