A method for printing debugging information, and an electronic device

By determining the print level when the server boots up and using hardware to obtain debugging information, the problem of not being able to print before the intelligent platform management interface is ready is solved, enabling rapid diagnosis of early faults and efficient utilization of resources.

CN120723188BActive Publication Date: 2025-11-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511214629.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-11-25
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

Before the intelligent platform management interface is ready, debugging information cannot be printed, which makes fault location difficult and wastes resources.

Method used

By determining the number of power-on cycles when the server is powered on, reading the level identifier corresponding to the printing level, and printing debugging information according to the target level identifier before the intelligent platform management interface of the baseboard management controller is ready, the printing level can be obtained by hardware without software configuration, and the printing granularity can be dynamically adjusted.

Benefits of technology

It enables rapid diagnosis of early fault location, ensures the success rate of debugging information printing, avoids resource waste, and improves the efficiency of fault location and the accurate control of debugging information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723188B_ABST
    Figure CN120723188B_ABST
Patent Text Reader

Abstract

The application discloses a debugging information printing method and an electronic device, and relates to the technical field of servers.The method comprises the following steps: when it is detected that a server is started, the number of starting times of the server is determined; according to the number of starting times, a level identifier reading mode corresponding to a printing level of debugging information of the server is determined; a target level identifier corresponding to the printing level is read according to the level identifier reading mode; and before an intelligent platform management interface of a baseboard management controller of the server is ready, debugging information of the server is printed according to a printing level corresponding to the target level identifier. The application can solve the problem that debugging information cannot be printed before the intelligent platform management interface is ready, and achieves the printing of debugging information according to a printing level obtained from hardware. The debugging information can be used to obtain a bottom fault in an initial starting period, avoids the trouble of troubleshooting caused by the failure to print debugging information, and greatly shortens the fault positioning time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of servers, and particularly relates to a printing method of debug information and an electronic device. BACKGROUND

[0002] During a server startup process, a Basic Input / Output System (BIOS) outputs key and important information in a startup stage to a serial port to form a serial port log, which is also called debug information. The debug information can be used to improve the efficiency of debugging (Debug). The original code provided by a BIOS manufacturer prints all debug information by default.

[0003] In the related art, to implement hierarchical printing of debug information, a debug module of a device manufacturer creates a debug library (Library) corresponding to different startup stages, and the debug library is used to control the printing of debug information in different startup stages of the BIOS. In this way, the debug module needs to first obtain a debug level set by a Baseboard Management Controller (BMC) through a command of an Intelligent Platform Management Interface (IPMI) when running, and then calls the corresponding debug library to print the debug information according to the set debug level. Before the command of the Intelligent Platform Management Interface is ready, the default obtained debug level is 0, that is, no debug information is printed. Therefore, in the related art, the debug information cannot be printed before the Intelligent Platform Management Interface is ready. SUMMARY

[0004] The present application provides a printing method of debug information and an electronic device to at least solve the problem that the debug information cannot be printed before the Intelligent Platform Management Interface is ready in the related art.

[0005] The present application provides a printing method of debug information, which includes the following steps: when it is detected that a server is powered on, determining the number of power-on of the server; according to the number of power-on, determining a level identification reading mode corresponding to a printing level of the debug information of the server; reading a target level identification corresponding to the printing level according to the level identification reading mode; and printing the debug information of the server according to the printing level corresponding to the target level identification before an Intelligent Platform Management Interface of a Baseboard Management Controller of the server is ready.

[0006] The application further provides a printing device of debugging information, comprising: a processing module, configured to determine the number of start-ups of a server when detecting that the server is started up; determine a level identification reading mode corresponding to a printing level of the debugging information of the server according to the number of start-ups; a reading module, configured to read a target level identification corresponding to the printing level according to the level identification reading mode; and a printing module, configured to print the debugging information of the server according to the printing level corresponding to the target level identification before an intelligent platform management interface of a baseboard management controller of the server is ready.

[0007] The application further provides an electronic device, comprising: a memory, configured to store a computer program; and a processor, configured to execute the computer program to implement the steps of any of the printing methods of debugging information.

[0008] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of any of the printing methods of debugging information.

[0009] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of any of the printing methods of debugging information.

