User mode program fault positioning method and device based on DBus message queue

By collecting and converting DBus target data from the kernel space, saving it in the Map storage structure of eBPF, and processing event information in the user space, the problem of low fault positioning efficiency in user-state programs in the prior art is solved, and automatic fault positioning and efficiency improvement are achieved.

CN119883698APending Publication Date: 2025-04-25SHANGHAI PUDONG DEVELOPMENT BANK
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411904974.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the prior art, the fault location efficiency of user-state programs is low, mainly due to the redundant message queue information output by the DBus-monitor tool, which requires professionals to clean a large amount of data, resulting in high cost and low efficiency.

Method used

By collecting DBus target data from the kernel space, converting it into event information and saving it in the eBPF Map storage structure, event information is obtained from the Map storage structure in the user space and sent to the backend component to determine the target state value of the DBus outbound queue and the fault state of the user-state program.

Benefits of technology

It realizes automatic fault positioning of user-state programs, reduces the transmission and storage time of irrelevant data, and improves the efficiency of fault positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883698A_ABST
    Figure CN119883698A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of user mode program fault positioning, and provides a user mode program fault positioning method and device based on a DBus message queue, and the method comprises the steps: collecting DBus target data from a kernel space; the DBus target data is converted into event information, and the event information is stored in a Map storage structure of an eBPF; and obtaining the event information from the Map storage structure in a user space, and sending the event information to a back-end component, so that the back-end component determines a target state value of a DBus outbound queue according to the event information, and determines a fault state of a user state program according to the target state value. According to the embodiment of the invention, the fault positioning efficiency of the user mode program can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of user-mode program fault location, and in particular to a method and device for locating user-mode program fault based on a DBus message queue. Background Art

[0002] When the application architecture is deployed in a containerized and microservices manner, when a user-mode program fails, such as a container application mounting a volume without response for a long time (i.e., mounting fails), the prior art generally uses tools such as top on the host to view related components, such as Systemd, UDisks2, DBus-daemon, etc. in DBus, to determine whether there are problems such as high CPU surges and abnormal logs, or uses the DBus-monitor tool to continuously monitor the output of DBus connection information. Since DBus-monitor outputs a large amount of redundant data in the information in the message queue in DBus in real time, it is generally necessary for professional technicians to manually perform a large amount of data cleaning work before extracting key information about such faults. If the relevant data needs to be stored for a long time, the cost of data transmission and storage is high. Therefore, the fault location efficiency of user-mode programs in the prior art is low. Summary of the invention

[0003] The purpose of the embodiments of this specification is to provide a method and device for locating user-mode program faults based on a DBus message queue, so as to improve the efficiency of locating user-mode program faults.

[0004] To achieve the above objectives, on the one hand, the embodiments of this specification provide a method for locating user-mode program faults based on a DBus message queue, including:

[0005] Collect DBus target data from kernel space;

[0006] Convert the DBus target data into event information, and save the event information in the Map storage structure of eBPF;

[0007] The event information is obtained from the Map storage structure in the user space and sent to the backend component, so that the backend component determines the target state value of the DBus outbound queue according to the event information, and determines the fault state of the user state program according to the target state value.

[0008] In the user-mode program fault location method based on the DBus message queue of the embodiment of this specification, the DBus target data is collected from the kernel space, including:

[0009] Collect the DBus connection structure of the DBus connection distribution function from the kernel space;

[0010] Obtain the DBus message queue length from the DBus connection structure using the first function of eBPF;

[0011] The second function of eBPF is used to obtain the DBus message object name from the DBus connection structure.

[0012] In the user-mode program fault locating method based on the DBus message queue of the embodiment of this specification, the DBus message queue length includes the outbound message queue length.

[0013] In the user-mode program fault location method based on the DBus message queue of the embodiment of this specification, the converting of the DBus target data into event information includes:

[0014] Combine the outbound message queue length and the DBus message object name into an indicator type event;

[0015] Insert the indicator type events into the indicator type event sequence in order.

[0016] In the user-mode program fault location method based on the DBus message queue of the embodiment of this specification, the target state value of the DBus outbound queue is determined according to the event information, including:

[0017] The growth rate of the length of the DBus outbound queue is calculated according to the indicator type event sequence.

[0018] In the user-mode program fault location method based on the DBus message queue of the embodiment of this specification, the fault state of the user-mode program is determined according to the target state value, including:

[0019] Determine whether the target state value is greater than a state threshold;

