In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use kprintf in Component. It is very detailed and has a certain reference value. Friends who are interested must finish it!
When debugging a program, one of the most commonly used means is to print some debug statements, and the most commonly used print function should be printf (). The purpose of printf () is to output formatted debug statements to the standard output device. This standard output device defaults to PC Console or serial port
You can also modify it, such as changing to a file or pipe
When logMsg () is executed in ISR, debug statements are sent to task tLogTask with priority 0 through the underlying msgQSend (logMsgQId, msg, sizeof (msg), NO_WAIT,MSG_PRI_NORMAL).
However, to use logMsg (), you need to use it after usrRoot () calls logInit (); using printf (), you need to use usrRoot () after calling usrSerialInit () or usrPcConsoleInit ().
This component simply provides the developer with two functions, kputs () and kprintf (). The declarations of these two functions are similar to the puts and printf () defined by ANSI, respectively, and they are used to print statements for debugging.
As you can see, kprintf () can be used after sysHwInit () in the usrInit () phase and before usrCacheEnable (), much earlier than when printf () / logMsg () is available.
In addition, logMsg () uses the NO_WAIT method when calling msgQSend (), so it is possible to discard some messages
Let's take a look at an example of output to the RAM reservation.
Finally, compare the three of them.
Printf ()
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.