[0010] According to the application, the level identification reading mode corresponding to the printing level of the debugging information of the server can be determined according to the number of start-ups, and the target level identification corresponding to the printing level can be read based on the level identification reading mode, so that the printing level corresponding to the target level identification can be read when the intelligent platform management interface of the baseboard management controller of the server is not ready. Therefore, the debugging information can be printed according to the printing level obtained from the hardware before the intelligent platform management interface of the baseboard management controller of the server is ready. The debugging information can be used to obtain the underlying fault in the initial stage of starting, avoid the troubleshooting dilemma of not printing the debugging information, and greatly shorten the fault positioning time. In addition, the debugging information is output by the fixed printing level triggered by the hardware, so that the hardware does not fail when the software fails, and the printing success rate of the debugging information is ensured. Moreover, the printing granularity can be dynamically adjusted without software configuration. The printing level obtained from the hardware can accurately control the output content (such as printing only fatal errors or full process information), and avoid the waste of input and output resources caused by indiscriminate printing of debugging information. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0012] Figure 1 A topology diagram of a debugging information printing system provided by an embodiment of the present application;

[0013] Figure 2 A flowchart of a debugging information printing method provided by an embodiment of the present application;

[0014] Figure 3 A flowchart of another debugging information printing method provided by an embodiment of the present application;

[0015] Figure 4 A flowchart of still another debugging information printing method provided by an embodiment of the present application;

[0016] Figure 5 A device structure block diagram of a debugging information printing device provided by an embodiment of the present application;

[0017] Figure 6 A hardware structure diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, any other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0019] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0020] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0021] The embodiments of the present application are applied to the hierarchical printing of debugging information of a server.

[0022] The function of the debug information: record the log of the starting process, facilitate the analysis of the running condition of the starting stage, thereby improving the maintainability of the system. Record the normal information in the starting process, facilitate the confirmation of the system running condition. Record the abnormal information of the starting process. Thus, the system failure can be quickly diagnosed. Record the initialization or device driver execution information in the starting process, facilitate the positioning of the serial port information module position. Record the restart node information in the starting process, facilitate the positioning of the restart reason. Record the important node timestamp information, facilitate the positioning of the starting time abnormal problem. Record the interactive information content in the starting process, facilitate the positioning of the interaction problem.

[0023] The system POST process supports the output control and hierarchical display of the debug information, the debug information is prohibited from being printed in normal use, the system starting can be accelerated, the debug information output can be started by one key in system debugging, and hierarchical printing of the debug information is supported, thereby improving the problem solving efficiency.

[0024] The original code provided by the BIOS manufacturer prints all the debug information by default. In the related art, in order to realize hierarchical printing of the debug information, the debug module of the device manufacturer creates a debug library corresponding to different starting stages, and the debug library is used to control the debug information printing of the BIOS in different starting stages. In each library, the debug level is obtained by different ways. The device manufacturer replaces all the debug libraries corresponding to different starting stages created by the BIOS manufacturer with the debug libraries. In this way, all the debug information is controlled by the same mask rule.

[0025] It can be understood that when the server starts, the BIOS will print the debug information of the key and important information in the starting stage. Since the IPMI service depends on software initialization, a certain execution time and steps are required, therefore, before the intelligent platform management interface is ready, the printing level of the debug information cannot be obtained, and therefore the debug information cannot be printed.

[0026] In order to solve the above technical problems, the embodiment of the present application provides a printing method of debug information, which obtains the printing level of the debug information by reading the level values of the first pin and the second pin on the mainboard, so that even if the intelligent platform management interface is not ready, the debug information can be printed through the printing level.

[0027] The printing system of the debug information is shown in the following Figure 1 The method provided by the embodiment of the present application is described. Figure 1 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solutions provided by the present application.

[0028] As shown in Figure 1 , the debug information is printed in the starting process of the system. Figure 1This is a topology diagram of a debugging information printing system provided in an embodiment of this application. Figure 1 In the process, the debugging information printing system 100 may include a debugging information printing device 101, a baseboard management controller 102, a memory 103, and a pin module 104.

[0029] The debugging information printing device 101 can be any device with communication and computing functions. For example, the debugging information printing device 101 can be a debugging card inserted into the motherboard. The debugging information printing device is also called a debug module.

[0030] The baseboard management controller 102 can be an independent embedded hardware component integrated on the motherboard of a server or data center equipment. It monitors, controls, and manages the hardware independently of the host operating system and is the core carrier for realizing the intelligent platform management interface protocol.