[0020] If the target state value is greater than the state threshold, it is determined that a fault exists in the user state program, and a fault alarm is output.

[0021] On the other hand, the embodiment of this specification also provides a user-mode program fault locating device based on a DBus message queue, comprising:

[0022] The acquisition module is used to collect DBus target data from the kernel space;

[0023] A conversion module, used to convert the DBus target data into event information, and save the event in a Map storage structure of eBPF;

[0024] The sending module is used to obtain the event information from the Map storage structure in the user space and send it to the backend component, so that the backend component determines the target state value of the DBus outbound queue according to the event information, and determines the fault state of the user state program according to the target state value.

[0025] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions of the above method are executed.

[0026] On the other hand, an embodiment of the present specification further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer device, the instructions of the above method are executed.

[0027] On the other hand, an embodiment of the present specification further provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor of a computer device, the computer program executes instructions of the above method.

[0028] It can be seen from the technical solutions provided in the above embodiments of this specification that, in the embodiments of this specification, the DBus target data collected from the kernel space can be converted into event information, and the event information can be stored in the Map storage structure of eBPF, and then the event information can be obtained from the Map storage structure in the user space and sent to the back-end component, so that the back-end component can determine the target state value of the DBus outbound queue according to the event information, and determine the fault state of the user-mode program according to the target state value; in this way, automatic fault location of the user-mode program is achieved; and, since the event information stored in the Map of eBPF is only the DBus target data, a large amount of irrelevant DBus connection-related data is shielded, thereby greatly reducing the transmission time and storage time of a large amount of irrelevant DBus connection-related data, thereby improving the efficiency of user-mode program fault location. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0030] Figure 1 A schematic diagram of an application environment for locating user-mode program faults based on a DBus message queue in some embodiments of this specification is shown;

[0031] Figure 2 A flowchart of a method for locating a user-mode program fault based on a DBus message queue in some embodiments of this specification is shown;

[0032] Figure 3 Shows Figure 2 Flowchart of collecting DBus target data from kernel space in the method shown;

[0033] Figure 4 Shows Figure 2 A flowchart of converting DBus target data into event information in the method shown;

[0034] Figure 5 A schematic diagram showing an indicator type event sequence in an exemplary embodiment of the present specification;

[0035] Figure 6 Shows Figure 2 A schematic diagram of determining a fault state of a user-mode program according to a target state value in the method shown;

[0036] Figure 7 A structural block diagram of a user-mode program fault location device based on a DBus message queue in some embodiments of this specification is shown;

[0037] Figure 8 A structural block diagram of a computer device in some embodiments of the present specification is shown.

[0038] [Description of Reference Numerals]

[0039] 10. User-mode programs;

[0040] 20. Kernel;

[0041] 71. Collection module;

[0042] 72. Conversion module;

[0043] 73. Sending module;

[0044] 802. Computer equipment;

[0045] 804, processor;

[0046] 806. Memory;

[0047] 808, driving mechanism;

[0048] 810, input / output interface;

[0049] 812. Input device;

[0050] 814. Output device;

[0051] 816. Presentation equipment;

[0052] 818. Graphical user interface;

[0053] 820, network interface;

[0054] 822, communication link;

[0055] 824. Communication bus. DETAILED DESCRIPTION

[0056] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0057] It should be noted that in the embodiments of this specification, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user and fully authorized by all parties, that is, the acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0058] The embodiment of this specification relates to a user-mode program fault location technology based on a DBus message queue to improve the fault location efficiency of user-mode programs. Before describing the user-mode program fault location technology of the embodiment of this specification, some terms involved in the embodiment of this specification are briefly described as follows.

[0059] (1) eBPF

[0060] The extended Berkeley Packet Filter (eBPF) is an important component in the Linux kernel. It is a virtual machine technology that runs in the Linux kernel. It dynamically converts user-mode custom instructions into machine code through a Just In Time Compiler (JIT) and executes them in kernel mode.

[0061] eBPF provides a general capability to efficiently and safely execute specific code based on system or program events, so that users of general capabilities are no longer limited to kernel developers; eBPF can be composed of execution bytecode instructions, storage objects and helper functions (Helper). Bytecode instructions should be verified by the BPF verifier (Verfier) ​​before kernel execution. At the same time, in a kernel with BPF+JIT mode enabled, bytecode instructions can be directly converted into kernel executable local instructions for execution.

[0062] (2)DBus

