A method, apparatus and device for merging call stack information
Patent Information
- Application Number
- CN202510551284.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本发明提供了一种调用栈信息合并方法、装置及设备,用于解决相关技术中缺少一种准确有效地对调用栈信息进行合并的方法的问题
[0055]上述第二至五方面中的各个方面以及各个方面可能达到的技术效果请参照上述针对第一方面或第一方面中的各种可能方案可以达到的技术效果说明,这里不再重复赘述。
Smart Images

Figure CN123011675A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus and device for merging call stack information. Background Technology
[0002] Supercomputers, with their powerful computing capabilities, have been widely used in various fields such as aerospace, quantum mechanics, and bioinformatics, becoming an ideal platform for solving complex scientific problems. Because these scientific problems typically involve large-scale datasets and complex computational models, programming on supercomputers mostly employs parallel computing models.
[0003] Parallel computing programs are designed to divide data and tasks into small chunks, each of which can be processed independently on different processors. This partitioning and parallel processing approach greatly improves computational efficiency. However, due to the characteristics of multi-process systems and the complex communication relationships between processes, computation results are affected by various factors such as process scheduling, resource allocation, and communication timing. This leads to a higher probability of errors in parallel computing and makes debugging more difficult.
[0004] The call stack provides a detailed history of function calls during the execution of a parallel computing program. It not only shows the activity of a single process but also represents the dependencies between processes. By viewing the call stack information of each process on different processor nodes, one can intuitively understand the running state of the entire system and the relationships between processes, facilitating effective debugging of parallel computing programs. However, currently, there is a lack of an accurate and effective method for merging call stack information. Summary of the Invention
[0005] This invention provides a method, apparatus, and device for merging call stack information, which addresses the problem of the lack of an accurate and effective method for merging call stack information in related technologies.
[0006] In a first aspect, embodiments of this application provide a method for merging call stack information, applied to a computer device, the computer device including multiple computing nodes, the method comprising:
[0007] For each computing node, obtain the call stack information corresponding to each business process in the computing node; the call stack information includes: the functions called in the history of the corresponding business process and the call relationship between the functions;
[0008] For each business process, a call stack linked list is generated based on the call stack information corresponding to the business process; the nodes in the call stack linked list are used to represent the call information of the corresponding function, and the connecting lines between the nodes are used to represent the call relationship between the functions;
[0009] The call stack linked lists corresponding to each business process are merged to obtain a call stack tree. When merging any two call stack linked lists, one of the call stack linked lists is traversed. When it is determined that there are nodes shared with the other call stack linked list, the call information of the shared nodes is merged.
[0010] Display the call stack tree.
[0011] The above method, by collecting and accurately merging call stack information, enables developers to intuitively view the call stack information of each job process in the parallel program, accurately locate the fault location of the parallel program, avoid manual process-by-process checks, or large-scale output of debug logs, and thus effectively improve the debugging speed of parallel programs.
[0012] In one possible implementation, the call stack linked lists corresponding to each business process are merged to obtain a call stack tree, including:
[0013] Merge the call stack linked lists corresponding to each business process in the computing node to obtain the call stack subtree corresponding to each computing node; when it is determined that the root node of the call stack tree corresponding to each computing node is the same, merge the call stack trees corresponding to each computing node to obtain the call stack tree.
[0014] The method also includes:
[0015] If the root node of any call stack subtree is different from the root node of other call stack subtrees, it is determined that there is an error in any call stack subtree, and a prompt message is sent to the user.
[0016] The above method, by first determining whether the root nodes of each call stack subtree are the same before merging the call stack subtrees, can accurately identify the call stack subtrees with faults, thereby ensuring the accuracy of subsequent call stack information merging.
[0017] In one possible implementation, the multiple computing nodes include a first node and multiple second nodes; the call stack linked lists corresponding to each business process are merged to obtain a call stack tree, including:
[0018] For each computing node, the call stack linked lists corresponding to each business process in the computing node are merged to obtain the call stack subtree corresponding to the computing node.
[0019] Through each second node, the call stack subtree corresponding to the second node is sent to the first node;
[0020] By merging the call stack subtree corresponding to the first node and the call stack subtrees corresponding to each of the received second nodes, a call stack tree is obtained.
[0021] The above method involves each calling node merging its own call stack linked list into a call stack subtree at its own node, and then sending the call stack subtree to the first node for merging. This improves the efficiency of call stack tree generation.
[0022] In one possible implementation, the call stack subtree corresponding to each second node is sent to the first node, including:
[0023] Through each second node, the call stack subtree is serialized to obtain the target sequence, and the target sequence is sent to the first node;
[0024] Before merging the call stack subtree corresponding to the first node and the call stack subtrees corresponding to each of the received second nodes, the method also includes:
[0025] The first node performs deserialization on each received target sequence to obtain each call stack subtree.
[0026] The above method, in the process of each second node sending the call stack subtree to the first node, first serializes the call stack subtree and then restores it, which can improve the sending efficiency of the call stack subtree.
[0027] In one possible implementation, the call stack subtree is serialized through each second node to obtain the target sequence, including:
[0028] Add the node information of the root node of the call stack subtree to the task queue, and repeat the following process until the task queue is empty. Then, combine the obtained subsequences in turn to obtain the target sequence:
[0029] Retrieve the node information of the target node from the task queue, and perform a serialization operation on the node information of the target node to obtain the subsequence corresponding to the target node; where the target node is the first node in the task queue.
[0030] Add the node information of the child nodes of the target node in the call stack subtree to the task queue.
[0031] The above method serializes nodes sequentially by adding them to the task queue according to the calling relationships between nodes in the call stack subtree. This method is applicable to the ordered serialization of multi-way trees with an uncertain number of nodes, ensuring accuracy during the serialization process.
[0032] In one possible implementation, the first node performs deserialization on each received binary compressed sequence to obtain each call stack subtree, including:
[0033] For each target sequence, each subsequence is parsed out sequentially according to the order of its subsequences.
[0034] For each subsequence, perform a deserialization operation to obtain the node information corresponding to the subsequence; the node information includes: the number of child nodes of the corresponding node;
[0035] For each target sequence, the call stack subtree corresponding to the target sequence is reconstructed based on the node information corresponding to each node in the target sequence.
[0036] The above method, by performing deserialization on each subsequence in sequence, can efficiently and accurately restore the call stack subtree.
[0037] In one possible implementation, the call stack subtree corresponding to each second node is sent to the first node, including:
[0038] Repeat the following process until the number of third nodes obtained is one, then determine the call stack subtree corresponding to each second node and send it to the first node:
[0039] Obtain each third node and divide the third nodes into first-class nodes and second-class nodes. The third nodes are the first-class nodes determined in the previous loop, and the first-class nodes include the first nodes.
[0040] The first type of node and the second type of node are combined, and each combination includes one first type of node and at least one second type of node;
[0041] Through each second-type node, the call stack subtree stored in the second-type node is sent to the first-type node in the corresponding combination; the stored call stack subtree includes: the call stack subtree corresponding to the second-type node, and the call stack subtrees of other nodes received in the past.
[0042] The above method, by using a tree-structured communication approach to transmit the call stack subtree from the second node to the first node, can effectively improve transmission efficiency.
[0043] In one possible implementation, the multiple computing nodes include a first node and multiple second nodes; for each business process, before generating a call stack linked list based on the call stack information corresponding to the business process, the method further includes:
[0044] Through each second node, a shared file corresponding to each business process in the second node is created in the shared file system, and the call stack information corresponding to each business process is stored in the corresponding shared file; the shared file system is used for information sharing between computing nodes;
[0045] By using the first node, we can traverse each shared file in the shared file system and obtain the call stack information corresponding to each business process.
[0046] The above method provides another possible way to transmit call stack information. By transmitting through a shared file system process, the call stack information can be transmitted to the first node efficiently and accurately, which facilitates the merging of call stack information by the first node.
[0047] Secondly, embodiments of this application provide a call stack information merging apparatus, applied to a computer device, the computer device including multiple computing nodes, the apparatus comprising:
[0048] The acquisition module is used to acquire the call stack information corresponding to each business process in each computing node. The call stack information includes: the functions called in the history of the corresponding business process and the call relationship between the functions.
[0049] The generation module is used to generate a call stack linked list for each business process based on the call stack information corresponding to the business process; the nodes in the call stack linked list are used to represent the call information of the corresponding functions, and the connecting lines between the nodes are used to represent the call relationship between the functions;
[0050] The merging module is used to merge the call stack linked lists corresponding to each business process to obtain a call stack tree. When merging any two call stack linked lists, one of the call stack linked lists is traversed. When it is determined that there are nodes in common with the other call stack linked list, the call information of the common nodes is merged.
[0051] The display module is used to show the call stack tree.
[0052] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the call stack information merging method.
[0053] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps in the call stack information merging method described above.
[0054] Fifthly, embodiments of this application provide a computer program product, including a computer program stored in a computer-readable storage medium; when a processor of a memory access device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the memory access device to perform the steps in the call stack information merging method described above in this application.
[0055] For details on each of the second to fifth aspects mentioned above, as well as the technical effects that each aspect may achieve, please refer to the above description of the technical effects that can be achieved for the first aspect or the various possible solutions in the first aspect. These details will not be repeated here. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 A schematic diagram illustrating a method for merging call stack information provided in an embodiment of this application;
[0058] Figure 2 A schematic diagram of a call stack linked list provided in an embodiment of this application;
[0059] Figure 3 A schematic diagram illustrating the result of merging a call stack linked list, provided in an embodiment of this application;
[0060] Figure 4 A schematic diagram illustrating a target sequence transmission process provided in an embodiment of this application;
[0061] Figure 5 A schematic diagram of a call stack tree provided for an embodiment of this application;
[0062] Figure 6 A schematic diagram illustrating a call stack information merging process provided in an embodiment of this application;
[0063] Figure 7 A schematic diagram of a call stack information merging device provided in an embodiment of this application;
[0064] Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0066] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0067] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0068] The acquisition, transmission, storage, and use of data in this application all comply with the requirements of relevant national laws and regulations.
[0069] To facilitate a better understanding of the technical solutions provided in the embodiments of this application by those skilled in the art, the following is a brief explanation of the relevant technical terms:
[0070] (1) Process: An independent unit for resource allocation and scheduling by the operating system; it is the execution entity of a program.
[0071] (2) Call stack: A structure used to track the order of function calls during program execution.
[0072] (3) Call stack tree: A tree structure formed by merging the call stacks of multiple job processes.
[0073] (4) Job process: The process that executes computing tasks on a computing node.
[0074] (5) Jobs: Computational tasks started on a batch of computing nodes. Each computing node has dozens of job processes, and the job processes on each node communicate with each other.
[0075] (6) MPI (Message Passing Interface): A parallel computing programming model and library standard that defines a series of specifications and functions to achieve efficient communication between nodes and significantly improve the efficiency of parallel computing.
[0076] (7) RPC (Remote Procedure Call Protocol): A protocol that allows a program on a remote computer to request services over a network.
[0077] Supercomputers typically consist of hundreds or even thousands of computing nodes and tens of thousands of CPU (Central Processing Unit) cores. Based on their powerful computing capabilities, supercomputers have been widely used in fields such as aerospace, quantum mechanics, climate simulation, and bioinformatics.
[0078] The powerful processing capabilities of supercomputers make them ideal platforms for solving complex scientific problems. Since these problems typically involve large-scale datasets and complex computational models, supercomputer programming largely employs parallel computing models. Parallel programming allows data and tasks to be divided into small chunks, each of which can be processed independently on different processors. This partitioning and parallel processing significantly improves computational efficiency. Parallel programs on supercomputers are usually implemented using specific programming models and tools, such as MPI (Message Passing Interface) and OpenMP (Open Multithreaded Programming). These tools support the writing of parallel code that can run efficiently on multiple processors. However, due to the characteristics of multi-processing and the complex communication relationships between processes, parallel programs present debugging difficulties.
[0079] In a parallel computing environment, processes may be distributed across different computing nodes. Each process not only needs to execute its task independently but also needs to exchange data and information with other processes to ensure the overall coordination and correctness of the parallel program. However, these communication and synchronization operations increase the risk of program errors.
[0080] Deadlock is a typical error in parallel programming caused directly by the complexity of the process. When deadlock occurs, two or more processes are waiting for each other to initiate or terminate a communication process, preventing the program from continuing. Because the outcome of parallel programs is affected by various factors such as process scheduling, resource allocation, and communication timing, deadlock or other parallel errors are difficult to predict and reproduce.
[0081] Therefore, debugging parallel programs requires not only a deep understanding of the execution logic of a single process, but also a global grasp of the overall system's operating state and the interactions between processes.
[0082] The call stack provides a detailed history of function calls during the execution of a parallel computing program, including the functions each process is executing at a specific point in time. In parallel programs, the call stack not only shows the activity of individual processes but also reveals the dependencies between processes. By observing the call stack of each process, developers can understand the behavior of each process in a parallel program and effectively debug various problems such as deadlocks. Therefore, the call stack has become a key tool for solving problems such as deadlocks in parallel programs, and capturing, merging, and analyzing the call stack makes debugging parallel programs intuitive and efficient. However, related technologies lack a method for accurately and effectively merging call stack information.
[0083] To overcome the above problems, this application provides a method for merging call stack information. This method acquires the call stack information corresponding to each business process on each computing node in a computer device, and merges the call stack information from multiple computing nodes onto a master node (which can be any computing node, specifically configured based on requirements) to form a complete call stack tree, which is then displayed to the user. By collecting and merging call stack information, developers can intuitively view the call stack information of each job process in a parallel program, accurately locate the fault location in the parallel program, and avoid manual process-by-process checks or large-scale output of debug logs, thereby effectively improving the debugging speed of parallel programs.
[0084] The present application will now be described in further detail with reference to the accompanying drawings. See also: Figure 1 The diagram shown is a flowchart of a call stack information merging method provided in an embodiment of this application. This method is applied to a computer device including multiple computing nodes, and its specific implementation process is as follows:
[0085] Step S101: For each computing node, obtain the call stack information corresponding to each business process in the computing node;
[0086] The call stack information includes: the functions called in the history of the corresponding business process and the call relationships between the functions;
[0087] In some embodiments, when collecting call stack information corresponding to each business process in a computing node, this application first creates a collection process on each computing node, then uses the collection process to filter out the relevant information of the business processes that need to be collected from the computing node, and obtains the corresponding business call stack information.
[0088] In this embodiment of the application, when starting the acquisition process on each computing node occupied by the job, it can be implemented by MPI, or the acquisition process can be started on each computing node to collect the call stack by RPC technology, such as gRPC and other frameworks.
[0089] In this embodiment of the application, each acquisition process needs to obtain the process information of all job processes on the corresponding computing node, such as the job process number and the job process number in the entire MPI communication domain.
[0090] In one possible implementation, obtaining the call stack information corresponding to each business process in each computing node includes:
[0091] In response to a user’s information merging instruction, the information merging instruction includes preset conditions corresponding to the information to be merged;
[0092] For each computing node, the process information corresponding to each process in the computing node is traversed, and business processes whose process information meets the preset conditions are selected.
[0093] The call stacks of each business process are backtracked to obtain the call stack information for each business process.
[0094] In this embodiment of the application, the aforementioned preset condition can be the identifier of the executable file corresponding to the process specified by the user, such as the executable file name; at this time, the above-mentioned process of filtering services can be: by using the identifier of the executable file executed by each process stored under / proc, it can be determined whether the process is the job process to be collected (i.e., whether it meets the preset condition), and by using the environment variable information of each job process stored under / proc, the number of the process in the MPI communication domain can be obtained. The number of the process in the MPI communication domain can reflect the topological relationship between each process.
[0095] In practice, the user inputs the identifier of the executable file that the job is actually running, which serves as a preset condition for the acquisition process to determine whether a process is a job process. The acquisition process checks whether the executable file name is included in the process information stored under / proc to determine whether the process needs to be acquired. If it is included, it means that the process is a business process that needs to be acquired. If the current process is determined to be a business process that needs to be acquired, the process information of the process, such as the process ID, is recorded, and the process ID in the MPI communication domain is obtained by checking the process's environment variables.
[0096] In some embodiments, since the file storing environment variables contains the ' / 0' character, the file cannot be traversed using conventional reading and searching methods. Therefore, in this embodiment, when traversing the environment variables, the entire file is first read into memory, and then the KMP algorithm is used to search for a specific environment variable (which is pre-set based on requirements).
[0097] After identifying the business processes that need to be collected from each computing node, it is necessary to obtain the call stack information corresponding to each business process. Specifically, firstly, the ptrace system call or other methods are used to put the business process into a traceable state. Then, call stack backtracking or other feasible methods are used to obtain the call stack information of a single job process at the time of execution. The call stack information should be a sequence of function calls, including the name of each function, the call position (e.g., file name and line number), and it should be organized into a suitable form and temporarily stored in memory for subsequent processing.
[0098] In practice, the above method of setting the business process to a traceable state can be achieved by using the business process's number in the MPI communication domain, and the above method of backtracking the call stack can be achieved by using relevant functions in the libunwind library or the elfutils library.
[0099] Step S102: For each business process, generate a call stack linked list based on the call stack information corresponding to the business process;
[0100] In the above call stack linked list, the nodes are used to represent the call information of the corresponding functions, and the connecting lines between the nodes are used to represent the call relationship between the functions.
[0101] In practice, since the call stack information records the call relationships between the functions called in the history of the business process, when generating the call stack linked list, each function can be used as a node, and the nodes can be connected in sequence according to the call relationship between the functions to obtain the call stack linked list.
[0102] like Figure 2As shown, assuming the functions called in the current business process's history include functions 1 to 4, and their calling relationships are: function 1 calls function 2, function 2 calls function 3, and function 3 calls function 4, then we can obtain the following... Figure 2 The call stack linked list shown has four nodes, representing functions 1 through 4, which are connected sequentially.
[0103] Step S103: Merge the call stack linked lists corresponding to each business process to obtain the call stack tree;
[0104] Specifically, when merging any two call stack lists, one of the call stack lists is traversed, and when it is determined that there are nodes shared with the other call stack list, the call information of the shared nodes is merged.
[0105] In some embodiments, each node in the call stack tree identifies a called function. The corresponding node information includes the function identifier (i.e., function name), the number of processes that called the function, and the values of the registers used during the function call. Each node includes several branches (or may have no branches). Each branch connects to other functions called after the function. At the same time, the identification information of the business process that called the corresponding function (e.g., MPI communication domain number) is recorded on the branch. When a node has no corresponding child node, it indicates that the corresponding business process has executed the function corresponding to the current node at the time the call stack information is collected.
[0106] In some embodiments, when merging call stack lists, one call stack list can be used as the initial call stack tree, and other call stack lists can be merged into the initial call stack tree to obtain the final call stack tree.
[0107] In one possible implementation, the above-mentioned call information includes: the identification information of the corresponding function and the number of times it is called;
[0108] When it is determined that there is a node shared with another call stack linked list, the specific process of merging the call information of the shared node is as follows: when it is determined that there is a node shared with another call stack linked list based on the identification information of the function corresponding to the node (that is, when there is a node with the same identification information corresponding to the function, it is determined to be a shared node), the call counts corresponding to the shared nodes in any two call stack linked lists are merged.
[0109] In practice, the process of inserting a call stack linked list into the call stack tree is as follows: Starting from the root node of the call stack tree, for each node in the call stack tree, each node (i.e., function) in the call stack linked list is traversed sequentially. It is checked whether the current node in the call stack tree includes a pointer to a child node that includes the function (i.e., a node in the call stack linked list). If it exists, the pointer is moved to that child node (a node in the call stack tree), and the function information of that child node is updated. Specifically, its call count can be updated (i.e., the call count corresponding to the function in the call stack linked list is added to the original call count). If it does not exist, a new child node of the current node is created in the call stack tree, and the function in the call stack linked list is stored in the newly created child node. The above process is repeated until all nodes (i.e., functions) in the call stack linked list have been traversed.
[0110] like Figure 3 As shown, suppose the current call stack tree contains 4 nodes, namely functions 1 to 4, and their calling relationships are: function 1 calls function 2, function 2 calls function 3, and function 3 calls function 4; the call stack linked list to be inserted contains 4 nodes, namely functions 1, 2, 4, and 5, and their calling relationships are: function 1 calls function 2, function 2 calls function 5, and function 5 calls function 6; then the process of inserting the call stack linked list into the call stack tree is as follows: First, starting from the root node of the call stack tree, check if there is a node that is the same as the node in the call stack linked list, and determine the first node of the call stack tree, i.e., function 1, and the call stack linked list. The first node of each function is the same, so the first node is merged. Then, starting from the next node in the call stack tree, we search for a node that is the same as the second node in the call stack list. We find that the second node in the call stack tree, i.e., function 2, is the same as the second node in the call stack list, so we merge the second node. Then, starting from the next node in the call stack tree, we search for a node that is the same as the third node in the call stack list. If no such node exists, we create a child node corresponding to function 2 in the call stack tree and record the information of function 5 in that child node. This process continues until the merged nodes are as follows: Figure 3 As shown.
[0111] In one possible implementation, the call stack linked lists corresponding to each business process are merged to obtain a call stack tree, including:
[0112] Merge the call stack linked lists corresponding to each business process in the computing node to obtain the call stack subtree corresponding to each computing node;
[0113] When it is determined that the root nodes of the call stack subtrees corresponding to each computing node are the same, the call stack subtrees corresponding to each computing node are merged to obtain the call stack tree;
[0114] If the root node of any call stack subtree is different from the root node of other call stack subtrees, it is determined that there is an error in any call stack subtree, and a prompt message is sent to the user.
[0115] In some embodiments, the call stack chains corresponding to each computing node can be merged first to obtain a call stack subtree corresponding to each computing node, and then the call stack subtrees can be merged. Since the root node of the call stack subtree corresponding to each node should be the same function, such as the _strat function, in order to ensure the accuracy of the call stack subtree, in the embodiments of this application, it is necessary to ensure that the root nodes of each call stack subtree are the same (i.e., the functions are the same) before merging the call stack subtrees. If the root node of a call stack tree is different from that of other call stack trees, it indicates that there is an error in the call stack tree. At this time, subsequent operations are stopped and error handling is performed, such as sending a prompt message to the user.
[0116] In some embodiments, the plurality of computing nodes includes a first node (i.e., the master node) and a plurality of second nodes. The first node can be selected based on requirements; for example, any computing node from the plurality of computing nodes can be used as the first node, and the other nodes can be used as the second nodes. When merging the call stack lists, each second node needs to send multiple call stack lists to the first node, which then merges them.
[0117] In practice, the above-mentioned methods for merging the call stack tree can include the following two:
[0118] In the first approach, each computing node merges the call stack linked lists within its current node to obtain the call stack subtree corresponding to its own node. Then, each second node sends its corresponding call stack subtree to the first node, which then merges the call stack subtrees.
[0119] In practice, the call stack linked lists corresponding to each business process in each computing node are merged to obtain the call stack subtree corresponding to the computing node; the call stack subtree corresponding to each second node is sent to the first node; the call stack subtree corresponding to the first node and the received call stack subtrees corresponding to each second node are merged to obtain the call stack tree.
[0120] The following example illustrates the process of merging the call stack subtrees. Assuming that call stack subtree 1 (hereinafter referred to as tree 1) is used as the base, and call stack subtree 2 (hereinafter referred to as tree 2) is merged into tree 1, the merging process is as follows:
[0121] Starting from the root nodes of the two trees, if the functions corresponding to the nodes are the same, the two root nodes are merged, and the call count of the corresponding node in tree 1 is increased; if they are different, an error is reported. If neither root node has any child nodes, the process ends. If both root nodes have one child node that is the same, the process is merged, and the merging of the child nodes' children continues. If both root nodes have one child node that is different, a new child node is created in tree 1 (i.e., the child node of the root node of tree 2), meaning the current root node will have two child nodes, and the merge is complete. If one root node has no child nodes and the other root node has child nodes, the merge is complete. If one or two root nodes have multiple child nodes, the two sets of child nodes are traversed to check if there are any identical child nodes. If there are, the two child nodes are recursively merged; if not, the merge is complete.
[0122] In one possible implementation, sending the call stack subtree corresponding to each second node to the first node includes:
[0123] Through each second node, the call stack subtree is serialized to obtain the target sequence, and the target sequence is sent to the first node;
[0124] Before merging the call stack subtree corresponding to the first node and the call stack subtrees corresponding to each of the received second nodes through the first node, the method further includes:
[0125] The first node performs deserialization on each received target sequence to obtain each call stack subtree.
[0126] In practice, the aforementioned call stack subtree is a multi-way tree with an uncertain number of nodes. After each second node generates its own corresponding call stack subtree, it serializes it to obtain a binary compressed sequence (i.e., the aforementioned target sequence). Then, each second node sends the binary sequence to the first node through a communication method such as MPI communication. The first node deserializes the received binary compressed sequence, restores it to the call stack subtree, and then merges it into a call stack tree.
[0127] In one possible implementation, the call stack subtree is serialized through each second node to obtain the target sequence, including:
[0128] The node information of the root node of the call stack subtree is added to the task queue. The following process is executed repeatedly until the task queue is empty. Then, the obtained subsequences are combined in turn to obtain the target sequence:
[0129] The node information of the target node is retrieved from the task queue, and the node information of the target node is serialized to obtain a subsequence corresponding to the target node; wherein, the target node is the first node in the task queue;
[0130] Add the node information of the child nodes of the target node in the call stack subtree to the task queue.
[0131] In practice, due to the uncertainty of the number of nodes in the call stack subtree, the above serialization process is implemented through level-order traversal. During the serialization process, a task queue is first created to store the node information of each node that needs to be serialized in sequence. Then, the root node of the call stack subtree is added to the task queue. In some embodiments, the above node information includes, but is not limited to: the call information of the node itself, the identification information of each process that calls the function corresponding to the node, and the number of child nodes included in the node and the identification information of each child node.
[0132] Then, the task queue is processed sequentially. The node information of the first node (i.e., the target node) is taken out from the task queue and serialized. It is written into the binary compressed sequence buffer in the form of a byte sequence (i.e., a subsequence). The binary compressed sequence buffer is an area in the second node used for data storage. All child nodes of the node are written into the task queue in sequence (i.e., added to the tail of the task queue). It should be noted that if the node includes multiple child nodes, the writing order of the multiple child nodes is not limited in this embodiment.
[0133] The above process is repeated until the task queue is empty. Then, all data is read from the binary compressed sequence buffer and used as the target sequence for the second node.
[0134] In one possible implementation, the first node performs deserialization on each received binary compressed sequence to obtain each call stack subtree, including:
[0135] For each target sequence, each subsequence is parsed out sequentially from the target sequence according to the order of its subsequences.
[0136] For each subsequence, a deserialization operation is performed on the subsequence to obtain the node information corresponding to the subsequence; the node information includes: the number of child nodes of the corresponding node;
[0137] For each target sequence, the call stack subtree corresponding to the target sequence is reconstructed based on the node information corresponding to each node in the target sequence.
[0138] In practice, the call stack subtree of the second node is serialized based on the above method. After each second node sends its own target sequence to the first node, the first node needs to deserialize each target sequence to restore the call stack subtree.
[0139] In some embodiments, for each target sequence, the target sequence is parsed to obtain multiple subsequences arranged in sequence. Nodes are then created sequentially based on the obtained subsequences according to their order. Specifically, the information of the first subsequence, i.e., the node information of the root node and the number of child nodes, is read to create the root node; then the information of the second subsequence is read to create one child node of the root node, and so on, until the last subsequence, thus obtaining the restored call stack subtree.
[0140] In this embodiment, when a second node sends a target sequence to a first node, it can do so sequentially or through a tree-structured communication method. Specifically, the sequential sending method involves the first second node sending its target sequence to the first node, followed by the second second node sending its target sequence, and so on, until all second nodes have completed their sending. That is, the first node receives the target sequence sent by each second node in turn. Since this method can easily make the first node a performance bottleneck, this embodiment provides a tree-structured communication method.
[0141] In one possible implementation, sending the call stack subtree corresponding to each second node to the first node includes:
[0142] The following process is repeated until the number of third nodes obtained is one. Then, the call stack subtree corresponding to each second node is sent to the first node:
[0143] Obtain each third node and divide the third nodes into first-class nodes and second-class nodes; wherein, the third node is the first-class node determined in the previous loop, and the first-class node includes the first node (that is, ensure that all call stack subtrees are sent to the first node in the end);
[0144] The first type of node and the second type of node are combined, and each combination includes one first type of node and at least one second type of node;
[0145] Through each second-type node, the call stack subtree stored in the second-type node is sent to the first-type node in the corresponding combination; the aforementioned stored call stack subtree includes: the call stack subtree corresponding to the second-type node, and the call stack subtrees of other nodes received in the past.
[0146] It should be noted that the third node obtained in the first loop is all the computing nodes in the computer device.
[0147] In specific implementation, the aforementioned first-type nodes refer to the nodes used to receive the call stack subtree (which can be in the form of a target sequence) in the current loop, and the second-type nodes refer to the nodes used to send the call stack subtree in the current loop. During each loop, when dividing the third node into first-type and second-type nodes, it is necessary to ensure that the number of first-type nodes is less than or equal to the number of second-type nodes. The specific division method is not limited in this embodiment. Furthermore, when combining first-type and second-type nodes, it is necessary to ensure that the nodes in each combination do not overlap. The specific combination method is also not limited in this embodiment.
[0148] In some embodiments, if the number of third nodes is even, half of the nodes are randomly selected from the third nodes as first-type nodes, and the remaining half are selected as second-type nodes. When combining them, each combination includes one first-type node and one second-type node. If the number of third nodes is odd, a preset number of nodes (which is half the number of third nodes minus one) are randomly selected from the third nodes as first-type nodes, and the remaining nodes are selected as second-type nodes. When combining them, there is one combination that includes two second-type nodes, and all other combinations that include only one second-type node.
[0149] like Figure 4 For example, assuming there are 16 computing nodes, numbered 0 to 15, with node 0 being the first node, the transmission process of the target sequence is as follows:
[0150] In the first loop, 8 nodes are selected from the 16 nodes (i.e., the third node in this loop) as first-class nodes, namely nodes 0, 2, 4, 6, 8, 10, 12, and 14. The remaining 8 nodes are selected as second-class nodes, namely nodes 1, 3, 5, 7, 9, 11, 13, and 15. The 8 combinations obtained after combining them are: nodes 0 and 1, nodes 2 and 3, nodes 4 and 5, and so on. In each combination, the second-class nodes send the target sequence they carry to the corresponding first-class nodes. For example, node 1 sends its own target sequence to node 0.
[0151] In the second loop, four nodes are selected from the eight third nodes (nodes 0, 2, 4, 6, 8, 10, 12, and 14) as first-class nodes, namely nodes 0, 4, 8, and 12. The remaining four nodes are selected as second-class nodes, namely nodes 2, 6, 10, and 14. The four combinations obtained after combining them are: nodes 0 and 2, nodes 4 and 6, nodes 8 and 10, and so on. In each combination, the second-class nodes send the target sequence they carry to the corresponding first-class nodes. For example, node 2 sends its own target sequence and the target sequence it previously received (i.e., the target sequence of node 3) to node 0.
[0152] In the third iteration, two nodes are selected from the four third nodes (nodes 0, 4, 8, and 12) as first-class nodes, namely nodes 0 and 8, and the remaining two nodes are selected as second-class nodes, namely nodes 4 and 12. The two combinations obtained after combining them are nodes 0 and 4, and nodes 8 and 12. In each combination, the second-class nodes send the target sequence they carry to the corresponding first-class nodes. For example, node 4 sends its own target sequence and the target sequences it previously received (i.e., the target sequences of nodes 5, 6, and 7) to node 0.
[0153] In the fourth iteration, one node is selected from the two third nodes (nodes 0 and 8) as a first-class node, namely node 0, and the remaining node is selected as a second-class node, namely node 8. The resulting combination is nodes 0 and 8. In each combination, the second-class node sends its target sequence to the corresponding first-class node. For example, node 8 sends its own target sequence and the target sequences it previously received (i.e., the target sequences of nodes 9 to 16) to node 0. Thus, all target sequences have been sent to the first-class nodes.
[0154] In the second approach, after each second node obtains the call stack information of each business process in the current node, it creates a corresponding shared file in the shared file system and stores its own call stack information in the corresponding shared file. After the first node obtains the call stack information of each second node from the shared file, it executes the subsequent process of generating the call stack linked list and call stack tree.
[0155] In specific implementation, through each second node, a shared file corresponding to each business process in the shared file system is created, and the call stack information corresponding to each business process is stored in the corresponding shared file; this shared file system is used for information sharing among computing nodes; through the first node, each shared file in the shared file system is traversed to obtain the call stack information corresponding to each business process; through the first node, a call stack linked list is generated based on the call stack information corresponding to each business process, and the call stack linked lists corresponding to each business process are merged to obtain a call stack tree.
[0156] In some embodiments, the shared file system described above allows processes on each computing node to perform read and write operations, thereby enabling information sharing among multiple computing nodes; for each second node, when creating a shared file corresponding to each business process in the shared file system, the process identifier of the corresponding business process can be used as the file name of the shared file, wherein the process identifier can be the MPI process number of the business process.
[0157] Step S104: Display the call stack tree.
[0158] In some embodiments, when displaying the call stack tree, the call stack tree can be converted into images of various formats and displayed on the display interface of the computing device. In specific implementations, the various formats mentioned above include, but are not limited to, SVG (Scalable Vector Graphics), PNG (Portable Network Graphics), etc. The conversion of the call stack tree into an image can be achieved through a graphics library, such as Graphviz.
[0159] Figure 5 The figure shows a possible call stack tree provided in an embodiment of this application. Each node in the call stack tree is a function. A total of 128 business processes participate in the function call. When the m_bcast_z_ function is called, some processes, namely processes 0, 6-14, 25-49, 51-86 and 88-127, call pmpi_bcast_, while other processes, namely processes 1-5, 15-24, 50 and 87, call pmpi_barrier_.
[0160] In some embodiments, the first node of the call stack tree (and its subtrees) can be set to "begin" to identify the start of the call sequence, such as... Figure 5 As shown.
[0161] By collecting call stack information from massively parallel programs and integrating the call stack information from each computing node into a call stack tree, developers can easily observe the runtime status of massively parallel programs when deadlock occurs, and more quickly find the key functions causing the parallel program failure. Secondly, it can also help developers better understand the behavior of different processes in a parallel program, which helps them design better behavior for parallel programs.
[0162] The following combination Figure 6 The process of merging call stack information described above will be explained in detail with a specific example. The process includes the following steps:
[0163] Step S601: Create a data acquisition process on each computing node using MPI or RPC technology;
[0164] Step S602: Each computing node determines the process information of the business processes that need to be collected through the collection process.
[0165] Step S603: Each computing node collects the call stack information of the business process based on the process information of the business process through the collection process.
[0166] Step S604: Each computing node, through the acquisition process, merges the call stack information of each business process in the current node into a corresponding call stack linked list, and merges each call stack linked list into a call stack subtree.
[0167] In step S605, each computing node serializes the call stack subtree and sends it to the first node;
[0168] Step S606: The first node deserializes the received target sequence and merges the call stack subtrees obtained after deserialization to generate a call stack tree.
[0169] Step S607: Visualize and display the call stack tree.
[0170] It should be noted that steps S602 to S604 are completed by the acquisition process on each computing node on the corresponding computing node, while steps S606 to S607 are completed by the first node.
[0171] Based on the same inventive concept, this application also provides a call stack information merging device, applied to a computer device, the computer device including multiple computing nodes, see [link to relevant documentation]. Figure 7 The device includes:
[0172] The acquisition module 701 is used to acquire the call stack information corresponding to each business process in each computing node; the call stack information includes: the functions called in the history of the corresponding business process and the call relationship between the functions;
[0173] The generation module 702 is used to generate a call stack linked list for each business process based on the call stack information corresponding to the business process; the nodes in the call stack linked list are used to represent the call information of the corresponding function, and the connecting lines between the nodes are used to represent the call relationship between the functions;
[0174] The merging module 703 is used to merge the call stack linked lists corresponding to each business process to obtain a call stack tree. When merging any two call stack linked lists, one of the call stack linked lists is traversed. When it is determined that there are nodes in common with the other call stack linked list, the call information of the common nodes is merged.
[0175] Display module 704 is used to display the call stack tree.
[0176] Optionally, the aforementioned merging module 703 is specifically used for:
[0177] Merge the call stack linked lists corresponding to each business process in the computing node to obtain the call stack subtree corresponding to each computing node;
[0178] When it is determined that the root nodes of the call stack subtrees corresponding to each computing node are the same, the call stack subtrees corresponding to each computing node are merged to obtain the call stack tree;
[0179] If the root node of any call stack subtree is different from the root node of other call stack subtrees, it is determined that there is an error in any call stack subtree, and a prompt message is sent to the user.
[0180] Optionally, the multiple computing nodes include a first node and multiple second nodes. The aforementioned merging module 703 is specifically used for:
[0181] For each computing node, the call stack linked lists corresponding to each business process in the computing node are merged to obtain the call stack subtree corresponding to the computing node.
[0182] Through each second node, the call stack subtree corresponding to the second node is sent to the first node;
[0183] By merging the call stack subtree corresponding to the first node and the call stack subtrees corresponding to each of the received second nodes, a call stack tree is obtained.
[0184] Optionally, the aforementioned merging module 703 is specifically used for:
[0185] Through each second node, the call stack subtree is serialized to obtain the target sequence, and the target sequence is sent to the first node;
[0186] Before merging the call stack subtree corresponding to the first node and the call stack subtrees corresponding to each of the received second nodes, the method also includes:
[0187] The first node performs deserialization on each received target sequence to obtain each call stack subtree.
[0188] Optionally, the aforementioned merging module 703 is specifically used for:
[0189] Add the node information of the root node of the call stack subtree to the task queue, and repeat the following process until the task queue is empty. Then, combine the obtained subsequences in turn to obtain the target sequence:
[0190] Retrieve the node information of the target node from the task queue, and perform a serialization operation on the node information of the target node to obtain the subsequence corresponding to the target node; where the target node is the first node in the task queue.
[0191] Add the node information of the child nodes of the target node in the call stack subtree to the task queue.
[0192] Optionally, the aforementioned merging module 703 is specifically used for:
[0193] For each target sequence, each subsequence is parsed out sequentially according to the order of its subsequences.
[0194] For each subsequence, perform a deserialization operation to obtain the node information corresponding to the subsequence; the node information includes: the number of child nodes of the corresponding node;
[0195] For each target sequence, the call stack subtree corresponding to the target sequence is reconstructed based on the node information corresponding to each node in the target sequence.
[0196] Optionally, the aforementioned merging module 703 is specifically used for:
[0197] Repeat the following process until the number of third nodes obtained is one, then determine the call stack subtree corresponding to each second node and send it to the first node:
[0198] Obtain each third node and divide the third nodes into first-class nodes and second-class nodes. The third nodes are the first-class nodes determined in the previous loop, and the first-class nodes include the first nodes.
[0199] The first type of node and the second type of node are combined, and each combination includes one first type of node and at least one second type of node;
[0200] Through each second-type node, the call stack subtree stored in the second-type node is sent to the first-type node in the corresponding combination; the stored call stack subtree includes: the call stack subtree corresponding to the second-type node, and the call stack subtrees of other nodes received in the past.
[0201] Optionally, the multiple computing nodes include a first node and multiple second nodes; the aforementioned merging module 703 is specifically used for:
[0202] For each business process, before generating the call stack linked list based on the call stack information corresponding to the business process, a shared file corresponding to each business process in the shared file system is created in each second node, and the call stack information corresponding to each business process is stored in the corresponding shared file; the shared file system is used for information sharing between computing nodes;
[0203] By using the first node, we can traverse each shared file in the shared file system and obtain the call stack information corresponding to each business process.
[0204] Based on the same inventive concept, this application also provides an electronic device that can implement the function of the aforementioned call stack information merging device. (Refer to...) Figure 8 The electronic device includes:
[0205] At least one processor 801 and a memory 802 connected to at least one processor 801. In this embodiment, the specific connection medium between the processor 801 and the memory 802 is not limited. Figure 8 The example shown is the connection between processor 801 and memory 802 via bus 800. Bus 800 is... Figure 8 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The 800 bus can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 8 The term is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, the processor 801 can also be called a controller; there is no restriction on the name.
[0206] In this embodiment, memory 802 stores instructions executable by at least one processor 801. By executing the instructions stored in memory 802, at least one processor 801 can execute the call stack information merging method discussed above. Processor 801 can implement... Figure 7 The functions of each module in the device shown.
[0207] The processor 801 is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 802 and calling data stored in memory 802, the processor can perform various functions and process data, thereby monitoring the device as a whole.
[0208] In one possible design, processor 801 may include one or more processing units. Processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 801. In some embodiments, processor 801 and memory 802 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.
[0209] The processor 801 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the call stack information merging method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0210] Memory 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 802 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 802 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 802 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0211] By designing and programming the processor 801, the code corresponding to the application anomaly detection method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute it during runtime. Figure 1 The steps of the call stack information merging method in the illustrated embodiment are as follows. How to design and program the processor 801 is a technique well-known to those skilled in the art and will not be described further here.
[0212] This application also provides a computer-readable storage medium storing computer-executable instructions required to execute the processor, including a program required to execute the processor.
[0213] In some possible implementations, various aspects of the call stack information merging method provided in this application can also be implemented as a program product, which includes program code. When the program product is run on an electronic device, the program code is used to cause the electronic device to perform the steps in the call stack information merging method according to various exemplary embodiments of this application described above.
[0214] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0215] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0216] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0217] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0218] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0219] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for merging call stack information, characterized in that, Applied to a computer device, the computer device including multiple computing nodes, the method includes: For each computing node, obtain the call stack information corresponding to each business process in the computing node; the call stack information includes: the functions called in the history of the corresponding business process and the call relationship between the functions; For each business process, a call stack linked list is generated based on the call stack information corresponding to the business process; the nodes in the call stack linked list are used to represent the call information of the corresponding function, and the connecting lines between the nodes are used to represent the call relationship between the functions; The call stack linked lists corresponding to each business process are merged to obtain a call stack tree. When merging any two call stack linked lists, one of the call stack linked lists is traversed. When it is determined that there are nodes shared with the other call stack linked list, the call information of the shared nodes is merged. The call stack tree is then displayed.
2. The method according to claim 1, characterized in that, The process of merging the call stack linked lists corresponding to each business process to obtain a call stack tree includes: Merge the call stack linked lists corresponding to each business process in the computing node to obtain the call stack subtree corresponding to each computing node; When it is determined that the root nodes of the call stack subtrees corresponding to each computing node are the same, the call stack subtrees corresponding to each computing node are merged to obtain the call stack tree; The method further includes: If the root node of any call stack subtree is different from the root node of other call stack subtrees, it is determined that there is an error in the call stack subtree, and a prompt message is sent to the user.
3. The method according to claim 1 or 2, characterized in that, The plurality of computing nodes includes a first node and a plurality of second nodes; the merging of the call stack linked lists corresponding to each business process to obtain a call stack tree includes: For each computing node, the call stack linked lists corresponding to each business process in the computing node are merged to obtain the call stack subtree corresponding to the computing node. Through each second node, the call stack subtree corresponding to the second node is sent to the first node; The call stack tree is obtained by merging the call stack subtree corresponding to the first node and the call stack subtrees corresponding to each of the received second nodes.
4. The method according to claim 3, characterized in that, The step of sending the call stack subtree corresponding to each second node to the first node includes: Through each second node, the call stack subtree is serialized to obtain the target sequence, and the target sequence is sent to the first node; Before merging the call stack subtree corresponding to the first node and the call stack subtrees corresponding to each of the received second nodes through the first node, the method further includes: The first node performs deserialization on each received target sequence to obtain each call stack subtree.
5. The method according to claim 4, characterized in that, The step of serializing the call stack subtree through each second node to obtain the target sequence includes: The node information of the root node of the call stack subtree is added to the task queue. The following process is executed repeatedly until the task queue is empty. Then, the obtained subsequences are combined in turn to obtain the target sequence: The node information of the target node is retrieved from the task queue, and the node information of the target node is serialized to obtain a subsequence corresponding to the target node; wherein, the target node is the first node in the task queue; Add the node information of the child nodes of the target node in the call stack subtree to the task queue.
6. The method according to claim 5, characterized in that, The step involves deserializing the received binary compressed sequences through the first node to obtain each call stack subtree, including: For each target sequence, each subsequence is parsed out sequentially from the target sequence according to the order of its subsequences. For each subsequence, a deserialization operation is performed on the subsequence to obtain the node information corresponding to the subsequence; the node information includes: the number of child nodes of the corresponding node; For each target sequence, the call stack subtree corresponding to the target sequence is reconstructed based on the node information corresponding to each node in the target sequence.
7. The method according to claim 3, characterized in that, The step of sending the call stack subtree corresponding to each second node to the first node includes: The following process is repeated until the number of third nodes obtained is one. Then, the call stack subtree corresponding to each second node is sent to the first node: Obtain each third node and divide the third nodes into a first type of node and a second type of node, wherein the third node is a first type of node determined in the previous loop, and the first type of node includes the first node; The first type of node and the second type of node are combined, and each combination includes one first type of node and at least one second type of node; Through each second-type node, the call stack subtree stored in the second-type node is sent to the first-type node in the corresponding combination; the stored call stack subtree includes: the call stack subtree corresponding to the second-type node, and the call stack subtrees of other nodes received in the past.
8. The method according to claim 1 or 2, characterized in that, The plurality of computing nodes includes a first node and a plurality of second nodes; before generating a call stack linked list for each business process based on the call stack information corresponding to the business process, the method further includes: Through each second node, a shared file corresponding to each business process in the second node is created in the shared file system, and the call stack information corresponding to each business process is stored in the corresponding shared file; the shared file system is used for information sharing among the computing nodes; The first node is used to traverse each shared file in the shared file system to obtain the call stack information corresponding to each business process.
9. A call stack information merging device, characterized in that, Applied to a computer device, the computer device including multiple computing nodes, the device includes: The acquisition module is used to acquire the call stack information corresponding to each business process in the computing node for each computing node; the call stack information includes: the functions historically called by the corresponding business process and the call relationship between each function; The generation module is used to generate a call stack linked list for each business process based on the call stack information corresponding to the business process; the nodes in the call stack linked list are used to represent the call information of the corresponding functions, and the connecting lines between the nodes are used to represent the call relationship between the functions; The merging module is used to merge the call stack linked lists corresponding to each business process to obtain a call stack tree. When merging any two call stack linked lists, one of the call stack linked lists is traversed. When it is determined that there are nodes in common with the other call stack linked list, the call information of the common nodes is merged. The display module is used to display the call stack tree.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a computer program stored in the memory, implements the method of any one of claims 1-8.