[0031] Memory 103 may be a complementary metal-oxide-semiconductor (CMOS) memory. CMOS memory is used to store configuration information for the BIOS / Unified Extensible Firmware Interface (UEFI).

[0032] The pin module 104 includes a first pin and a second pin. The first pin is also called a first input / output pin, and the second pin is also called a second input / output pin.

[0033] Figure 1 The debugging information printing system 100 shown is for illustrative purposes only and is not intended to limit the technical solutions of this application. Those skilled in the art should understand that in specific implementations, the debugging information printing system 100 may include other devices, without limitation.

[0034] Embodiments of this application provide a method for printing debugging information, such as... Figure 2 As shown, Figure 2 The following is a flowchart illustrating a method for printing debugging information according to an embodiment of this application. The method includes the following steps:

[0035] S201, when the server is detected to be powered on, determine the number of times the server will be powered on.

[0036] For example, when the debugging information printing device detects that the server is powered on, it reads the number of times the server has been powered on from the CMOS memory on the motherboard.

[0037] S202, based on the number of power-on cycles, determine the reading method of the level identifier corresponding to the printing level of the server's debugging information.

[0038] The debugging information includes one or more of the server's default debugging information, other debugging information, and extended debugging information.

[0039] The preset debugging information includes the server's core startup status and fatal error information. For example, key debugging information includes the operating status of critical components, motherboard model, processor model, BIOS version, and boot mode.

[0040] Other debugging information includes key processes and status information for each stage of the server's system startup. For example, other debugging information includes the model, interface, status information, driver loading order, success / failure status and reasons, startup order, security policies, power consumption settings, loading results, non-fatal warnings, and startup device selection and boot process of all peripherals (hard drives, network cards, PCIe devices, etc.).

[0041] Extended debugging information includes information related to system reliability, availability, and serviceability (RAS). For example, extended debugging information includes memory error correction records, cache error detection, bus link error counts, hardware redundancy status, and real-time sensor data.

[0042] The print levels for debug information include a first print level, a second print level, a third print level, and a fourth print level. The first print level is also known as the Disable level. The Disable level indicates that debug information should not be printed.

[0043] The second print level is also called the Minimum level. The second print level is used to indicate the print preset debugging information.

[0044] The third print level is also known as the Normal level. The third print level is used to indicate the printing of preset debugging information and other debugging information.

[0045] The fourth print level is also known as the Maximum print level. The fourth print level is used to indicate the printing of preset debug information, other debug information, and extended debug information.

[0046] In one example, when the power-on count is the first time, the method for determining the level identifier corresponding to the printing level is to read the voltage levels corresponding to the first and second preset pins on the motherboard. The target level identifier is obtained by combining the first voltage level corresponding to the first preset pin and the second voltage level corresponding to the second preset pin.

[0047] When both the first and second level values ​​are the first values, the print level corresponding to the target level identifier is the first print level.

[0048] Alternatively, when the first level value is the first value and the second level value is the second value, the print level corresponding to the target level identifier is the second print level.

[0049] Alternatively, when the first level value is the second value and the second level value is the first value, the print level corresponding to the target level identifier is the third print level.

[0050] Alternatively, when both the first and second level values ​​are the second values, the print level corresponding to the target level identifier is the fourth print level.

[0051] The first value can be 0, and the second value can be 1. Specifically, a target level identifier of 00 indicates a Disabled printing level; 01 indicates a Minimum printing level; 10 indicates a Normal printing level; and 11 indicates a Maximum printing level.

[0052] In another example, when the power-on count is not the first time, the method for determining the level identifier corresponding to the printing level is to read the target level identifier stored in the memory on the motherboard.

[0053] Understandably, since the first and second preset pins on the motherboard hardware, as well as the memory, do not require software initialization, the correct print level can be directly read from the first and second pins or the memory when the intelligent platform management interface of the server's baseboard management controller is not yet ready. This allows for printing debugging information based on the print level obtained from the hardware, even before the server's baseboard management controller's intelligent platform management interface is ready.

[0054] S203, read the target level identifier corresponding to the printed level according to the level identifier reading method.

[0055] For example, when the power-on / off count is the first time, the target level identifier is obtained by reading the level values ​​corresponding to the first and second preset pins of the debug jumper on the motherboard according to the level identifier reading method. When the power-on / off count is not the first time, the target level identifier stored in the memory on the motherboard is read.