[0063] DBus is an inter-process communication mechanism on Linux systems. DBus can provide communication for processes in the Linux desktop environment, and can pass Linux desktop environment and Linux kernel events to processes as messages.

[0064] (3) User space and kernel space

[0065] The Linux system is divided into two parts: one is the core software (kernel), also known as kernel space, and the other is the common application, which is called user space. The kernel, kernel extensions, and drivers run in kernel space, while other applications run in user space.

[0066] (4) User Mode, Kernel Mode

[0067] Kernel state is the mode in which the kernel of the Linux system runs. In kernel state, programs can directly access all hardware resources (such as CPU, memory, disk, network interface, etc.) and execute privileged instructions (such as modifying interrupt tables, accessing hardware registers, etc.).

[0068] User state is the mode in which ordinary applications (i.e. user state programs) in the Linux system run. In user state, user state programs can only access limited resources, and user state programs cannot directly access hardware resources or execute privileged instructions.

[0069] (5) User-mode programs

[0070] User-mode programs are programs that run in user space in a Linux system and can only access restricted memory addresses. User-mode programs have a lower privilege level and generally cannot directly access the code and data of the operating system kernel.

[0071] Figure 1The figure shows a schematic diagram of an application environment for locating user-mode program faults based on a DBus message queue in some embodiments of the present specification; the application environment includes a user-mode program 10 and a kernel 20. The proxy component of the user-mode program 10 can collect DBus target data from the kernel space; convert the DBus target data into event information, and store the event information in the eBPF Map storage structure (i.e. Figure 1 In the user space, the event information is obtained from the Map storage structure and sent to the back-end component of the user-mode program 10, so that the back-end component determines the target state value of the DBus outbound queue according to the event information, and determines the fault state of the user-mode program according to the target state value.

[0072] In the embodiments of this specification, the agent component is implemented based on the DBus communication mechanism, and is a communication agent module for the communication between the process of the agent user state program and the Linux system kernel. The agent component can be deployed on any host that needs to collect data. The back-end component is a fault monitoring module for identifying the fault state of the user state program based on event information. In some embodiments of this specification, the back-end component can be a custom fault monitoring module, and can also be implemented using open source systems such as prometheus.

[0073] The embodiment of this specification provides a user-mode program fault location method based on DBus message queue, which can be applied to the above-mentioned user-mode program side (specifically, it can be the proxy component side of the user-mode program), refer to Figure 2 As shown, in some embodiments of this specification, a user-mode program fault location method based on a DBus message queue may include the following steps:

[0074] Step 201: Collect DBus target data from kernel space.

[0075] Step 202: Convert the DBus target data into event information, and save the event information in the Map storage structure of eBPF.

[0076] Step 203: Obtain the event information from the Map storage structure in the user space and send it to the backend component, so that the backend component determines the target state value of the DBus outbound queue according to the event information, and determines the fault state of the user mode program according to the target state value.

[0077] In the embodiments of the present specification, the DBus target data collected from the kernel space can be converted into event information, and the event information can be stored in the Map storage structure of eBPF. Then, the event information can be obtained from the Map storage structure in the user space and sent to the back-end component, so that the back-end component can determine the target state value of the DBus outbound queue according to the event information, and determine the fault state of the user-mode program according to the target state value; in this way, automatic fault location of the user-mode program is achieved; and, since the event information stored in the Map of eBPF is only the DBus target data, a large amount of irrelevant DBus connection-related data is shielded, thereby greatly reducing the transmission time and storage time of a large amount of irrelevant DBus connection-related data, thereby improving the efficiency of user-mode program fault location.

[0078] refer to Figure 3 As shown, in some embodiments of this specification, collecting DBus target data from the kernel space may include the following steps:

[0079] Step 301: Collect the DBus connection structure of the DBus connection distribution function from the kernel space.

[0080] In some embodiments of the present specification, the proxy component may utilize the uprobe stub function to collect the DBus connection structure (DBusConnection structure) of the DBus connection dispatch function (DBus_connection_dispatch) from the kernel space.

[0081] In DBus, the DBusConnection structure represents a DBus connection, which is the communication channel between the client or server and the DBus daemon. The DBus connection dispatch function can be used to process messages on the DBus connection. The DBus connection structure contains n_incoming, n_outgoing, and unique_name. Among them, n_incoming represents the length of the inbound message queue of the DBus connection (DBusConnection), n_outgoing represents the length of the outbound message queue of the DBus connection, and unique_name represents the name or identifier of the DBus connection; the prefix "n" in n_incoming and n_outgoing is the length value.

[0082] Step 302: Obtain the DBus message queue length from the DBus connection structure using the first function of eBPF.

[0083] In some embodiments of the present specification, the first function of eBPF is configured in the uprobe plug-in function, and is an eBPF program for obtaining the message queue length in the DBus connection structure. For example, in an exemplary embodiment, the first function may be: uprobe: / usr / lib64 / libDBus-*:DBus_connection_dispatch.

[0084] In some embodiments of this specification, the Uprobe plug-in function is a kernel function that allows hooking into any instruction of any user space program. When these hooks are triggered, an event will be created and the context of the detected program will be provided to the handler (e.g., an eBPF program).

[0085] When a user-mode program fails, it is very easy to cause congestion in the DBus message queue (especially the DBus outgoing queue). Therefore, in some embodiments of this specification, the length of the DBus message queue is obtained as the length of the outgoing message queue (ie, n_outgoing).

[0086] Step 303: Obtain the DBus message object name from the DBus connection structure using the second function of eBPF.

[0087] In some embodiments of the present specification, the second function of eBPF is configured in the uprobe plug-in function, and is an eBPF program for obtaining the name of the DBus message object. For example, in an exemplary embodiment, the second function may be: uprobe: / usr / lib64 / libDBus-*:DBus_bus_get_unique_name.

[0088] Since there is no dependency between step 302 and step 303, step 302 and step 303 can be executed in any order, or asynchronously in parallel. The DBus message object name is the name or identifier (ie, unique_name) of the DBus connection.

[0089] exist Figure 3 In the illustrated embodiment, the outbound message queue length and the DBus message object form the DBus target data collected from the kernel space; since the DBus target data collected from the kernel space is only a small part of the DBus continuous related data, that is, a large amount of irrelevant DBus connection related data is shielded, the transmission time and storage time of a large amount of irrelevant DBus connection related data can be greatly reduced.

[0090] refer to Figure 4 As shown, in some embodiments of this specification, converting the DBus target data into event information may include the following steps:

[0091] Step 401: Combine the outbound message queue length and the DBus message object name into an indicator type event.

[0092] Metric type events refer to events whose data structure is of metric type, which is a data structure supported by backend components and eBPF's Map. Therefore, by combining the outbound message queue length and the DBus message object name into a metric type event, it is not only convenient to store event information in the eBPF Map, but also convenient for backend components to locate faults in user-mode programs based on event information.

[0093] In some embodiments of the present specification, taking the outbound message queue as an example, the DBus-Daemon outbound message queue, the Systemd outbound message queue and the Udisksd outbound message queue in the DBus service can be combined into the indicator type events shown below.

[0094] DBus_outgoing_length{unique_name='org.freedesktop.systemd',n1_outgoing}

[0095] DBus_outgoing_length{unique_name='org.freedesktop.DBus',n2_outgoing}

[0096] DBus_outgoing_length{unique_name='org.freedesktop.UDisks2',n3_outgoing}

[0097] When a user-mode program fails, in addition to causing congestion in the DBus outbound queue, it may also cause congestion in the DBus inbound queue. Therefore, in other embodiments of this specification, the obtained DBus message queue length can be the outbound message queue length (i.e., n_outgoing) and the inbound message queue length (n_incoming). In this scenario, the corresponding indicator type events can be combined as shown below:

[0098] DBus_outgoing_length{unique_name='org.freedesktop.systemd',n11_outgoing}

[0099] DBus_outgoing_length{unique_name='org.freedesktop.DBus',n12_outgoing}

[0100] DBus_outgoing_length{unique_name='org.freedesktop.UDisks2',n13_outgoing}

[0101] DBus_incoming_length{unique_name='org.freedesktop.systemd',n21_incoming}

[0102] DBus_incoming_length{unique_name='org.freedesktop.DBus',n22_incoming}

[0103] DBus_incoming_length{unique_name='org.freedesktop.UDisks2',n23_incoming}

[0104] Step 402: insert the indicator type event into the indicator type event sequence in order.

[0105] In the embodiments of the present specification, the indicator type event may carry a timestamp. Since the fault location of the user-mode program is ongoing, the indicator type event obtained in real time or at a fixed time may be formed as follows: Figure 5 As shown in the indicator type event sequence, each time an indicator type event is obtained, it can be inserted into the indicator type event sequence in chronological order.

[0106] In some embodiments of the present specification, storing the event information in a Map storage structure of eBPF may refer to: storing an indicator type event sequence in a Map storage structure of eBPF.

[0107] In some embodiments of the present specification, determining the target state value of the DBus outbound queue according to the event information includes: calculating the length growth rate of the DBus outbound queue according to the indicator type event sequence. For example, in some embodiments of the present specification, the length growth rate of the DBus outbound queue at the most recent specified time (e.g., the most recent ten seconds) can be calculated according to the indicator type event sequence.

[0108] refer to Figure 6 As shown, in some embodiments of the present specification, determining the fault state of the user mode program according to the target state value may include the following steps:

[0109] Step 601, determine whether the target state value is greater than the state threshold; if the target state value is greater than the state threshold, execute step 602, otherwise execute step 603.

[0110] For example, in some embodiments of the present specification, taking the target state value as the length growth rate of the DBus outbound queue as an example, the state threshold may be a length growth rate threshold (which may be customized as needed).

[0111] Step 602: confirm that the user-mode program has a fault and output a fault alarm.

[0112] In some embodiments of the present specification, when a user-mode program fails, it is very easy to cause congestion in the DBus message queue (especially the DBus outbound queue). Therefore, when the length growth rate of the DBus outbound queue is greater than the length growth rate threshold, it can be considered that the user-mode program has a fault. In addition, since the DBus outbound queue can include the DBus-Daemon outbound queue, the Systemd outbound queue and / or the Udisksd outbound queue; when any one of them is congested, it can be confirmed that the user-mode program has a fault.

[0113] In other embodiments of the present specification, outputting a fault alarm may include: determining whether the duration of the target state value being greater than the state threshold exceeds a time threshold (e.g., five minutes, ten minutes, etc.); if the time threshold is exceeded, triggering a fault alarm of the user-mode program. In this way, occasional and short-duration state jitters may be avoided from being mistaken for user-mode program failures.

[0114] Step 603: Confirm that there is no fault in the user mode program.

[0115] Since the DBus outbound queue may include a DBus-Daemon outbound queue, a Systemd outbound queue and / or an Udisksd outbound queue; when there is no congestion in each of the DBus-Daemon outbound queue, the Systemd outbound queue and / or the Udisksd outbound queue, it can be confirmed that there is no fault in the user-mode program.

[0116] Although the process flows described above include multiple operations that occur in a particular order, it should be clearly understood that the processes may include more or fewer operations, which may be performed sequentially or in parallel (eg, using parallel processors or a multi-threaded environment).

[0117] Corresponding to the above-mentioned user-mode program fault location method based on DBus message queue, the embodiment of this specification also provides a user-mode program fault location device based on DBus message queue, which can be configured on the above-mentioned user-mode program, referring to Figure 7 As shown, in some embodiments of this specification, a user-mode program fault location device based on a DBus message queue may include:

[0118] The acquisition module 71 is used to acquire DBus target data from the kernel space;

[0119] A conversion module 72, configured to convert the DBus target data into event information, and store the event in a Map storage structure of eBPF;

[0120] The sending module 73 is used to obtain the event information from the Map storage structure in the user space and send it to the backend component, so that the backend component determines the target state value of the DBus outbound queue according to the event information, and determines the fault state of the user state program according to the target state value.

[0121] In the user-mode program fault location device based on DBus message queue in some embodiments of the present specification, the collecting of DBus target data from the kernel space includes:

[0122] Collect the DBus connection structure of the DBus connection distribution function from the kernel space;

[0123] Obtain the DBus message queue length from the DBus connection structure using the first function of eBPF;

[0124] The second function of eBPF is used to obtain the DBus message object name from the DBus connection structure.

[0125] In the user-mode program fault locating device based on DBus message queue in some embodiments of the present specification, the DBus message queue length includes the outbound message queue length.

[0126] In the user-mode program fault location method based on the DBus message queue of the embodiment of this specification, the converting of the DBus target data into event information includes:

[0127] Combine the outbound message queue length and the DBus message object name into an indicator type event;

[0128] Insert the indicator type events into the indicator type event sequence in order.

[0129] In the user-mode program fault location device based on the DBus message queue in some embodiments of the present specification, the determining of the target state value of the DBus outbound queue according to the event information includes:

[0130] The growth rate of the length of the DBus outbound queue is calculated according to the indicator type event sequence.

[0131] In the user-mode program fault location device based on DBus message queue in some embodiments of the present specification, the determining of the fault state of the user-mode program according to the target state value includes:

[0132] Determine whether the target state value is greater than a state threshold;

[0133] If the target state value is greater than the state threshold, it is determined that a fault exists in the user state program, and a fault alarm is output.

[0134] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0135] The embodiments of this specification also provide a computer device. Figure 8 As shown, in some embodiments of the present specification, the computer device 802 may include one or more processors 804, such as one or more central processing units (CPUs) or graphics processing units (GPUs), and each processing unit may implement one or more hardware threads. The computer device 802 may also include any memory 806, which is used to store any kind of information such as code, settings, data, etc. In a specific embodiment, the computer program on the memory 806 and can be run on the processor 804, when the computer program is run by the processor 804, can execute the instructions of the user-mode program fault location method based on the DBus message queue described in any of the above embodiments. Non-limiting, for example, the memory 806 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 802. In one embodiment, when the processor 804 executes the associated instructions stored in any memory or combination of memories, the computer device 802 can perform any operation of the associated instructions. The computer device 802 also includes one or more drive mechanisms 808 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0136] The computer device 802 may also include an input / output interface 810 (I / O) for receiving various inputs (via input devices 812) and for providing various outputs (via output devices 814). A specific output mechanism may include a presentation device 816 and an associated graphical user interface 818 (GUI). In other embodiments, the input / output interface 810 (I / O), input device 812, and output device 814 may not be included, and the computer device 802 may be used as a computer device in a network. The computer device 802 may also include one or more network interfaces 820 for exchanging data with other devices via one or more communication links 822. One or more communication buses 824 couple the components described above together.

