A debugging method, system and related device
By searching and building the target debugging container in the container pool, the problems of hardware resource waste and long debugging time in the existing technology are solved, a lightweight and fast debugging environment is built, and debugging efficiency and fault location efficiency are improved.
Patent Information
- Application Number
- CN202211476165.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-11-23
AI Technical Summary
The prior art requires building debugging environments of multiple virtual machines or physical machines when debugging kernel dump files, resulting in a waste of hardware resources and excessively long debugging time.
By searching the container pool for the target debugging container that matches the core dump file, the debugging environment is automatically built, reducing hardware resource usage and improving debugging efficiency.
It saves hardware resources, shortens debugging time, and improves debugging efficiency and fault location efficiency.
Smart Images

Figure CN115840617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a debugging method, system and related devices. Background Art
[0002] With the development of computer equipment, when hardware problems or system crashes occur in servers, memory dumps are triggered, generating kernel dump files. A kernel dump is the process by which the operating system (OS) in a computer device writes the kernel of the process address space and other information about the process status to a disk file when the process receives certain signals and terminates. Technicians can use debugging tools to debug and analyze the kernel dump file to determine the operating status of the computer device. Currently, before debugging the kernel dump file, a corresponding debugging environment must be built in a virtual machine or physical machine. Because computer devices have a wide variety of OS types, OS kernel versions, and central processing unit (CPU) architectures, and memory dump files are associated with the CPU architecture and OS kernel version, multiple virtual machines or physical machines are required to build different debugging environments before debugging, which wastes hardware resources and is time-consuming. Summary of the Invention
[0003] The embodiments of the present application provide a debugging method, system, and related devices, which can save hardware resources used for debugging kernel dump files and improve debugging efficiency.
[0004] In a first aspect, embodiments of the present application provide a debugging method that can be executed by a computer device or a module in the computer device, such as a chip or processor. The method may include: receiving a debugging instruction and obtaining a kernel dump file based on the debugging instruction; wherein the debugging instruction carries the kernel dump file or storage path information of the kernel dump file; based on the kernel dump file, searching a container pool for a target debugging container that matches the kernel dump file; if the target debugging container is found in the container pool, invoking the target debugging container to debug the kernel dump file; if the target debugging container is not found in the container pool, obtaining target container information, the target container information being used to construct a target debugging container that matches the kernel dump file; constructing a target debugging container based on the target container information, and invoking the target debugging container to debug the kernel dump file.
[0005] Through the method provided in the first aspect, before debugging a kernel dump file, the kernel debug file can be debugged by searching for a target debug container that matches the kernel dump file to be debugged in the container pool. By providing a debugging environment for the kernel dump file through a container, multiple debug containers can be deployed on a physical machine or a virtual machine, that is, multiple debugging environments can be deployed, so that different kernel dump files can be debugged through different debug containers, respectively. This can reduce the hardware resources occupied by debugging different kernel dump files and save hardware resources. In addition, the user does not need to manually build a debugging container or manually install debugging information and debugging tools. Instead, the computer equipment automatically builds debugging containers for debugging different kernel dump files, reducing the time to build the debugging environment and achieving lightweight and fast construction of the debugging environment, which is conducive to improving debugging efficiency and improving the efficiency of locating system fault problems.
[0006] In one possible implementation, the method further includes: obtaining kernel version information of the kernel dump file and kernel version information corresponding to each debug container in the container pool; if the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debug container, determining that the target debug container has not been found in the container pool. In an embodiment of the present application, it is first determined whether there are one or more debug containers in the container pool whose kernel version information is the same as the kernel version information of the kernel dump file, and then further screening is performed. If there is no debug container whose kernel version information is the same as the kernel version information of the kernel dump file, it is determined that the debugging environment provided by the debug container cannot be used to debug the kernel dump file, that is, the target debug container for debugging the kernel dump file has not been found in the container pool.
[0007] In one possible implementation, the method further includes: if the kernel version information of the kernel dump file is the same as the kernel version information corresponding to at least one debug container in the container pool, obtaining the kernel debug information of the at least one debug container; if the kernel dump file does not match the kernel debug information of each debug container in the at least one debug container, determining that the target debug container has not been found in the container pool. In an embodiment of the present application, when searching for a target debug container in the container pool, the kernel version information is only a preliminary screening. If it is necessary to determine a debug container that can provide a debugging environment for the kernel dump file, the kernel debug information needs to be further screened. The debug container obtained after the two screenings is the debug container that can provide a debugging environment for the kernel dump file. In this way, the target container that matches the kernel dump file can be quickly found among numerous debug containers, thereby improving the efficiency of debugging the kernel dump file and the efficiency of locating system failure problems.
[0008] In one possible implementation, the kernel version information corresponding to the target debug container is the same as the kernel version information of the kernel dump file, and the kernel debug information of the target debug container matches the kernel dump file. In this embodiment of the present application, finding a matching target debug container among multiple debug containers in the container pool requires matching kernel version information and kernel debug information. This search can quickly find the target debug container, thereby improving debugging efficiency and the efficiency of locating faults.
[0009] In one possible implementation, the target container information includes operating system information corresponding to the kernel dump file and kernel debugging information corresponding to the kernel dump file. In an embodiment of the present application, the operating system information can be used to obtain a container image file, thereby quickly building an initial container corresponding to the operating system information, and then building a debugging container based on the kernel debugging information. The method of building a debugging environment by obtaining the target container information is more efficient, eliminating the need for the user to manually build the debugging environment, thereby improving the debugging efficiency of debugging kernel dump files.
[0010] In one possible implementation, obtaining target container information includes: outputting prompt information for prompting a user to input the operating system information; and receiving the operating system information, wherein the operating system information includes an operating system type and an operating system version. In an embodiment of the present application, a user can interact with a platform for managing and debugging containers. When building a container, prompt information can be output in the user interface of the platform for managing and debugging containers, so that the computer device receives the operating system information input by the user for building the container. This method does not require manual installation, but only requires inputting the corresponding information to build the container, which is simple and convenient for the user.
[0011] In one possible implementation, the target debugging container is constructed according to the target container information, including: obtaining a container image file according to the operating system information, the container image file is used to construct a debugging container that matches the operating system information; constructing an initial container according to the container image file, and adding the kernel debugging information corresponding to the kernel dump file to the initial container to obtain the target debugging container. In an embodiment of the present application, an initial container that matches the operating system information can be obtained by installing the container image file, the kernel version information of the initial container matches the version information of the kernel dump file, and the kernel debugging information is added to the initial container, and the target debugging container obtained matches the debugging information of the kernel dump file, thereby completing the construction of the debugging environment and obtaining the target debugging container. In this way, the debugging container can be automatically constructed without the user having to manually construct the debugging container, saving time in constructing the debugging environment and realizing lightweight and fast construction of the debugging environment, which is conducive to improving debugging efficiency and improving the efficiency of locating system failure problems.
[0012] In a second aspect, an embodiment of the present application provides a debugging system, which may include: an instruction preprocessing layer, a container management layer, and a container pool; the container pool is used to store at least one debugging container; the instruction preprocessing layer is used to receive a debugging instruction and obtain a kernel dump file based on the debugging instruction; wherein the debugging instruction carries the kernel dump file or carries storage path information of the kernel dump file; the container management layer is used to search the container pool for a target debugging container that matches the kernel dump file based on the kernel dump file, and if the target debugging container is found in the container pool, call the target debugging container to debug the kernel dump file; the container management layer is further used to obtain target container information if the target debugging container is not found in the container pool, the target container information being used to construct a target debugging container that matches the kernel dump file; the container management layer is further used to construct a target debugging container based on the target container information, and call the target debugging container to debug the kernel dump file; and the container management layer is further used to add the target debugging container to the container pool.
[0013] In one possible implementation, the instruction preprocessing layer includes an instruction parsing module, a kernel information extraction module, and a request transmission module; the instruction parsing module is used to receive the debugging instruction, obtain the kernel dump file based on the debugging instruction, and transmit the debugging instruction to the kernel information extraction module; the kernel information extraction module is used to extract the kernel version information of the kernel dump file, and transmit the kernel dump file and the kernel version information of the kernel dump file to the request transmission module; the request transmission module is used to send a debugging request to the container management layer, the debugging request carrying the kernel version information of the kernel dump file and the kernel dump file, or the kernel version information of the kernel dump file and the storage path information.
[0014] In one possible implementation, the container management layer includes a container scheduling module and a container information database; the container scheduling module is configured to receive the debugging request from the instruction preprocessing layer, obtain kernel version information of the kernel dump file, and obtain kernel version information corresponding to each debugging container in the container pool; the container scheduling module is further configured to determine that the target debugging container is not found in the container pool if the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debugging container; and the container information database is configured to store the kernel version information corresponding to each debugging container in the container pool.
[0015] In one possible implementation, the container scheduling module is further configured to, if kernel version information of the kernel dump file is identical to kernel version information corresponding to at least one debug container in the container pool, obtain kernel debugging information of the at least one debug container; and, if the kernel dump file does not match the kernel debugging information of each debug container in the at least one debug container, determine that the target debug container is not found in the container pool.
[0016] In one possible implementation, the container management layer further includes a container orchestration management module; the container scheduling module is further configured to transmit the debugging request to the container orchestration management module if the target debugging container is not found in the container pool; the container orchestration management module is configured to obtain the target container information and construct a target debugging container based on the target container information; and the container scheduling module is configured to call the target debugging container to debug the kernel dump file.
[0017] In a possible implementation, kernel version information corresponding to the target debugging container is the same as kernel version information of the kernel dump file, and kernel debugging information of the target debugging container matches the kernel dump file.
[0018] In one possible implementation, the container orchestration management module is configured to construct a target debugging container based on the target container information, specifically to: obtain a container image file based on the operating system information, where the container image file is used to construct a debugging container matching the operating system information; construct an initial container based on the container image file, and add kernel debugging information corresponding to the kernel dump file to the initial container to obtain the target debugging container.
[0019] In a third aspect, an embodiment of the present application provides a debugging device, the debugging device comprising:
[0020] A receiving unit, configured to receive a debugging instruction and obtain a kernel dump file based on the debugging instruction; wherein the debugging instruction carries the kernel dump file or carries storage path information of the kernel dump file;
[0021] a searching unit, which searches, based on the kernel dump file, a container pool for a target debugging container that matches the kernel dump file, and if the target debugging container is found in the container pool, calls the target debugging container to debug the kernel dump file;
[0022] an acquiring unit, configured to acquire target container information if the target debugging container is not found in the container pool, wherein the target container information is used to construct a target debugging container that matches the kernel dump file;
[0023] A construction unit is configured to construct a target debugging container according to the target container information, and call the target debugging container to debug the kernel dump file.
[0024] In addition, in this aspect, other optional implementations of the channel transmission device can refer to the relevant content of the first aspect above and will not be described in detail here.
[0025] In a fourth aspect, an embodiment of the present application provides a chip comprising a memory and a processor, wherein the memory stores a computer program, the computer program comprises program instructions, and the processor is configured to execute the program instructions to implement the method described in the first aspect.
[0026] In a fifth aspect, an embodiment of the present application provides a computer device comprising a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect.
[0027] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed, the method described in the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0029] Figure 1 This is a schematic diagram of the system structure of a debugging system provided in an embodiment of the present application.
[0030] Figure 2 This is another system structure diagram of a debugging system provided in an embodiment of the present application.
[0031] Figure 3 It is a flowchart of a debugging method provided in an embodiment of the present application.
[0032] Figure 4 This is a user interface diagram of a debugging method provided in an embodiment of the present application.
[0033] Figure 5 This is another user interface diagram of a debugging method provided in an embodiment of the present application.
[0034] Figure 6 This is a schematic diagram of the architecture of a debugging system provided in an embodiment of the present application.
[0035] Figure 7 It is a flowchart of a debugging method provided in an embodiment of the present application.
[0036] Figure 8 It is a structural diagram of a debugging device provided in an embodiment of the present application.
[0037] Figure 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0039] The terms "first," "second," "third," and "fourth," etc., in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0040] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0041] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0042] As used in this specification, the terms "component," "module," "system," and the like are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. By way of illustration, both an application running on a computing device and a computing device can be a component. One or more components can reside in a process and / or an execution thread, and a component can be located on a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component on a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).
[0043] First, before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained to facilitate understanding by those skilled in the art. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0044] 1. Kernel Crash Dump
[0045] A kernel dump refers to the process of writing a kernel image to a file, using certain tools, when a kernel thread terminates execution by sending an error or receiving a signal. This is useful for later debugging. A kernel dump can be understood as the system generating a core file in a designated directory when a program crashes (e.g., due to a hardware error or kernel error). This core file is used for debugging within the corresponding debugging environment to locate information or the root cause of the kernel crash, error, or interrupt. The core can refer to, for example, the system's main memory.
[0046] It should be noted that the kernel dump saves the running status of the process at a certain moment. It is generated when a problem occurs in the process. Therefore, the file obtained by the kernel dump (i.e., the kernel dump file) can be debugged to understand the status of the process at the moment the kernel dump file is generated, thereby discovering the problem point to avoid the next program crash.
[0047] In the present application, a computer device may enable a function such as dumping memory operating parameters, or configure a service such as dumping memory operating parameters, so that the computer device can trigger an operation of dumping memory operating parameters when the system crashes, deadlocks, or freezes. For example, a server may configure a kernel dump service (kdump) that is used to dump memory and generate a kernel dump file when the server's system crashes.
[0048] 2. OS
[0049] An operating system (OS) is a set of interrelated system software programs that manage and control the operation of computer devices, utilize and run hardware and software resources, and provide public services to organize user interactions. Depending on the operating environment, OSes can be categorized as desktop OSes, mobile OSes, server OSes, and embedded OSes. It can be understood that an OS is part of the software stack. It is the first layer of software built on top of the hardware, serving as a bridge (or interface, middleman, or intermediary) between the hardware and other software. The OS also controls the execution of other programs, manages system resources, and provides basic computing functions, such as managing and allocating memory and prioritizing the supply and demand of system resources. It also provides essential service programs, such as the file system, device drivers, user interfaces, and system services.
[0050] In this application, the same type of OS may also include different versions. For example, the distribution of the Linux system may include RHEL, SLES and Ubuntu, etc., and Windows 7 and Windows 10 are different versions of the Windows system. Each distribution can be further divided into major versions and minor versions. The same or different OSes can be installed in different computer devices (such as servers). It is understandable that computer devices running different types of OSes generate different kernel dump files. Computer devices running the same type but different versions of OS also generate different kernel dump files.
[0051] It is understood that "operating system" or "OS" is merely a term used in this embodiment. Its meaning has been described in this embodiment, and its name does not constitute any limitation to this embodiment. In addition, in other embodiments of this application, "OS" may also be referred to as other terms such as "system".
[0052] 3. Kernel
[0053] The kernel refers to the core functional framework of the OS or the corresponding software, which is the basis for realizing all the functions of the software. Among them, the kernel also includes different versions. The so-called kernel version refers to the version number of the corresponding software kernel after various modifications or additions of corresponding functions. It should be noted that the above-mentioned OS version can be divided into two parts, namely the kernel version and the distribution version. The Linux distribution in the above example refers to a system version of the software that, in addition to providing the OS core, also includes other peripheral functional parts and human-computer interaction parts, such as C / C++ compilers, libraries, etc. The above-mentioned OS version refers to the distribution version. The kernel version refers to the core of the operating system, which is responsible for controlling hardware, managing file systems, program processes, etc., and does not provide users with versions of various tools and application software.
[0054] In this application, the major version and minor version of an OS distribution can have different kernel versions. The core dump files generated by computer devices running different kernel versions are also different.
[0055] 4. Debugging environment
[0056] Debugging refers to the process of using various methods to check and correct errors after a program is written. This involves identifying and correcting errors in computer hardware or software. It can also be understood as removing bugs from the code. The debugging environment is the environment used to debug the program. For example, debugging environments can be categorized as Windows, Linux, or DoS environments.
[0057] In this application, the kernel dump files generated by computer devices are different depending on the OS type, OS kernel version, etc., and the debugging environments required for debugging different kernel dump files are also different.
[0058] 5. Container
[0059] A container is a means of packaging an application or service and everything it needs to run, independent of the environment. It can be understood as a defined package that contains the program to be executed and all its dependencies, such as code and system libraries. This allows the application and its entire runtime environment (all the files required to run the application) to be packaged or isolated, so that the application can be migrated between different environments (such as development, test, and production environments) while retaining its full functionality.
[0060] In this application, containers can be used to deploy a debugging environment to debug kernel dump files. Different containers can debug different kernel dump files. Since multiple containers can be deployed on fewer virtual machines or physical machines, providing a debugging environment through containers helps reduce hardware resource usage.
[0061] It is understandable that in the embodiment of the present application, the container used to deploy the debugging environment can also be called a "debugging container", and its name does not constitute any limitation to this embodiment.
[0062] 6. Image file
[0063] An image file is a series of files that are formatted into a single file for easy download and use by users, such as an OS or a game. The image file can be stored in an image repository.
[0064] In this application, the image file can be a basic image file of the OS, which can be used to build a debugging environment for a kernel dump file, that is, a certain image file can be used to build a corresponding container that carries a debugging environment for a kernel dump file.
[0065] To facilitate understanding of the embodiments of the present application, the structure of one of the debugging systems on which the embodiments of the present application are based is described below.
[0066] See also Figure 1 , Figure 1 This is a schematic diagram of the system structure of a debugging system provided in an embodiment of the present application. Figure 1 As shown, the debugging system may include a first computer device 101, a second computer device 102, and a container information database 103. Both the first computer device 101 and the second computer device 102 may be computer devices with certain computing, storage, and communication resources. The container information database 103 may be a database that stores container identifiers and debugging environment information. The container information database 103 may also store information about kernel dump files that can be debugged by the debugging environment.
[0067] The first computer device 101 and the second computer device 102 can be, for example, terminal devices such as tablet computers, desktop computers, smart car terminals, laptop computers, and smart phones. The first computer device 101 and the second computer device 102 can also be servers, such as independent servers (such as central servers), server clusters or distributed systems composed of multiple physical servers, servers deployed in a cloud environment, and edge computing devices deployed in an edge environment. It is understandable that Figure 1 The first computer device 101 and the second computer device 102 are taken as servers for example for description and explanation, and the forms of the first computer device 101 and the second computer device 102 in the embodiment of the present application are not limited.
[0068] Specifically, first computer device 101 is a computer device that generates a kernel dump file, and second computer device 102 is a debugging device that can be used to debug the kernel dump file generated by first computer device 101. First computer device 101 can enable a function for dumping memory operating parameters, or configure a service for dumping memory operating parameters, such as the kdunp service. Then, when a hardware error or kernel error occurs on first computer device 101, the operation of dumping memory operating parameters is triggered, and the memory is dumped to obtain a kernel dump file. The kernel dump file generated by first computer device 101 is then exported and imported into second computer device 102 for debugging.
[0069] In one possible implementation, the second computer device 102 may be a physical machine having a debugging environment for debugging the kernel dump file of the first computer device 101, or may be a virtual machine including a debugging environment for hosting the debugging environment for debugging the kernel dump file of the first computer device 101. When the second computer device 102 receives an imported kernel dump file, it may debug the kernel dump file in the debugging environment of the kernel dump file.
[0070] In another possible implementation, the second computer device 102 may be a working node of a container cluster, which includes multiple debugging containers, each of which corresponds to a debugging environment. A debugging container may be deployed in the second computer device 102, such as the second computer device 102 may deploy a debugging container that provides a debugging environment for debugging a kernel dump file of the first computer device 101. Multiple debugging containers may also be deployed, such as the second computer device 102 may deploy a debugging container that provides a debugging environment for debugging a variety of different kernel dump files. One debugging environment may correspond to one debugging container. Specifically, the second computer device 102 may extract kernel version information based on the kernel dump file in the debugging instruction, and the kernel version information may include the kernel version corresponding to the kernel dump file, and then query the container information database 103 for a matching debugging container. If a matching debugging container is found, the kernel dump file is debugged in the debugging container.
[0071] Among them, when the second computer device 102 does not search for a matching debugging container in the container information database 103, the second computer device 102 can obtain the OS type, OS version and other information corresponding to the kernel dump file, and the second computer device 102 can construct a debugging container for the kernel dump file debugging environment. Specifically, the second computer device 102 can obtain the container image based on the OS type and OS version information, and construct a debugging container for the kernel dump file debugging environment based on the container image. Furthermore, the second computer device 102 can write the debugging container information of the constructed kernel dump file debugging environment into the container information database 103 for subsequent query. The second computer device 102 can also store the constructed debugging container in a container pool, which can store multiple debugging containers of kernel dump file debugging environments for subsequent call when debugging other kernel dump files.
[0072] It is understandable that Figure 1 The debugging system architecture is used as an example and does not limit the embodiments of the present application. Optionally, the first computer device 101 and the second computer device 102 can be the same device.
[0073] It should be noted that the computer device involved in this application (such as the first computer device 101 and the second computer device 102 mentioned above) can be a computer device or a module in a computer device, such as a chip or a processor.
[0074] The following is an introduction to another debugging system involved in an embodiment of the present application.
[0075] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a debugging system provided in an embodiment of the present application. Figure 2 As shown, the debugging system may include a first computer device 201, a second computer device 202, a container information database 203, and a node device cluster 204 consisting of one or more node devices. The first computer device 201, the second computer device 202, and each node device in the node device cluster 204 may all be computer devices with certain computing, storage, and communication resources. The container information database 203 may be a database that stores container identifiers and debugging environment information. The container information database 203 may also store information about kernel dump files that can be debugged by the debugging environment. Each node device in the node device cluster 204 may deploy multiple debugging containers for management and access by the second computer device 202.
[0076] The first computer device 201, the second computer device 202, and each node device in the node device cluster 204 can be a terminal device, such as a tablet computer, a desktop computer, an intelligent vehicle terminal, a laptop computer, a smart phone, etc. The first computer device 201, the second computer device 202, and the node device cluster 204 can also be a server, such as an independent server (such as a central server), a server cluster or a distributed system composed of multiple physical servers, a server deployed in a cloud environment, and an edge computing device deployed in an edge environment. It is understandable that Figure 2 The first computer device 201 is used as a terminal device, the second computer device 202 is used as a server, and each node device in the node device cluster 204 is used as a server for illustration and explanation. The forms of the first computer device 201, the second computer device 202, and the node devices in the node device cluster 204 in the embodiment of the present application are not limited.
[0077] Specifically, the first computer device 201 can be a user's computer device, through which the user can enter debugging instructions, which can include the path to the core dump file. The second computer device 202 can be a computer device that provides a user interface. That is, the second computer device 202 can provide a platform for managing various debugging containers. The second computer device 202 can also obtain information about each debugging container from the container information database 203 and output a user interface, so that the user can intuitively view the information of each debugging container from the user interface provided by the platform. Optionally, the second computer device 202 can also display user-triggered debugging instructions, that is, display one or more debugging tasks and information about the debugging tasks.
[0078] In one possible implementation, upon receiving a debugging instruction from first computer device 201, second computer device 202 extracts kernel version information for the kernel dump file based on the kernel dump file path in the debugging instruction and searches container information database 203 for a matching debugging container. If a matching debugging container is found, the kernel dump file is debugged in the debugging container. Specifically, second computer device 202 may invoke a debugging container deployed on a node device in node device cluster 204 to debug the kernel dump file. If second computer device 202 does not find a matching debugging container in container information database 203, second computer device 202 may obtain information such as the OS type and OS version corresponding to the kernel dump file, construct a debugging container for the kernel dump file's debugging environment, and deploy the constructed debugging container on a node device in node device cluster 204. Optionally, if multiple containers are already deployed on each node device in node device cluster 204, a new node device may be added to deploy the constructed container, enabling dynamic capacity expansion of the node device.
[0079] Furthermore, the second computer device 202 can write the debug container information for the kernel dump file debugging environment into the container information database 203 for subsequent querying. The second computer device 202 can also store the constructed debug container in a container pool for subsequent use when debugging other kernel dump files. The container pool can store multiple debug containers for the kernel dump file debugging environment, and the multiple debug containers in the container pool are respectively deployed by each node device in the node device cluster 204.
[0080] It is understandable that Figure 2 The debugging system architecture is used as an example and does not limit the embodiments of the present application. It should be noted that the computer devices involved in the present application (such as the first computer device 201, the second computer device 202, and each node device in the node device cluster 204) can be computer devices or modules in computer devices, such as chips or processors.
[0081] based on Figure 1 and Figure 2 The architecture of the debugging system provided by this application is combined with the debugging method provided in this application to analyze and solve the technical problems raised in this application. Figure 3 , Figure 3 1 is a flow chart of a debugging method provided in an embodiment of the present application. The method may include three stages.
[0082] Phase 1: The computer device extracts kernel version information from the kernel dump file.
[0083] S301: A computer device receives a debugging instruction for a kernel dump file.
[0084] The computer device can receive debugging instructions input by a user. For example, a user can directly input debugging instructions for a kernel dump file, where the debugging instructions include the kernel dump file or the path to the kernel dump file. For another example, a user can input debugging instructions through a user interface provided by a platform that manages a debugging container, where the debugging instructions include the path to the kernel dump file or the kernel dump file. Optionally, the user interface can also display usage help to assist the user in operating the platform that manages the debugging container.
[0085] In one possible implementation, a computer device can determine whether a debugging instruction entered by a user is incorrect, that is, whether the instruction is legal and compliant. For example, the computer device can determine whether the debugging instruction entered by the user contains formatting errors or other errors. If so, the computer device can output a prompt message to inform the user of the instruction error. Optionally, a correction suggestion can also be input to allow the user to modify the debugging instruction.
[0086] For example, please refer to Figure 4 , Figure 4 This is a user interface diagram of a debugging method provided in an embodiment of the present application. Figure 4 As shown, the user interface can be the user interface of the platform for managing the debugging container. The user interface can include a control for "debugging kernel dump files", a control for "querying debugging environment", and an interface for displaying debugging tasks. The interface for the debugging task can include information such as "task name", "task ID", "task description", "modifier", "modification time", "kernel version", and "operation". It is understandable that Figure 4 The interface of the debugging task is only an example and may also include other information, such as a container identifier, which is not limited in this application.
[0087] In one possible implementation, the computer device may trigger a kernel dump file debugging instruction in response to a user input instruction for a "debug kernel dump file" control. Furthermore, the computer device may output a user interface for prompting the user to input a kernel dump file, for example Figure 4 The box in the middle user interface may include a "core dump file path" input box and an "upload core dump file" input control, as well as a "save" control and a "cancel" control after the input is completed. Specifically, the user can enter the core dump file path and / or the core dump file in the input box and input control and trigger saving. Then, the computer device can obtain the core dump file path or core dump file input by the user in response to the save control.
[0088] Furthermore, the computer device may execute the debugging task, debug the kernel dump file in the debugging container corresponding to the debugging environment of the kernel dump file, and the computer device may provide a user interface including information about the debugging task for the user to view. Figure 4 As shown below, the debugging task may include information such as "Task Name" being "Debug Task," "Task ID" being "task-1," "Task Description" being blank, "Modifier" being an administrator, "Modification Time" being "2022.11.08 19:30:53," "Kernel Version" being "XX," and "Operations" including "Pause, Delete, Start, and Edit." Specifically, the debugging task may further display information such as "Kernel Dump File Path" being "D:\xx," "Execution ID" being "xxxxx," "OS Type" being "Linux," "OS Version being "Version A," "Debug Container Identifier" being "Debug Container 1," and "Status" being "Executing."
[0089] S302: The computer device extracts kernel version information from the kernel dump file.
[0090] Specifically, if the computer device determines that the debugging instruction input by the user is correct, it can extract the kernel version information of the kernel dump file. The kernel version information includes information about the kernel version corresponding to the kernel dump file. Specifically, if the debugging instruction carries the kernel dump file, the computer device can parse the kernel dump file to obtain the kernel version information. If the debugging instruction carries the path of the kernel dump file, the computer device can query the kernel dump file through the path of the kernel dump file, and then parse the kernel dump file to obtain the kernel version information. It is understandable that the kernel dump file is a binary file, and the computer device can obtain the kernel version information of the kernel dump file by parsing the binary file. Exemplarily, the platform for managing the debugging container in the computer device can be installed with a tool for parsing kernel dump files, such as a crash tool, which can parse the kernel dump file to obtain the kernel version information corresponding to the kernel dump file.
[0091] Phase 2: Match the debugging environment of the core dump file.
[0092] S303: The computer device searches the container information database for the debugging container corresponding to the kernel version information to obtain a debugging container list.
[0093] Among them, after determining the kernel version information of the kernel dump file, the computer device can query the debugging environment of the kernel dump file. The so-called debugging environment of the kernel dump file refers to an environment that can be used to debug the kernel dump file. Different kernel dump files have different debugging environments. The computer device can first query whether there is a matching debugging environment in the existing debugging container. If a matching debugging environment is found in the existing debugging environment, the computer device can debug the kernel dump file through the debugging container corresponding to the matching debugging environment. If a matching debugging environment is not found in the existing debugging environment, the computer device can build a debugging container for the debugging environment of the kernel dump file and debug the kernel dump file through the built debugging container.
[0094] Specifically, the computer device can query the container information database for debug containers corresponding to the kernel version information to obtain a debug container list. The container information database may store information such as the container identifier, kernel version information, debugging environment, OS type, OS version, and kernel debugging information for each of multiple debug containers. Therefore, based on the kernel version information of the kernel dump file, the computer device can query the container information database for debug containers that match the kernel version information. If a matching debug container is found, the query result may include one debug container or multiple containers, thus obtaining a debug container list.
[0095] S304: The computer device determines whether the debugging container list is empty.
[0096] The computer device determines whether the debug list is empty based on whether the query result includes a debug container. If the query result does not include a debug container, the computer device determines that the debug list is empty. Conversely, if the query result includes at least one debug container, the computer device determines that the debug list is not empty.
[0097] S305: If the debugging container list is not empty, the computer device queries whether the kernel dump file matches the kernel debugging information of each debugging container in the debugging container list.
[0098] It should be noted that kernel dump files generated based on different OS versions (i.e., different distribution versions) are different, but the kernel versions of different OS versions (i.e., different distribution versions) may be the same. Similarly, among the many debug containers that have been built, there are debug containers with the same kernel version but different OS versions (i.e., different distribution versions). If the debug container list obtained by the computer device from the container information database is not empty, it is necessary to further match the debug containers in the debug container list with the kernel dump file to determine the debug container that matches the kernel dump file.
[0099] Specifically, the computer device can query whether the kernel dump file matches the kernel debugging information of each debug container in the debug container list. The kernel debugging information can be a debug file that is installed when the computer device builds the debug container and is used to debug the kernel dump file. The kernel debugging information can be understood as a symbol table. Since the kernel dump file is a binary file, it can include information that the computer device cannot debug during direct debugging. The kernel debugging information can be equivalent to converting the characters in the kernel dump file into information that the computer device can debug, similar to translating the characters in the kernel dump file into information that the computer device can debug, so that the computer device can debug the kernel dump file.
[0100] S306: The computer device determines whether the kernel dump file matches the kernel debugging information.
[0101] In one possible implementation, a computer device can control each debug container in a debug container list to debug the kernel dump file. If debugging is possible, it proves that the kernel debugging information of the debug container matches the kernel dump file, and the debugging environment of the debug container matches the kernel dump file. The debug container can then be selected to enter the kernel dump file debugging process. If multiple debug containers in the debug container list can debug the kernel dump file, a debug container can be randomly selected from the debug containers that can debug to enter the kernel dump file debugging process. In the container information database, each debug container is installed with a debugging tool capable of debugging a specific kernel dump file type, such as a crash tool. Optionally, the crash tool can be different in different debug containers. The computer device can then attempt to debug and analyze the kernel dump file by invoking the debugging tool in each debug container in the debug container list, thereby determining whether it matches the kernel dump file. Optionally, the computer device invoking the debugging tool in the debug container can include sending a crash command related to debugging the kernel dump file to each debug container in the debug container list, or other methods, which are not limited in this application.
[0102] S307: When the debugging container list is empty, the computer device obtains the OS type, OS version, and corresponding kernel debugging information.
[0103] In one possible implementation, if a computer device fails to find a debug container corresponding to kernel version information when searching a container information database for a debug container corresponding to kernel version information, or if kernel debug information of each debug container in a debug container list does not match a kernel dump file, the computer device may construct a debug container for a kernel dump file debugging environment, and the computer device may obtain the OS type, OS version, and corresponding kernel debug information used to construct the debug container. The computer device may output information in a provided user interface prompting a user to input the OS type, OS version, and kernel debug file for constructing the debug environment, so as to facilitate the acquisition.
[0104] For example, please refer to Figure 5 , Figure 5 This is another user interface diagram of a debugging method provided in an embodiment of the present application. Figure 5 As shown, the prompt information can be a user interface for constructing debugging information, which includes an input control for inputting an OS type, an input control for inputting an OS version, and a control for uploading a kernel debugging file, as well as a "Save" control and a "Cancel" control. Optionally, the kernel debugging file can be a file or other means, such as the path of the kernel debugging file. Figure 5 The kernel debugging information is explained and illustrated in the form of a debugging file as an example, but this is not limited to this.
[0105] Optionally, the user may not upload the kernel debugging file. The computer device may obtain the corresponding kernel debugging file according to the OS type, OS version and kernel version information to obtain the kernel debugging information. Specifically, the user may select Figure 5 Enter the OS type and OS version in the user interface shown, and you can also upload a kernel debugging file. The computer device can obtain the corresponding container image and kernel debugging information based on the OS type and OS version, and build a debugging container for the debugging environment of the kernel dump file based on the container image and kernel debugging information.
[0106] S308: The computer device obtains the container image corresponding to the OS type and OS version and builds a debugging environment.
[0107] In one possible implementation, a computer device can obtain a corresponding container image file from an image repository based on the OS type and OS version. The container image file can be a base image, which is an existing image file for the OS type and OS version. For example, the computer device can install the container image file to obtain an initial container. Furthermore, the computer device can install kernel debugging information and debugging information in the initial container to obtain a debugging container, wherein the computer device can obtain the kernel debugging file corresponding to the OS type and OS version from a public database to obtain kernel debugging information. For example, the computer device can transfer the kernel debugging file of the kernel debugging information into the initial container and install it, and install debugging tools, such as a crash tool, etc., to obtain a debugging container for the debugging environment of the kernel dump file, wherein the debugging tool can be used to call the kernel debugging information to debug the kernel dump file.
[0108] Furthermore, after constructing the debugging container of the debugging environment of the kernel dump file, the container identifier of the debugging container can be determined, and the container identifier of the debugging container and the information of the debugging container can be written into the above-mentioned container information database for subsequent calls. Among them, the information of the debugging container can include the kernel version information, OS type, OS version, kernel debugging information and the mapping information of the container identifier of the debugging container written into the container information database, that is, the container information database stores a mapping table of the container identifier of each debugging container in multiple debugging containers and the information of the debugging container for subsequent queries. For example, if the debugging container of a certain debugging environment is queried in the container information data table, the kernel version information of the kernel dump file can also be queried when the kernel dump file needs to be debugged. It can be understood that each debugging container may correspond to one or more records. This is because the kernel version corresponding to the same OS version (i.e., release version) can be multiple.
[0109] After the construction is completed, the computer device can attempt to debug the kernel dump file using the constructed debugging container. If the constructed debugging container can debug the kernel dump file, it is determined that the debugging container is successfully built, and the debugging environment corresponding to the constructed debugging container can be determined as the matching debugging environment.
[0110] Phase 3: Debug the core dump file in a matching debugging environment.
[0111] S309: When the kernel dump file matches the kernel debugging information, the computer device selects a matching debugging container to enter a debugging process for the kernel dump file.
[0112] In one possible implementation, a computer device may select a matching debug container to perform a kernel dump file debugging process. This debug container may be one of multiple debug containers pre-set in a container information database, or a newly constructed debug container. The computer device may then invoke this debug container to debug the kernel dump file and obtain a debugging result.
[0113] S310. The computer device debugs the kernel dump file.
[0114] Specifically, the computer device can send a crash command to the debug container. This crash command is used to invoke the debug container to debug the kernel dump file. A kernel dump file can be understood as a snapshot at the time of a kernel failure. This snapshot can record information at the time of the kernel failure. Debugging can be understood as an information query operation, namely, querying the kernel dump file for corresponding information based on different debug commands input. For example, the kernel dump file may include objects and register information called by kernel thread A at the time of the kernel failure. During the debugging process, the computer device can receive a debug command for querying the objects called by kernel thread A at the time of the kernel failure. This debug command can be user-inputted, for example, by inputting the corresponding debug command based on the information the user wishes to query. This debug command can also be triggered by the computer device, which triggers the commands sequentially according to a preset debug command triggering sequence. The computer device can then retrieve the debug results from the kernel dump file, namely, the objects called by kernel thread A at the time of the kernel failure. The user can then analyze the cause of the kernel failure based on the debug results.
[0115] Optionally, the user can enter a command to pause debugging, such as Figure 4 The triggering of the "Pause" control in the "Action" shown is used to pause the debugging of the core dump file. The user can also enter a command to pause debugging, such as Figure 4 The "Delete" control in the "Operation" section shown here deletes debugging of the core dump file. Optionally, after debugging is complete, the user can enter an exit command to exit debugging. For example, after the computer device outputs the debugging results in a user interface, it can receive an exit command entered by the user in the user interface, such as shutting down the platform that manages the debugging container, thereby exiting debugging.
[0116] In the embodiments of the present application, on the one hand, different debugging containers are used to provide debugging environments for different types of kernel dump files, which can be achieved with only a small number of virtual machines or physical machines, and can meet the debugging requirements of debugging various types of kernel dump files, reducing the occupation of hardware resources and saving hardware resources. On the other hand, users do not need to manually install kernel debugging information (kernel debugging files) and debugging tools in virtual machines or physical machines, but can directly obtain container images through computer devices and automatically install them, saving time in building a debugging environment, achieving lightweight and rapid construction of a debugging environment, thereby improving debugging efficiency and improving the efficiency of locating system failure problems.
[0117] based on Figure 3 The process of the debugging method provided in this application is combined with the architecture of the debugging method provided in this application to specifically analyze and solve the technical problems raised in this application. Figure 6 , Figure 6 This is a schematic diagram of the architecture of a debugging system provided in an embodiment of the present application.
[0118] like Figure 6 As shown, the debugging system can be logically divided into three layers: an instruction pre-processing layer 61 , a container management layer 62 , and a container pool 63 .
[0119] The so-called instruction preprocessing layer 61 is used to receive debug instructions 60 and obtain a core dump file based on the debug instructions 60. The debug instructions 60 include the core dump file or the storage path information of the core dump file. The instruction preprocessing layer 61 is also used to preprocess user-entered instructions. For example, it can be used to determine whether the user-entered debug instructions 60 are incorrect or legal, and can also be used to extract kernel version information from the core dump file.
[0120] The instruction preprocessing layer 61 includes three modules: an instruction parsing module 611, a kernel information extraction module 612, and a request transmission module 613. The instruction parsing module 611 is configured to receive the debug instruction 60. After receiving the debug instruction 60, it obtains a kernel dump file based on the debug instruction 60 and parses the debug instruction 60 to determine whether the debug instruction 60 is incorrect. If the instruction parsing module 611 determines that the debug instruction 60 is correct, it transmits the debug instruction to the kernel information extraction module 612. The kernel information extraction module 612 is configured to extract kernel version information from the kernel dump file. Specifically, the kernel information extraction module 612 parses the kernel dump file indicated in the debug instruction 60 to obtain the kernel version information of the kernel dump file. The kernel dump file may be carried in the debug instruction 60 or indicated by the kernel dump file path carried in the debug instruction 60. Furthermore, the kernel information extraction module 612 transmits the kernel dump file and the kernel version information of the kernel dump file to the request transmission module 613. The request transmission module 613 can send a debugging request to the container management layer 62. The debugging request can be used to query the debugging container of the debugging environment of the kernel dump file. The debugging request can carry the kernel version information and the kernel dump file, or the request can carry the kernel version information and the storage path information of the kernel dump file.
[0121] The container management layer 62 is used to orchestrate and manage each debug container, receive commands from the upper layer, and schedule debug containers in the container pool 63 to execute debug instructions 60. That is, the container management layer 62 can be understood as being responsible for scheduling debug containers that match the debugging environment of the kernel dump file. Specifically, the container management layer can be used to search the container pool for a target debug container that matches the kernel dump file based on the kernel dump file. If a target debug container is found in the container pool, the target debug container is invoked to debug the kernel dump file. If the target debug container is not found in the container pool, the container management layer is also used to obtain target container information. The target container information is used to construct a target debug container that matches the kernel dump file. The container management layer is also used to construct a target debug container based on the target container information and invoke the target debug container to debug the kernel dump file. The container management layer is also used to add the target debug container to the container pool.
[0122] The container management layer 62 includes three modules: a container orchestration management module 621, a container information database 622, and a container scheduling module 623. The container scheduling module 623 is configured to receive a debugging request sent by the request transmission module 613 of the instruction pre-processing layer 61. The container scheduling module 623 then searches the container pool 63 for a target debugging container that matches the kernel dump file. Specifically, the container scheduling module 623 can obtain the kernel version information of the kernel dump file and the kernel version information corresponding to each debugging container in the container pool. The kernel version information corresponding to each debugging container in the container pool can be obtained from the container information database 622. Based on the kernel version information of the kernel dump file, the container scheduling module 623 can query the container information database 622 for a debugging container that corresponds to the kernel version information, i.e., a debugging container with the same kernel version information. If at least one debugging container in the container pool 63 is found to have the same kernel version information as the kernel version information, a debugging container list is obtained, which includes the at least one debugging container. The kernel debugging information of each debugging container included in the debugging container list is further checked to see whether it matches the kernel dump file. Specifically, the container scheduling module 623 obtains the kernel debugging information of the at least one debugging container, matches the obtained kernel debugging information with the kernel dump file, and if there is a debugging container whose kernel dump file matches the kernel debugging information, the container scheduling module 623 determines that a target debugging container is found in the container pool 63, and then the container scheduling module 623 can call the matching debugging container (i.e., the target debugging container) to perform the debugging process of the kernel dump file.
[0123] If the container scheduling module 623 does not find kernel version information that matches the kernel version information in the container information database 622 based on the kernel version information, that is, if the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debug container, that is, the debug container list is empty, the container scheduling module 623 determines that the target debug container has not been found in the container pool. Alternatively, if the container scheduling module 623 searches for a kernel dump file in each debug container included in the debug container list and finds no match between the kernel debug information and the kernel dump file, the container scheduling module 623 determines that the target debug container has not been found in the container pool. Furthermore, the container scheduling module 623 sends the debug request to the container orchestration management module 621, which constructs a debug container for the debug environment of the kernel dump file. The container orchestration management module 621 receives the debug request carrying the kernel version information and obtains the target container information, which includes operating system information, including the OS type and OS version of the kernel dump file, and kernel debug information. For example, a user interface can be output to allow the user to input the above-mentioned OS type, OS version and kernel debugging information. Then, the container orchestration management module 621 can obtain the corresponding container image file from the image warehouse 620 according to the OS type and OS version and install it to obtain an initial container. The container image file is used to build a debugging container that matches the operating system information. Then, the kernel debugging information is added to the initial container. For example, the debugging tool and kernel debugging information can be installed to obtain the debugging container (i.e., the target debugging container) of the debugging environment of the kernel dump file and the constructed debugging container (i.e., the target debugging container) is added to the container pool 63.
[0124] Furthermore, the container orchestration management module 621 may write the debugging container information into the container information database 622 and feed back a message of successful construction to the container scheduling module 623. Optionally, the container scheduling module 623 may determine whether the kernel dump file matches the kernel debugging information of the constructed debugging container. If so, the constructed debugging container is selected to debug the kernel dump file (for example, a crash command is sent to the matching debugging container in the container pool 63).
[0125] The so-called container pool 63 is used to store at least one debug container, each corresponding to a kernel dump file debugging environment. The debug containers in the container pool 63 are managed by the container management layer 62. When the computer device starts, all debug containers in the container pool 63 are started simultaneously. As the types of kernel dump files increase, the number of debug containers in the container pool 63 will also increase. For example, the container pool 63 includes debug container 631, debug container 632, debug container 633, debug container 634, debug container 635, and debug container n. The container pool 63 may include pre-built debug containers, such as debug containers for mainstream OS types and OS versions. Exemplary pre-built debug containers may include: RHEL7.6 container, RHEL7.5 container, SLES11SP4 container, SLES12SP2 container, Ubuntu18.04.5 container, Ubuntu20.04.1 container, and so on. The container orchestration management module 621 can batch-acquire mainstream OS types and OS versions as well as kernel debugging information, batch-build debugging containers and add them to the container pool 63. The container orchestration management module 621 can also build a debugging container for a certain type of kernel dump file and add it to the container pool 63 after receiving a debugging instruction.
[0126] In the embodiments of the present application, on the one hand, different debugging containers are used to provide debugging environments for different types of kernel dump files, which can be achieved with only a small number of virtual machines or physical machines, and can meet the debugging requirements of debugging various types of kernel dump files, reducing the occupation of hardware resources and saving hardware resources. On the other hand, users do not need to manually install kernel debugging information (kernel debugging files) and debugging tools in virtual machines or physical machines, but can directly obtain container images through computer devices and automatically install them, saving time in building a debugging environment, achieving lightweight and rapid construction of a debugging environment, thereby improving debugging efficiency and improving the efficiency of locating system failure problems.
[0127] Please also refer to Figure 7 , Figure 7 7 is a flowchart of a debugging method provided in an embodiment of the present application. The method may include the following steps S701 to S705.
[0128] S701: A computer device receives a debugging instruction and obtains a core dump file based on the debugging instruction.
[0129] In an embodiment of the present application, a debugging instruction is used to instruct a computer device to debug a kernel dump file. The debugging instruction carries a kernel dump file or carries storage path information of a kernel dump file. A kernel dump file is a file used to store the running status of a process at that moment when a kernel process crashes. The storage path information of a kernel dump file may include a storage path of the kernel dump file, such as a file path. Optionally, the storage path may be a local storage path of the computer device or a cloud storage path, such as a download link, etc., which is not limited by the present application.
[0130] In one possible implementation, the debugging instructions received by the computer device may be input by a user through a user interface provided by a platform that manages the debugging container. The debugging instructions received by the computer device may be input by the user through code. Therefore, the computer can verify the received debugging instructions to determine whether they are incorrect. If the debugging instructions are incorrect, a prompt message is output to alert the user. This prompt message may indicate that the user input was incorrect or may provide information such as user help to facilitate user operation.
[0131] Upon receiving the debugging instruction, the computer device may directly obtain the kernel dump file included in the debugging instruction. The computer device may also obtain the kernel dump file based on the kernel dump file's storage path. For example, when the storage path information includes a local storage path of the computer device, the computer device may obtain the kernel dump file from a local file. When the storage path information includes a cloud download address of the computer device, the computer device may obtain the kernel dump file based on the download address.
[0132] S702: Based on the kernel dump file, the computer device searches a container pool for a target debugging container that matches the kernel dump file.
[0133] In an embodiment of the present application, a container pool stores multiple debug containers, each of which can be used to debug different kernel dump files, corresponding to different OS systems and OS versions. The kernel version information of each debug container can be the same. Optionally, at least one debug container in the container pool can have the same OS system, OS version, and kernel version information, that is, at least one debug container in the container pool can be used to debug the same kernel dump file.
[0134] In one possible implementation, a computer device obtains kernel version information of a kernel dump file and kernel version information corresponding to each debugging container in a container pool. The computer device searches the container pool for a target debugging container that matches the kernel dump file. The computer device may first determine whether the kernel version information of the kernel dump file is the same as the kernel version information corresponding to each debugging container in the container pool. If the kernel version information of the kernel dump file is the same as the kernel version information corresponding to at least one debugging container in the container pool, the computer device may further perform a match. If they are not the same, that is, the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debugging container, the computer device may determine that the target debugging container is not found in the container pool.
[0135] Furthermore, if the kernel version information of a kernel dump file is the same as the kernel version information corresponding to at least one debug container in the container pool, the kernel debugging information of the at least one debug container can be obtained. The computer device can further match the kernel dump file with the kernel debugging information of each debug container in the at least one debug container obtained by the preliminary matching, and then determine whether the kernel dump file matches the kernel debugging information of each debug container in the at least one debug container obtained by the preliminary matching based on the matching result, and then determine whether there is a target debug container in the container pool that matches the kernel dump file based on the matching result.
[0136] The computer device can obtain the kernel version information of the debug container, for example, by querying the kernel version information of each debug container in a container information database that stores the container information of the debug container. The computer device can query the kernel version information of the kernel dump file by inputting a query command, and then the computer device can compare the two to determine whether they are the same. The computer device can also use preset debugging instructions in at least one debug container obtained through preliminary matching to debug the kernel dump file. If the kernel dump file can be debugged, it is determined that the kernel dump file matches the kernel debugging information of the debug container; otherwise, it does not match. The preset debugging instructions can be debugging instructions pre-stored by the computer device for debugging attempts. The preset debugging instructions are only used to determine whether the debug container and the kernel dump file match, and are not for subsequent attempts.
[0137] S703: If the computer device finds the target debugging container from the container pool, it calls the target debugging container to debug the kernel dump file.
[0138] In one possible implementation, when a computer device searches a container pool for a target debug container, if the kernel version information of a kernel dump file is the same as the kernel version information corresponding to at least one debug container in the container pool, the computer device may obtain the kernel debug information of the at least one debug container. The computer device may further match the kernel dump file with the kernel debug information of each debug container in the at least one debug container obtained through the preliminary matching. If a debug container matches the kernel version information of the kernel dump file, the matching debug container may be used as the found target debug container. It is understood that the kernel version information corresponding to the target debug container is the same as the kernel version information of the kernel dump file, and the kernel debug information of the target debug container matches the kernel dump file.
[0139] Furthermore, if the computer device finds the target container in the container pool, it can call the target debug container to debug the kernel dump file. The computer device can call the target debug container to debug the kernel dump file, and the debug container provides a debugging environment for the kernel dump file. For example, the computer device can receive a user-entered debug command, such as a crash command, by calling the target debug container. Based on the debug command, the computer device can obtain information corresponding to the debug command in the kernel dump file, thereby obtaining a debugging result.
[0140] S704: If the computer device fails to find the target debugging container in the container pool and determines that the container information of the kernel dump file and the preset debugging container do not meet a matching condition, the computer device obtains target container information.
[0141] In one possible implementation, if the kernel dump file does not match the kernel debugging information of each debug container in the at least one debug container obtained through preliminary matching, the computer device may determine that the target debug container has not been found in the container pool. Furthermore, if the computer device determines that the target debug container has not been found in the container pool, the computer device may construct a debug container for debugging the kernel dump file.
[0142] In another possible implementation, the computer device may determine whether a target debug container matching the kernel dump file exists in the at least one debug container obtained through preliminary matching. If so, the computer device finds the target debug container from the container pool. Conversely, if a target debug container matching the kernel dump file does not exist in the at least one debug container obtained through preliminary matching, the computer device determines that the target debug container has not been found in the container pool. Furthermore, the computer device may construct a debug container as the target debug container to debug the kernel dump file.
[0143] Specifically, during the process of building a target debugging container, the computer device may obtain target container information, which includes operating system information corresponding to the kernel dump file and kernel debugging information corresponding to the kernel dump file. The operating system information may include the OS type and OS version corresponding to the kernel dump file. The computer device may obtain a container image file based on the operating system information, and use the container image file to build a debugging container that matches the operating system information. The computer device may then build an initial container based on the container image file and add the kernel debugging information corresponding to the kernel dump file to the initial container to obtain the target debugging container.
[0144] The computer device may output a prompt in a provided user interface for prompting the user to enter operating system information. The user interface may include an input box for entering operating system information, and the user may then enter operating system information, such as OS type and OS version, in the input box. Optionally, the user may also directly upload the container image file corresponding to the operating system information. The computer device receives the operating system information entered by the user and obtains the container image file based on the operating system information.
[0145] In one possible implementation, the container image file can be obtained by the computer device from the image repository based on the operating system information, or it can be obtained by other means, and this application does not limit this. Among them, the image repository can be a database for storing multiple public image files, and the multiple image files stored in the image repository can be container image files corresponding to different operating system information. The kernel debugging information can be kernel debugging information corresponding to the operating system information obtained from a database of relevant kernel debugging information, and the database of kernel debugging information can include kernel debugging information corresponding to different operating system information. Furthermore, the computer device can build an initial container based on the container image file, and the initial container is a debugging container that matches the operating system information. Then, the computer device can add the kernel debugging information corresponding to the kernel dump file to the initial container to obtain the target debugging container.
[0146] S705: The computer device constructs a target debugging container according to the target container information, and calls the target debugging container to debug the kernel dump file.
[0147] In one possible implementation, a computer device may install a container image file to obtain an initial container, which is a debugging container that matches the operating system information corresponding to the kernel dump file. That is, the kernel version information of the initial container is the same as the kernel version information of the kernel dump file. Furthermore, to make the kernel debugging information of the debugging container (initial container) match the kernel dump file, the kernel debugging information corresponding to the kernel dump file may be added to the initial container to achieve a match between the kernel dump file and the kernel debugging information of the debugging container. The computer device can then use the initial container after the kernel debugging information is added as the target debugging container.
[0148] Optionally, after building the debugging container, the computer device may call the built debugging container to attempt to debug the kernel dump file. If the built debugging container can debug the kernel dump file, the computer device determines that the built debugging container is the target debugging container.
[0149] Furthermore, the computer device can determine the container identifier of the debug container and write the corresponding container identifier of the target debug container and the container information of the debug container into the container information database for subsequent invocation. In addition to the target container information, the container information can also include kernel version information, node device information where the target debug container is deployed, and so on.
[0150] In a possible implementation, the computer device may call the target debugging container to debug the kernel dump file, that is, the computer device may receive a debugging command input by a user, and query corresponding information from the kernel dump file according to the debugging command, thereby obtaining a debugging result.
[0151] Furthermore, the computer device may also receive an exit instruction input by the user to exit debugging. After receiving the exit instruction, the computer device exits the debugging, for example, the platform managing the debugging container may be closed.
[0152] In the embodiments of the present application, on the one hand, different debugging containers are used to provide debugging environments for different types of kernel dump files, which can be achieved with only a small number of virtual machines or physical machines, and can meet the debugging requirements of debugging various types of kernel dump files, reducing the occupation of hardware resources and saving hardware resources. On the other hand, users do not need to manually install kernel debugging information (kernel debugging files) and debugging tools in virtual machines or physical machines, but can directly obtain container images through computer devices and automatically install them, saving time in building a debugging environment, achieving lightweight and rapid construction of a debugging environment, thereby improving debugging efficiency and improving the efficiency of locating system failure problems.
[0153] Please also refer to Figure 8 , Figure 8 It is a structural diagram of a debugging device provided in an embodiment of the present application. Figure 8 The debugging device 800 shown may include: a receiving unit 801, a searching unit 802, an acquiring unit 803, a constructing unit 804, and a determining unit 805, wherein each unit is described in detail as follows:
[0154] The receiving unit 801 is configured to receive a debugging instruction and obtain a kernel dump file based on the debugging instruction; wherein the debugging instruction carries the kernel dump file or carries storage path information of the kernel dump file;
[0155] A searching unit 802 is configured to search a container pool for a target debugging container that matches the kernel dump file based on the kernel dump file, and if the target debugging container is found in the container pool, invoke the target debugging container to debug the kernel dump file.
[0156] An acquiring unit 803 is configured to acquire target container information if the target debugging container is not found in the container pool, wherein the target container information is used to construct a target debugging container that matches the kernel dump file;
[0157] The construction unit 804 is configured to construct a target debugging container according to the target container information, and call the target debugging container to debug the kernel dump file.
[0158] In a possible implementation, the obtaining unit 803 is further configured to: obtain kernel version information of the kernel dump file and kernel version information corresponding to each debugging container in the container pool;
[0159] The determining unit 805 is configured to determine that the target debugging container is not found in the container pool if the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debugging container.
[0160] In a possible implementation, the acquiring unit 803 is further configured to: if the kernel version information of the kernel dump file is the same as the kernel version information corresponding to at least one debugging container in the container pool, acquire kernel debugging information of the at least one debugging container;
[0161] The determining unit 805 is further configured to determine that the target debugging container is not found in the container pool if the kernel dump file does not match the kernel debugging information of each debugging container in the at least one debugging container.
[0162] In a possible implementation, kernel version information corresponding to the target debugging container is the same as kernel version information of the kernel dump file, and kernel debugging information of the target debugging container matches the kernel dump file.
[0163] In a possible implementation, the target container information includes operating system information corresponding to the kernel dump file and kernel debugging information corresponding to the kernel dump file.
[0164] In a possible implementation, the acquiring unit 803 is configured to acquire target container information, specifically to:
[0165] Outputting prompt information for prompting the user to input the operating system information;
[0166] The operating system information is received, where the operating system information includes an operating system type and an operating system version.
[0167] In a possible implementation, the construction unit 804 is configured to construct a target debugging container according to the target container information, specifically to:
[0168] Obtaining a container image file according to the operating system information, wherein the container image file is used to build a debugging container matching the operating system information;
[0169] An initial container is constructed according to the container image file, and kernel debugging information corresponding to the kernel dump file is added to the initial container to obtain the target debugging container.
[0170] It should be noted that the functions of the various functional units in the debugging device 800 described in the embodiment of the present application can be found in the above Figure 7 The relevant descriptions of S701-S705 in the above method embodiment are not repeated here.
[0171] The present application also discloses a computer device. Figure 9 The computer device may include at least a processor 901, a communication interface 902, and a computer storage medium 903. The processor 901, the communication interface 902, and the computer storage medium 903 in the computer device may be connected via a bus or other means.
[0172] The above-mentioned computer storage medium 903 is a memory device in a computer device, which is used to store programs and data. It is understandable that the computer storage medium 903 here can include both the built-in storage medium of the computer device and, of course, the extended storage medium supported by the computer device. The computer storage medium 903 provides a storage space, which stores the operating system of the computer device. In addition, one or more instructions suitable for being loaded and executed by the processor 901 are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory; optionally, it can also be at least one computer storage medium away from the aforementioned processor. The aforementioned processor can be called a central processing unit (CPU), which is the core and control center of the computer device, suitable for implementing one or more instructions, specifically loading and executing one or more instructions to achieve the corresponding method flow or function.
[0173] In one embodiment, the processor 901 may load and execute one or more first instructions stored in a computer storage medium to implement the corresponding steps of the method in the above-mentioned content push method embodiment. In a specific implementation, the processor 901 loads one or more first instructions in the computer storage medium and performs the following operations:
[0174] receiving a debugging instruction, and obtaining a kernel dump file based on the debugging instruction; wherein the debugging instruction carries the kernel dump file, or carries storage path information of the kernel dump file;
[0175] Based on the kernel dump file, searching a container pool for a target debugging container that matches the kernel dump file; if the target debugging container is found in the container pool, calling the target debugging container to debug the kernel dump file;
[0176] If the target debugging container is not found in the container pool, obtaining target container information, where the target container information is used to construct a target debugging container that matches the kernel dump file;
[0177] A target debugging container is constructed according to the target container information, and the target debugging container is called to debug the kernel dump file.
[0178] In one implementation, the processor 901 loads and executes one or more first instructions stored in a computer storage medium and is further configured to perform the following steps:
[0179] Obtain kernel version information of the kernel dump file and kernel version information corresponding to each debugging container in the container pool;
[0180] If the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debugging container, it is determined that the target debugging container is not found in the container pool.
[0181] In one implementation, the processor 901 loads and executes one or more first instructions stored in a computer storage medium and is further configured to perform the following steps:
[0182] If the kernel version information of the kernel dump file is the same as the kernel version information corresponding to at least one debugging container in the container pool, obtaining kernel debugging information of the at least one debugging container;
[0183] If the kernel dump file does not match the kernel debugging information of each debugging container in the at least one debugging container, it is determined that the target debugging container is not found in the container pool.
[0184] In one implementation, kernel version information corresponding to the target debugging container is the same as kernel version information of the kernel dump file, and kernel debugging information of the target debugging container matches the kernel dump file.
[0185] In one implementation, the target container information includes operating system information corresponding to the kernel dump file and kernel debugging information corresponding to the kernel dump file.
[0186] In one implementation, the processor 901 loads and executes one or more first instructions stored in a computer storage medium to obtain target container information, specifically to:
[0187] Outputting prompt information for prompting the user to input the operating system information;
[0188] The operating system information is received, where the operating system information includes an operating system type and an operating system version.
[0189] In one implementation, the processor 901 loads and executes one or more first instructions stored in a computer storage medium to construct a target debugging container according to the target container information, specifically to:
[0190] Obtaining a container image file according to the operating system information, wherein the container image file is used to build a debugging container matching the operating system information;
[0191] An initial container is constructed according to the container image file, and kernel debugging information corresponding to the kernel dump file is added to the initial container to obtain the target debugging container.
[0192] The specific implementation of each step executed by the above-mentioned processor 901 in the embodiment of the present application can refer to the description of the relevant content in the above-mentioned embodiment, and can also achieve the same technical effect, which will not be repeated here.
[0193] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. A processor runs the computer program, so that the computer device executes the method provided in the aforementioned embodiment.
[0194] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in the aforementioned embodiment.
[0195] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0196] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0197] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0198] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] In addition, the functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0200] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to execute all or part of the steps of the above-mentioned methods of each embodiment of the present application. Among them, the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviated: ROM) or random access memory (Random Access Memory, abbreviated: RAM) and other media that can store program codes.
[0201] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A debugging method, characterized in that: include: receiving a debugging instruction, and obtaining a kernel dump file based on the debugging instruction; wherein the debugging instruction carries the kernel dump file, or carries storage path information of the kernel dump file; Based on the kernel dump file, searching a container pool for a target debugging container that matches the kernel dump file; if the target debugging container is found in the container pool, calling the target debugging container to debug the kernel dump file; kernel version information corresponding to the target debugging container is the same as kernel version information of the kernel dump file, and kernel debugging information of the target debugging container matches the kernel dump file; If the target debugging container is not found in the container pool, obtaining target container information, where the target container information is used to construct a target debugging container that matches the kernel dump file; A target debugging container is constructed according to the target container information, and the target debugging container is called to debug the kernel dump file.
2. The method according to claim 1, characterized in that The method further comprises: Obtain kernel version information of the kernel dump file and kernel version information corresponding to each debugging container in the container pool; If the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debugging container, it is determined that the target debugging container is not found in the container pool.
3. The method according to claim 2, characterized in that The method further comprises: If the kernel version information of the kernel dump file is the same as the kernel version information corresponding to at least one debugging container in the container pool, obtaining kernel debugging information of the at least one debugging container; If the kernel dump file does not match the kernel debugging information of each debugging container in the at least one debugging container, it is determined that the target debugging container is not found in the container pool.
4. The method according to any one of claims 1 to 3, characterized in that The target container information includes operating system information corresponding to the kernel dump file and kernel debugging information corresponding to the kernel dump file.
5. The method according to claim 4, characterized in that The obtaining of target container information includes: Outputting prompt information for prompting the user to input the operating system information; The operating system information is received, where the operating system information includes an operating system type and an operating system version.
6. The method according to claim 5, characterized in that The step of constructing a target debugging container according to the target container information includes: Obtaining a container image file according to the operating system information, wherein the container image file is used to build a debugging container matching the operating system information; An initial container is constructed according to the container image file, and kernel debugging information corresponding to the kernel dump file is added to the initial container to obtain the target debugging container.
7. A debugging system, characterized in that: include: Instruction preprocessing layer, container management layer, and container pool; The container pool is used to store at least one debugging container; The instruction preprocessing layer is configured to receive a debugging instruction and obtain a kernel dump file based on the debugging instruction; wherein the debugging instruction carries the kernel dump file or carries storage path information of the kernel dump file; The container management layer is configured to search a container pool for a target debugging container that matches the kernel dump file based on the kernel dump file, and if the target debugging container is found in the container pool, call the target debugging container to debug the kernel dump file; the kernel version information corresponding to the target debugging container is the same as the kernel version information of the kernel dump file, and the kernel debugging information of the target debugging container matches the kernel dump file; The container management layer is further configured to obtain target container information if the target debugging container is not found in the container pool, wherein the target container information is used to construct a target debugging container that matches the kernel dump file; The container management layer is further configured to construct a target debugging container according to the target container information, and call the target debugging container to debug the kernel dump file; The container management layer is further used to add the target debugging container to the container pool.
8. The system according to claim 7, characterized in that The instruction pre-processing layer includes an instruction parsing module, a kernel information extraction module and a request transmission module; The instruction parsing module is configured to receive the debugging instruction, obtain the kernel dump file based on the debugging instruction, and transmit the debugging instruction to the kernel information extraction module; The kernel information extraction module is configured to extract the kernel version information of the kernel dump file and transmit the kernel dump file and the kernel version information of the kernel dump file to the request transmission module; The request transmission module is used to send a debugging request to the container management layer, where the debugging request carries the kernel version information of the kernel dump file and the kernel dump file, or the kernel version information of the kernel dump file and the storage path information.
9. The system according to claim 8, characterized in that The container management layer includes a container scheduling module and a container information database; The container scheduling module is configured to receive the debugging request from the instruction preprocessing layer, and obtain kernel version information of the kernel dump file and kernel version information corresponding to each debugging container in the container pool; The container scheduling module is further configured to determine that the target debugging container is not found in the container pool if the kernel version information of the kernel dump file is different from the kernel version information corresponding to each debugging container; The container information database is used to store kernel version information corresponding to each debugging container in the container pool.
10. The system according to claim 9, characterized in that The container scheduling module is further configured to obtain kernel debugging information of at least one debugging container if the kernel version information of the kernel dump file is the same as the kernel version information corresponding to at least one debugging container in the container pool; The container scheduling module is further configured to determine that the target debugging container is not found in the container pool if the kernel dump file does not match the kernel debugging information of each debugging container in the at least one debugging container.
11. The system according to claim 9 or 10, characterized in that The container management layer also includes a container orchestration management module; The container scheduling module is further configured to transmit the debugging request to the container orchestration management module if the target debugging container is not found in the container pool; The container orchestration management module is configured to obtain the target container information and construct a target debugging container according to the target container information; The container scheduling module is configured to call the target debugging container to debug the kernel dump file.
12. The system according to claim 11, wherein: The container orchestration management module is used to build a target debugging container according to the target container information, specifically to: Obtaining a container image file according to the operating system information, wherein the container image file is used to build a debugging container matching the operating system information; An initial container is constructed according to the container image file, and kernel debugging information corresponding to the kernel dump file is added to the initial container to obtain the target debugging container.
13. A computer device, characterized in that: The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Storage management system and method
CN109947761A
Data processing method, computing device and computer storage medium
CN114595038A