[0056] S204: Before the intelligent platform management interface of the server's baseboard management controller is ready, print the server's debugging information according to the printing level corresponding to the target level identifier.

[0057] For example, before the intelligent platform management interface of the server's baseboard management controller is ready, the debug library corresponding to the current sub-startup phase is called, and the server's debug information is printed according to the print level corresponding to the target level identifier.

[0058] based on Figure 2 The method shown can determine the number of times the server is powered on when it is detected that the server is powered on; determine the reading method of the level identifier corresponding to the printing level of the server's debugging information based on the number of power-on times; read the target level identifier corresponding to the printing level according to the level identifier reading method; and print the server's debugging information according to the printing level corresponding to the target level identifier before the intelligent platform management interface of the server's baseboard management controller is ready.

[0059] Because the reading method of the level identifier corresponding to the printing level of the server's debugging information can be determined based on the number of power-on cycles, and the target level identifier corresponding to the printing level can be read based on the level identifier reading method, the printing level corresponding to the target level identifier can be read even when the intelligent platform management interface of the server's baseboard management controller is not ready in the early stages. Therefore, debugging information can be printed based on the printing level obtained from the hardware before the intelligent platform management interface of the server's baseboard management controller is ready. This debugging information can be used to identify low-level faults in the early stages of startup, avoiding the difficulties of troubleshooting without printing debugging information and significantly shortening the fault location time. Furthermore, outputting debugging information through fixed printing levels triggered by hardware ensures that hardware does not fail when software fails, guaranteeing the success rate of printing debugging information. The printing granularity can be dynamically adjusted without software configuration. The printing level obtained by the hardware can precisely control the output content (e.g., printing only fatal errors or full process information), avoiding the waste of input and output resources caused by indiscriminate printing of debugging information.

[0060] Furthermore, when the intelligent platform management interface of the baseboard management controller is ready, such as Figure 3 As shown, Figure 3 This is a flowchart illustrating another method for printing debugging information provided in an embodiment of this application. The debugging information printing device may also perform the following steps:

[0061] S301, when the intelligent platform management interface of the substrate management controller is ready, a query command is sent to the substrate management controller through the intelligent platform management interface.

[0062] The query command is used to instruct the substrate management controller to provide the setting print level for the debugging information set by the user. This setting print level is stored in the substrate management controller.

[0063] S302 receives the print level settings from the substrate management controller and prints the server's debugging information according to the print level settings.

[0064] For example, the system receives feedback from the baseboard management controller to set the print level, calls the debug library corresponding to the current sub-startup stage, and prints the server's debug information according to the set print level.

[0065] Optionally, the debugging information printing device can also store the setting printing level in the motherboard's memory.

[0066] Understandably, the first level value can be set to 1 and the second preset pin can be set to 0. By setting the print level to the Disable level, the debugging information printed on the first power-on can be obtained, thus solving the problem that can only be encountered on the first power-on.

[0067] In some optional embodiments, the user can set the print level of debugging information on the client corresponding to the substrate management controller. The client sends the set print level to the substrate management controller. The substrate management controller receives and stores the set print level, and sends a print level adjustment command to the printing device for debugging information.

[0068] When the debugging information printing device receives a print level adjustment command from the substrate management controller, it controls the server to restart. During the server restart process, a callback function is triggered to obtain the adjusted print level of the debugging information from the substrate management controller through the intelligent platform management interface. The debugging information of the server is then printed according to the adjusted print level.

[0069] Optionally, the debugging information printing device can also store the adjusted print levels in the motherboard's memory.

[0070] Understandably, the print level stored in the memory has a higher priority than the print level corresponding to the level identifier formed by the combination of the first level value and the second level value.

[0071] Optionally, during the server's BIOS boot process, such as Figure 4 As shown, Figure 4 This is a flowchart illustrating another method for printing debugging information provided in this application embodiment. The debugging information printing device can also perform the following steps:

[0072] S401, obtain the first weight value corresponding to the startup phase and the second weight value corresponding to the number of boots.

[0073] The server startup phase includes multiple sub-startup phases, which include the security phase, the early extensible firmware interface initialization phase, the driver execution environment phase, the startup device selection phase, and the bootloader loading phase.

[0074] The sum of the first and second weight values ​​is 1. The first weight value indicates the impact of the startup phase on server failures; the second weight value indicates the impact of the number of power-ups on server failures.

