1. Technical Field
Embodiments of the present disclosure relate to information recording systems and methods, and particularly to a computing device and a method for recording system event logs of the computing device.
2. Description of Related Art
Computing devices (e.g., personal computers or servers) used in a variety of applications inevitably incur errors during operations, for example due to failures of software or hardware components. Such failures may pass unnoticed until their cumulative effects degrade system performance to such an extent that corrective action must be taken. Often, when corrective action becomes necessary, the failures may be difficult to detect because they may be related to some past operation or system state which cannot be recorded. Because the failures may not be detectable, it may not be possible to rectify these failures, and therefore the failures persist in the computing devices. Accordingly, a method and system are needed for recording information to enable de-bugging of system problems occurred in the computing devices.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In the present disclosure, the word “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a program language. In one embodiment, the program language may be Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable media or storage medium. Some non-limiting examples of a non-transitory computer-readable medium comprise CDs, DVDs, flash memory, and hard disk drives.
The BMC 11 comprises a flash memory 110 that is used to store system event logs generated by the computing device 1 during a process of testing a stability performance of the computing device 1. In one embodiment, the system event logs comprise, but are not limited to, a system log indicating a high system voltage, a system log indicating a low fan speed, a system log indicating a high CPU usage ratio, and a system log indicating a high system temperature.
In one embodiment, the storage device 12 can be an internal storage system, such as a flash memory, a random access memory (RAM) for temporary storage of information, and/or a read-only memory (ROM) for permanent storage of information. The storage device 12 can also be an external storage system, such as an external hard disk, a storage card, or a data storage medium. The at least one processor 13 can be a central processing unit (CPU), a microprocessor, or other data processor chip that performs various functions of the computing device 1.
In one embodiment, the system event log recording system 10 comprises, but is not limited to, an event inquiring module 101, an event recording module 102, and an event deleting module 103. The modules 101-103 may comprise computerized instructions in the form of one or more computer-readable programs that are stored in a non-transitory computer-readable medium (such as the storage device 12) and executed by the at least one processor 13 of the computing device 1. A description of each module is given in the following paragraphs.
In step S21, the event inquiring module 101 obtains a maximum number of system event logs of the computing device 1 capable of being stored in the flash memory 110. In the embodiment, the computing device 1 generates various system event logs during the process of testing a stability performance of the computing device 1, and records the system event logs in the flash memory 110. The maximum number is predefined according to a storage capacity of the flash memory 110. For example, if the storage capacity of the flash memory 110 is ten megabytes, then one hundred system event logs can be recorded in the flash memory 110. In one embodiment, the system event logs comprise a system log indicating a high system voltage, a system log indicating a low fan speed, a system log indicating a high CPU usage ratio, and a system log indicating a high system temperature.
In step S22, the event inquiring module 101 generates an inquiring command to inquire an actual number of the system event logs of the computing device 1 that are recorded in the flash memory 110. In the embodiment, the event inquiring module 101 sends the inquiring command to the BMC 11, and obtains the actual number of the system event logs that are recorded in the flash memory 110 according to the inquiring command.
In step S23, the event inquiring module 101 determines whether the actual number of the system event logs is less than or equal to the maximum number of the system event logs. If the actual number of the system event logs is less than the maximum number of the system event logs, step S24 is implemented. Otherwise, if the actual number of the system event logs is equal to the maximum number of the system event logs, step S25 is implemented.
In step S24, the event inquiring module 101 delays a predetermined time duration (e.g., 30 seconds), and resends the inquiring command to the BMC 11 to continue inquiring the actual number of the system event logs that are recorded in the flash memory 110.
In step S25, the event recording module 102 creates a temporary file in the flash memory 110, and stores the system event logs into the temporary file. In the embodiment, the temporary file can be a text file or other suitable format file.
In step S26, the event recording module 102 creates a record file in the storage device 12 of the computing device 1. In the embodiment, the record file can also be a text file or other suitable format file.
In step S27, the event recording module 102 copies the system event logs from the temporary file to the record file. In the embodiment, the event recording module 102 obtains the system event logs from the temporary file stored in the flash memory 110, and saves the system event logs into the record file stored in the storage device 12. The system event logs are stored in the storage device 12 through the BMC 11, so that all of the system event logs can be recorded without taking up the storage capacity of the flash memory 110 of the BMC 11.
In step S28, the event deleting module 103 generates a deleting command to delete the temporary file from the flash memory 110 of the BMC 11. In the embodiment, the BMC 11 deletes all the system event logs recorded in the temporary file from the flash memory 110 according to the deleting command.
In step S29, the event deleting module 103 determines whether the computing device 1 has completed the stability performance test on the computing device 1. If the computing device 1 has not completed the stability performance test on the computing device 1, the process goes back to step S22. Otherwise, if the computing device 1 has completed the stability performance test on the computing device 1, the procedure ends.
Although certain disclosed embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.