[0137] The communication link 822 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 822 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.

[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), computer-readable storage media, and computer program products of some embodiments of the present specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processor to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processor generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processor to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processor so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0141] In a typical configuration, a computer device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0142] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0143] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CDROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computer device. As defined in this specification, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0144] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CDROM, optical storage, etc.) containing computer-usable program codes.

[0145] The present specification embodiments may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present specification embodiments may also be practiced in distributed computing environments where tasks are performed by remote processors connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0146] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0148] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiments of this specification. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0149] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A user-mode program fault location method based on DBus message queue, characterized in that: include: Collect DBus target data from kernel space; Convert the DBus target data into event information, and save the event information in the Map storage structure of eBPF; The event information is obtained from the Map storage structure in the user space and sent to the backend component, so that the backend component determines the target state value of the DBus outbound queue according to the event information, and determines the fault state of the user state program according to the target state value.

2. The method for locating a user-mode program fault based on a DBus message queue as claimed in claim 1, characterized in that: The collecting of DBus target data from the kernel space includes: Collect the DBus connection structure of the DBus connection distribution function from the kernel space; Obtain the DBus message queue length from the DBus connection structure using the first function of eBPF; The second function of eBPF is used to obtain the DBus message object name from the DBus connection structure.

3. The user-mode program fault location method based on DBus message queue as claimed in claim 2, characterized in that: The DBus message queue length includes the outbound message queue length.