[0075] Understandably, by adjusting the ratio of the first weight value of the startup phase and the second weight value of the number of power-on cycles, the influence weight of the startup phase and the number of power-on cycles on the print quality can be flexibly adjusted, so that the debugging strategy can adapt to the needs of different scenarios (such as factory testing, on-site maintenance, etc.).

[0076] S402, obtain the first importance coefficient of the current sub-startup stage and the second importance coefficient of the current boot count.

[0077] The current sub-startup phase is any one of multiple sub-startup phases.

[0078] The first importance coefficient differs across different sub-startup phases. For example, the first importance coefficient for the safety phase is greater than that for the device selection phase. The first importance coefficient indicates the degree of importance of debugging information during the current sub-startup phase.

[0079] The current power-on count and the second importance coefficient are negatively correlated. The more power-on counts, the smaller the second importance coefficient. The second importance coefficient indicates the importance of the debugging information at the current power-on count.

[0080] Understandably, by setting a first importance coefficient for different sub-startup stages, more detailed debugging information can be output during critical startup stages, while debugging information can be simplified during non-critical stages, ensuring that the printed debugging information reflects the detailed information of high-priority startup stages. Combined with a second importance coefficient based on the number of power-ups, the printing level of debugging information can be dynamically adjusted for different stages of device usage. For example, new devices (few power-ups) can output more comprehensive debugging information to capture potential initial problems, while long-running devices (many power-ups) can have less debugging information, balancing debugging needs with system overhead.

[0081] S403, determine the target weight value of the debugging information based on the first weight value, the first importance coefficient, the second weight value, and the second importance coefficient.

[0082] In one example, the target weight value of the debugging information is determined according to a preset algorithm based on a first weight value, a first importance coefficient, a second weight value, and a second importance coefficient. The preset algorithm is as follows:

[0083] in, Indicates the target weight value; Indicates the first weight value; This indicates the first importance coefficient; This represents the second weight value; This represents the second importance coefficient.

[0084] S404, based on the target weight value, determine the preset printing level of the debugging information corresponding to the target weight value.

[0085] The preset print level is used for printing debugging information the next time.

[0086] In one example, the priority of the print level stored in the memory is higher than that of the preset print level; the priority of the preset print level is higher than that of the print level corresponding to the level identifier formed by the combination of the first level value and the second level value.

[0087] Optionally, obtain the baseline weight value of the debugging information; based on the baseline weight value, the first importance coefficient, and the second importance coefficient, determine the target weight value of the debugging information according to a preset expression.

[0088] Specifically, the default expression is:

[0089]

[0090] in, This represents the baseline weight value.

[0091] Understandably, the baseline weight value serves as a basic reference value, providing a stable anchor point for the entire calculation system and preventing drastic changes in the weight value due to fluctuations caused by a single factor (such as the startup phase or the number of power-ups). The first importance coefficient (such as the startup phase) and the second importance coefficient (such as the number of power-ups) are combined with the baseline weight value through preset expressions. This not only reflects the independent influence of each dimension, but also allows for the adjustment of the primary and secondary relationships through coefficient allocation (such as increasing the weight of the first coefficient when emphasizing the startup phase), making the target weight value more in line with actual debugging needs.

[0092] In one example, when the target weight value is less than a first threshold, the preset printing level of the debugging information corresponding to the target weight value is determined to be the Disable level; when the target weight value is greater than or equal to the first threshold and less than the second threshold, the preset printing level of the debugging information corresponding to the target weight value is determined to be the Minimum level; when the target weight value is greater than or equal to the second threshold and less than the third threshold, the preset printing level of the debugging information corresponding to the target weight value is determined to be the Normal level; and when the target weight value is greater than a fourth threshold, the preset printing level of the debugging information corresponding to the target weight value is determined to be the Maximum level.

[0093] Among them, the first threshold is less than the second threshold; the second threshold is less than the third threshold; and the third threshold is less than the fourth threshold.

[0094] Understandably, the calculation mechanism for target weight values ​​ensures that the level of detail in debugging information is precisely matched to scenarios with a higher probability of failure (such as specific startup phases or initial device operation), enabling rapid location of anomalies. This avoids log redundancy or insufficient information issues caused by fixed print levels, ensuring the completeness of critical information while reducing unnecessary input / output operations and storage usage, thus improving BIOS startup efficiency.

[0095] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0096] Embodiments of this application also provide a device for printing debugging information, such as... Figure 5 As shown, Figure 5 A device structure block diagram of a debugging information printing apparatus provided in this application embodiment; the debugging information printing apparatus includes:

[0097] The processing module 501 is used to determine the number of times the server is powered on when the server is detected to be powered on; and to determine the reading method of the level identifier corresponding to the printing level of the server's debugging information based on the number of power-on times.

[0098] The reading module 502 is used to read the target level identifier corresponding to the printing level according to the level identifier reading method;

[0099] The printing module 503 is used to print the server's debugging information according to the target level identifier and the corresponding printing level before the intelligent platform management interface of the server's baseboard management controller is ready.

[0100] In some optional implementations, the reading module 502 is specifically used to determine the reading method of the level identifier corresponding to the printing level when the power-on count is the first time, by reading the level values ​​corresponding to the first preset pin and the second preset pin on the motherboard respectively, and combining the first level value corresponding to the first preset pin with the second level value corresponding to the second preset pin to obtain the target level identifier; or, when the power-on count is not the first time, the reading method of the level identifier corresponding to the printing level is to read the target level identifier stored in the memory on the motherboard.

[0101] In some optional implementations, the processing module 501 is further configured to send a query command to the substrate management controller through the intelligent platform management interface when the intelligent platform management interface of the substrate management controller is ready. The query command is used to instruct the substrate management controller to provide the setting print level for the debugging information set by the user. The printing module 503 is further configured to receive the setting print level from the substrate management controller and print the debugging information of the server according to the setting print level.

[0102] In some optional implementations, the processing module 501 is further configured to control the server to restart when a print level adjustment command is received from the substrate management controller; during the server restart process, a callback function is triggered to obtain the user-adjusted debugging information from the substrate management controller through the intelligent platform management interface to adjust the print level; the printing module 503 is further configured to print the server's debugging information according to the adjusted print level.

[0103] In some alternative implementations, the processing module 501 is also configured to store the adjusted print level in the motherboard's memory.

[0104] In some optional implementations, the debugging information includes one or more of the server's preset debugging information, other debugging information, and extended debugging information; when both the first level value and the second level value are first values, the printing level corresponding to the target level identifier is the first printing level, which is used to indicate that debugging information is not printed; or, when the first level value is the first value and the second level value is the second value, the printing level corresponding to the target level identifier is the second printing level, which is used to indicate that preset debugging information is printed; or, when the first level value is the second value and the second level value is the first value, the printing level corresponding to the target level identifier is the third printing level, which is used to indicate that preset debugging information and other debugging information are printed; or, when both the first level value and the second level value are the second values, the printing level corresponding to the target level identifier is the fourth printing level, which is used to indicate that preset debugging information, other debugging information, and extended debugging information are printed.

[0105] In some optional implementations, the startup phase of the basic input / output system includes multiple sub-startup phases; the processing module 501 is further configured to obtain a first weight value corresponding to the startup phase and a second weight value corresponding to the number of power-on cycles; obtain a first importance coefficient of the current sub-startup phase and a second importance coefficient of the current number of power-on cycles, wherein the current sub-startup phase is any one of the multiple sub-startup phases; determine a target weight value for debugging information based on the first weight value, the first importance coefficient, the second weight value, and the second importance coefficient; and determine a preset print level for the debugging information corresponding to the target weight value based on the target weight value, wherein the preset print level is used for printing debugging information in the next iteration.

[0106] In some optional implementations, the processing module 501 is further configured to determine the target weight value of the debugging information according to a preset algorithm based on the first weight value, the first importance coefficient, the second weight value, and the second importance coefficient. The preset algorithm is as follows:

[0107] in, Indicates the target weight value; Indicates the first weight value; This indicates the first importance coefficient; This represents the second weight value; This represents the second importance coefficient.

[0108] In some alternative implementations, the print level stored in the memory has a higher priority than the preset print level; the preset print level has a higher priority than the print level corresponding to the level identifier formed by the combination of the first level value and the second level value.

[0109] For a description of the features in the embodiment corresponding to the debugging information printing device, please refer to the relevant description in the embodiment corresponding to the debugging information printing method, which will not be repeated here.

[0110] Embodiments of this application also provide an electronic device, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes a processor 10 and a memory 20, in which a computer program is stored. The processor 10 is configured to run the computer program to perform the steps in any of the above-described methods for printing debugging information.

[0111] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described methods for printing debugging information when run.

[0112] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0113] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described methods for printing debugging information.