4. The method for locating user-mode program faults based on DBus message queue as claimed in claim 3, characterized in that: The converting the DBus target data into event information comprises: Combine the outbound message queue length and the DBus message object name into an indicator type event; Insert the indicator type events into the indicator type event sequence in order.

5. The user-mode program fault location method based on DBus message queue as claimed in claim 4, characterized in that: Determining the target state value of the DBus outbound queue according to the event information includes: The growth rate of the length of the DBus outbound queue is calculated according to the indicator type event sequence.

6. The method for locating user-mode program faults based on DBus message queue as claimed in claim 1, characterized in that: Determining the fault state of the user-mode program according to the target state value includes: Determine whether the target state value is greater than a state threshold; If the target state value is greater than the state threshold, it is determined that a fault exists in the user state program, and a fault alarm is output.

7. A user-mode program fault location device based on DBus message queue, characterized in that: include: The acquisition module is used to collect DBus target data from the kernel space; A conversion module, used to convert the DBus target data into event information, and save the event in a Map storage structure of eBPF; The sending module is used to obtain the event information from the Map storage structure in the user space and send it to the backend component, so that the backend component determines the target state value of the DBus outbound queue according to the event information, and determines the fault state of the user state program according to the target state value.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1 to 6.

9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes instructions of the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor of a computer device, the computer program executes instructions of the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Network NOSOCKET error monitoring and analyzing method

    CN121037261A

  • A monitoring and analyzing method for network no_socket error

    CN121037261B