[0114] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described debugging information printing method embodiments.

[0115] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0116] The above provides a detailed description of a method for printing debugging information and an electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for printing debugging information, characterized in that, The method includes: When the server is detected to be powered on, determine the number of times the server has been powered on. Based on the number of power-on cycles, determine the reading method of the level identifier corresponding to the printing level of the server's debugging information; Read the target level identifier corresponding to the printing level according to the level identifier reading method described above; Before the intelligent platform management interface of the baseboard management controller of the server is ready, print the debugging information of the server according to the printing level corresponding to the target level identifier; The method for determining the level identifier reading method corresponding to the printing level of the server's debugging information based on the number of power-on cycles includes: When the power-on count is the first time, the reading method for the level identifier corresponding to the printing level is determined to be reading the level values ​​corresponding to the first preset pin and the second preset pin on the motherboard respectively. The first level value corresponding to the first preset pin and the second level value corresponding to the second preset pin are combined to obtain the target level identifier. Alternatively, when the number of power-on attempts is not the first time, the method for reading the level identifier corresponding to the printing level is determined to be reading the target level identifier stored in the memory on the motherboard.

2. The method according to claim 1, characterized in that, The method further includes: When the intelligent platform management interface of the substrate management controller is ready, a query command is sent to the substrate management controller through the intelligent platform management interface. The query command is used to instruct the substrate management controller to provide feedback on the setting print level of the debugging information set by the user. The system receives the set printing level from the baseboard management controller and prints the server's debugging information according to the set printing level.

3. The method according to claim 2, characterized in that, The method further includes: When a print level adjustment command is received from the baseboard management controller, the server is restarted. During the server restart process, a callback function is triggered to obtain the adjustment print level of the debugging information adjusted by the user from the baseboard management controller through the intelligent platform management interface; Adjust the print level as described and print the server's debugging information.

4. The method according to claim 3, characterized in that, The method further includes: The adjusted print level is stored in the memory of the motherboard.

5. The method according to any one of claims 2-4, characterized in that, The debugging information includes one or more of the server's preset debugging information, other debugging information, and extended debugging information; When both the first level value and the second level value are first values, the print level corresponding to the target level identifier is the first print level, which is used to indicate that the debugging information is not printed. Alternatively, when the first level value is the first value and the second level value is the second value, the printing level corresponding to the target level identifier is the second printing level, and the second printing level is used to indicate the printing of the preset debugging information; Alternatively, when the first level value is the second value and the second level value is the first value, the printing level corresponding to the target level identifier is the third printing level, and the third printing level is used to indicate the printing of the preset debugging information and the other debugging information; Alternatively, when both the first level value and the second level value are the second value, the printing level corresponding to the target level identifier is the fourth printing level, which is used to indicate the printing of the preset debugging information, the other debugging information, and the extended debugging information.

6. The method according to claim 2, characterized in that, The server startup phase includes multiple sub-startup phases; the method further includes: Obtain the first weight value corresponding to the startup phase and the second weight value corresponding to the number of boots; Obtain the first importance coefficient of the current sub-startup stage and the second importance coefficient of the current boot count, wherein the current sub-startup stage is any one of the multiple sub-startup stages; The target weight value of the debugging information is determined based on the first weight value, the first importance coefficient, the second weight value, and the second importance coefficient. Based on the target weight value, a preset printing level for the debugging information corresponding to the target weight value is determined, and the preset printing level is used for printing the debugging information next time.

7. The method according to claim 6, characterized in that, Determining the target weight value of the debugging information based on the first weight value, the first importance coefficient, the second weight value, and the second importance coefficient includes: Based on the first weight value, the first importance coefficient, the second weight value, and the second importance coefficient, the target weight value of the debugging information is determined according to a preset algorithm, wherein the preset algorithm is: in, This represents the target weight value; This represents the first weight value; This represents the first importance coefficient; This represents the second weight value; This represents the second importance coefficient.

8. The method according to claim 7, characterized in that, The priority of the print level stored in the memory is higher than that of the preset print level; the priority of the preset print level is higher than that of the print level corresponding to the level identifier formed by the combination of the first level value and the second level value.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method for printing debugging information as described in any one of claims 1 to 8 when executing the computer program.

Citation Information

Patent Citations

  • System and method for debugging Linux kernel

    CN106227653A

  • Computer system and method for processing debug message of computer system

    US20240403188A1