Flame pattern generation method and device, storage medium and electronic equipment

By sampling multiple nodes and sending information of thread execution process to the data center for processing, the problem of excessive resource occupation caused by a single node generating flame graph is solved, and more efficient performance analysis and problem positioning is achieved.

CN120104441AActive Publication Date: 2025-06-06ALIBABA CLOUD COMPUTING CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510593802.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-06-06
Estimated Expiration
2045-05-08

AI Technical Summary

Technical Problem

Generating a flame graph through a single node leads to excessive resource usage on the node side.

Method used

Multiple nodes are used to sample and process the execution process of multiple threads, obtain sampling point information, and send this information to the data center for processing to generate a target flame map.

Benefits of technology

Migrating resource-intensive tasks from the performance-sensitive node side to the data center end with higher computing power and storage capacity avoids the problem of excessive resource occupation caused by data processing on the node side and improves the efficiency and accuracy of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104441A_ABST
    Figure CN120104441A_ABST
Patent Text Reader

Abstract

The invention discloses a flame pattern generation method and device, a storage medium and electronic equipment. Relates to the technical field of computers, and comprises the following steps: sampling execution processes of a plurality of threads to obtain information of a plurality of sampling points, the information of the sampling points at least comprising target address information corresponding to the plurality of threads at sampling moments; sending the multiple pieces of sampling point information to a data center end; target symbol information corresponding to the sampling point information in the multiple pieces of sampling point information is sent to the data center end, and the multiple pieces of sampling point information and the target symbol information are processed at the data center end to obtain a target flame map. The technical problem that the node side occupies too high resources due to the fact that a flame graph is generated through a single node is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for generating a flame graph, a storage medium, and an electronic device. Background Art

[0002] The flame graph is one of the important tools for software system performance analysis. It is widely used in servers, distributed systems, Web applications, databases, games, Android applications and other fields. It helps to quickly locate performance bottlenecks and stack call processes by visually collecting call chain data. The flame graph tool is based on call chain data statistical analysis, statistics the execution time, number of calls and call relationships of the call chain, and intuitively displays the stack call process through a heat map, reflecting the hot call functions and call relationships, helping developers quickly locate performance bottlenecks and call processes. In the prior art, the generation of flame graphs is usually implemented on the node side of the distributed system, but this method occupies a large amount of storage and computing resources on the node side, seriously affecting system performance.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a method and device for generating a flame graph, a storage medium, and an electronic device, so as to at least solve the technical problem that generating a flame graph through a single node causes excessive resource occupation on the node side.

[0005] According to one aspect of an embodiment of the present application, a flame graph generation method is provided, comprising: performing sampling processing on execution processes of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; sending the multiple sampling point information to a data center end; sending target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein, at the data center end, the multiple sampling point information and the target symbol information are processed to obtain a target flame graph.

[0006] Furthermore, the execution process of the multiple threads is sampled to obtain the multiple sampling point information, including: if the flame graph to be generated is a flame graph of the first type, sampling the time information when the multiple threads are executed in the central processing unit to obtain the multiple sampling point information; if the flame graph to be generated is a flame graph of the second type, sampling the time information when the multiple threads are called out of the central processing unit and called into the central processing unit to obtain the multiple sampling point information.

[0007] Furthermore, sampling the execution process of multiple threads to obtain multiple sampling point information includes: for a target node among the multiple nodes, determining a target thread on which the multiple threads run on the target node, wherein the target node is any one of the multiple nodes; sampling the execution process of the target thread to obtain the multiple sampling point information.

[0008] Furthermore, sending target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end includes: matching the target address information based on a preset symbol information table to obtain initial symbol information corresponding to the target address information; performing deduplication processing on the initial symbol information to obtain the target symbol information; and sending the target symbol information to the data center end.

[0009] Furthermore, before sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center, the method also includes: for a target node in the multiple nodes, determining multiple functions involved in the target node, wherein the target node is any one of the multiple nodes; performing a hash transformation on the address information corresponding to the multiple functions to obtain symbol information corresponding to the functions in the multiple functions; and forming a symbol information table according to the symbol information corresponding to the functions in the multiple functions.

[0010] Furthermore, after deduplicating the initial symbol information to obtain the target symbol information, the method also includes: based on the announcement information released by the data center, obtaining the historical symbol information received by the data center; based on the historical symbol information, deduplicating the target symbol information to obtain the processed target symbol information; sending the target symbol information to the data center includes: sending the processed target symbol information to the data center.

[0011] According to another aspect of an embodiment of the present application, a flame graph generation method is further provided, including: receiving multiple sampling point information sent by multiple nodes, wherein the multiple sampling point information is obtained by sampling the execution process of multiple threads by the multiple nodes, and the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; receiving target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes; and processing the multiple sampling point information and the target symbol information to obtain a target flame graph.

[0012] Furthermore, processing the multiple sampling point information and the target symbol information to obtain a target flame graph includes: determining time proportion information of multiple functions in threads of the multiple threads based on the multiple sampling point information; and matching the time proportion information with the target symbol information to obtain the target flame graph.

[0013] Furthermore, after receiving the target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes, the method also includes: composing target announcement information to be published based on the target symbol information; and publishing the target announcement information to inform the multiple nodes of the symbol information currently received by the data center.

[0014] According to another aspect of an embodiment of the present application, a flame graph generation device is further provided, including: a first processing unit, configured to perform sampling processing on execution processes of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; a first sending unit, configured to send the multiple sampling point information to a data center end; and a second sending unit, configured to send target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein at the data center end, the multiple sampling point information and the target symbol information are processed to obtain a target flame graph.

[0015] Furthermore, the first processing unit includes: a first sampling module, which is used to sample the time information when the multiple threads are executed in the central processing unit if the flame graph to be generated is a flame graph of the first type, so as to obtain the multiple sampling point information; and a second sampling module, which is used to sample the time information when the multiple threads are called out of the central processing unit and called into the central processing unit if the flame graph to be generated is a flame graph of the second type, so as to obtain the multiple sampling point information.

[0016] Furthermore, the processing unit includes: a determination module, used to determine, for a target node among the multiple nodes, a target thread of the multiple threads running on the target node, wherein the target node is any one of the multiple nodes; and a processing module, used to sample the execution process of the target thread to obtain the multiple sampling point information.

[0017] Furthermore, the second sending unit includes: a matching module, used to match the target address information based on a preset symbol information table to obtain the initial symbol information corresponding to the target address information; a processing module, used to deduplicate the initial symbol information to obtain the target symbol information; and a sending module, used to send the target symbol information to the data center.

[0018] Furthermore, the device also includes: a determination unit, used to determine, for a target node among the multiple nodes, multiple functions involved in the target node before sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein the target node is any one of the multiple nodes; a transformation unit, used to perform hash transformation on the address information corresponding to the multiple functions to obtain symbol information corresponding to the functions in the multiple functions; and a first generation unit, used to compose a symbol information table according to the symbol information corresponding to the functions in the multiple functions.

[0019] Furthermore, the device also includes: an acquisition unit, which is used to obtain historical symbol information received by the data center based on the announcement information released by the data center after deduplicating the initial symbol information to obtain the target symbol information; a second processing unit, which is used to deduplicate the target symbol information based on the historical symbol information to obtain processed target symbol information; and a second sending unit, which is also used to send the processed target symbol information to the data center.

[0020] According to another aspect of an embodiment of the present application, a flame graph generation device is further provided, including: a first receiving unit, configured to receive a plurality of sampling point information sent by a plurality of nodes, wherein the plurality of sampling point information is obtained by sampling execution processes of a plurality of threads, and the sampling point information at least includes: target address information corresponding to the plurality of threads at sampling moments; a second receiving unit, configured to receive target symbol information corresponding to the sampling point information in the plurality of sampling point information sent by the plurality of nodes; and a processing unit, configured to process the plurality of sampling point information and the target symbol information to obtain a target flame graph.

[0021] Furthermore, the processing unit includes: a determination module, used to determine the time proportion information of multiple functions in the threads of the multiple threads based on the multiple sampling point information; a matching module, used to match the time proportion information and the target symbol information to obtain the target flame graph.

[0022] Furthermore, the device also includes: a second generating unit, which is used to form target announcement information to be published based on the target symbol information after receiving the target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes; and a publishing unit, which is used to publish the target announcement information to inform the multiple nodes of the symbol information currently received by the data center.

[0023] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein any one of the above flame graph generation methods is executed when the program is running.

[0024] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein when the program is running, the device where the storage medium is located is controlled to execute any of the above-mentioned flame graph generation methods.

[0025] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program or an instruction, and when the computer program or the instruction is executed by a processor, the method for generating a flame graph of any one of the above items is implemented.

[0026] In an embodiment of the present application, the following steps are adopted: performing sampling processing on the execution process of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; sending the multiple sampling point information to the data center end; sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein, at the data center end, the multiple sampling point information and the target symbol information are processed to obtain a target flame graph, which solves the technical problem of generating a flame graph through a single node, resulting in excessive resource occupation on the node side.

[0027] In this solution, the execution process of multiple threads is sampled and processed by multiple nodes to obtain the target address information corresponding to the multiple threads at the sampling time. The multiple nodes directly send the multiple sampling point information obtained by sampling to the data center end, and the multiple nodes also send the target symbol information corresponding to the sampling point information (that is, the function name corresponding to the address) to the data center end. After the data center end receives the sampling point information and target symbol information sent by each node, it generates a target flame graph according to the sampling point information and the target symbol information. By sending the multiple sampling point information and the target symbol information to the data center end, the resource-intensive tasks are migrated from the performance-sensitive node side to the data center end with higher computing power and storage capacity, avoiding the problem of excessive resource occupation caused by data processing on the node side. Since the processing of symbol information and sampling point data is carried out on the data center end, the powerful computing power of the data center end can be used to improve the efficiency and accuracy of data processing, thereby achieving the technical effect of optimizing the performance analysis process, reducing the resource occupation on the node side, and accelerating the location of problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0029] Figure 1 is a hardware structure block diagram of a computer terminal provided according to Embodiment 1 of the present application;

[0030] Figure 2 is a flowchart of a method for generating a flame graph according to Embodiment 1 of the present application;

[0031] Figure 3 is a flowchart of a method for generating a flame graph according to Embodiment 2 of the present application;

[0032] Figure 4 is a schematic diagram of a method for generating a flame graph according to Embodiment 2 of the present application;

[0033] Figure 5 is a schematic diagram of a flame graph generation device provided according to Embodiment 3 of the present application;

[0034] Figure 6 is a schematic diagram of a flame graph generation device provided according to Embodiment 4 of the present application;

[0035] Figure 7 This is a structural block diagram of an electronic device provided according to Embodiment 5 of the present application. DETAILED DESCRIPTION

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

[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0038] It should be noted that 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 in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0039] Example 1

[0040] According to an embodiment of the present application, a method for generating a flame graph is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0041] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for generating a flame graph. Figure 1 As shown, the computer terminal (or mobile device) 10 may include a processor set 102 (the processor set 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA, and the processor set 102 may include a processor set, Figure 1 102a, 102b, ..., 102n are used to illustrate), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0042] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0043] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method for generating a flame graph in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method for generating the flame graph described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0044] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0045] The display may be a touch screen type liquid crystal display, which may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0046] Under the above operating environment, this application provides Figure 2 The flame graph shown is generated. Figure 2 1 is a flow chart of a method for generating a flame graph according to Embodiment 1 of the present application. The flame graph is applied to multiple nodes, and the method includes:

[0047] Step S201, sampling is performed on the execution process of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time.

[0048] Optionally, in a distributed system, real-time monitoring and data capture of thread activities running on different nodes are performed to evaluate and optimize system performance. The sampling frequency is configured on the nodes in the multiple nodes. The sampling frequency determines the intensity of the sampling process, that is, the node captures a sampling point every certain time interval or every time a certain number of instructions are executed.

[0049] When sampling is triggered, multiple nodes will sample the running threads and obtain the memory address of the instruction currently being executed by the thread, that is, the target address information. In addition, the thread ID, thread call stack and other information can also be recorded to provide a more comprehensive running context. It should be noted that threads perform related tasks by calling multiple functions. After these functions are sampled at runtime, the information obtained is the address information corresponding to these functions.

[0050] Step S202: sending information of multiple sampling points to a data center.

[0051] Optionally, after obtaining multiple sampling point information, the multiple sampling point information is sent to the data center through multiple nodes. In order to improve data transmission efficiency, multiple nodes can locally pre-process the captured sampling point information, including but not limited to data compression and encoding, to reduce the data volume during transmission and save network bandwidth resources.

[0052] During the transmission process, data encryption can also be used to protect the security of sensitive performance data and prevent information from being intercepted or tampered with during transmission. At the same time, in order to ensure the integrity of the data, the network transmission strategy needs to take into account potential delays and packet loss. Therefore, error checking codes can be added to the information of multiple sampling points.

[0053] Step S203: sending target symbol information corresponding to the sampling point information in the plurality of sampling point information to the data center end, wherein the plurality of sampling point information and the target symbol information are processed at the data center end to obtain a target flame graph.

[0054] Optionally, after collecting and obtaining the plurality of sampling point information, the plurality of nodes will perform address derivation symbols, that is, convert the target address information in the sampling point information into target symbol information. It should be noted that the target symbol information includes the function name corresponding to the address, so that a flame graph can be subsequently generated according to the function name. After obtaining the target symbol information corresponding to the sampling point information, the target symbol information corresponding to the sampling point information in the plurality of sampling point information is sent to the data center end through the plurality of nodes.

[0055] The data center generates a target flame graph based on the received multiple sampling point information and target symbol information. Through the target flame graph, users can intuitively understand the consumption of system resources, identify performance bottlenecks, and provide accurate guidance for subsequent performance optimization.

[0056] In summary, by sampling and processing the execution process of multiple threads on multiple nodes, the target address information corresponding to the multiple threads at the sampling time is obtained, and the multiple nodes directly send the multiple sampling point information obtained by sampling to the data center end, and the multiple nodes also send the target symbol information corresponding to the sampling point information (that is, the function name corresponding to the address) to the data center end. After the data center end receives the sampling point information and target symbol information sent by each node, it generates a target flame graph according to the sampling point information and the target symbol information. By sending the multiple sampling point information and the target symbol information to the data center end, the resource-intensive tasks are migrated from the performance-sensitive node side to the data center end with higher computing power and storage capacity, avoiding the problem of excessive resource occupation caused by data processing on the node side. Since the processing of symbol information and sampling point data is carried out on the data center end, the powerful computing power of the data center end can be used to improve the efficiency and accuracy of data processing, thereby achieving the technical effect of optimizing the performance analysis process, reducing the resource occupation on the node side, and accelerating the location of problems.

[0057] In order to improve the accuracy of sampling, in the flame graph generation method provided in the first embodiment of the present application, the execution process of multiple threads is sampled to obtain multiple sampling point information, including: if the flame graph to be generated is a flame graph of the first type, the time information of the multiple threads when they are executed in the central processing unit is sampled to obtain multiple sampling point information; if the flame graph to be generated is a flame graph of the second type, the time information of the multiple threads when they are called out of the central processing unit and called into the central processing unit is sampled to obtain multiple sampling point information.

[0058] Optionally, sampling the execution process of multiple threads through multiple nodes includes the following steps: first, determining different sampling strategies according to the type of flame graph to be generated. The type of flame graph includes a first type and a second type, the first type is an oncpu flame graph, and the second type is an offcpu flame graph.

[0059] If the target flame graph is a flame graph of the first type, time information of multiple threads when they are executed in the central processing unit is sampled through multiple nodes, that is, the threads are sampled when the CPU is executed. For example, multiple sampling point information is obtained by sampling cycle events of the central processing unit.

[0060] If the target flame graph is the second type of flame graph, the thread scheduling event is focused on, that is, the time information when the thread is called out of the CPU and called back into the CPU is collected. For example, the process switching event finish_task_switch is sampled. The finish_task_switch event records the thread pid that is scheduled out of the CPU and the thread pid that is scheduled into the CPU, as well as the timestamp and call stack when the event occurs.

[0061] Dynamically adjusting the sampling strategy according to analysis requirements can not only provide an in-depth understanding of the execution details on the CPU, but also provide insights into the performance impact at the thread scheduling level, thus improving the flexibility and pertinence of flame graph generation.

[0062] In order to improve the accuracy of sampling, in the flame graph generation method provided in the first embodiment of the present application, the execution process of multiple threads is sampled and processed to obtain multiple sampling point information, including: for a target node among multiple nodes, determining a target thread on which multiple threads run on the target node, wherein the target node is any one of the multiple nodes; and sampling the execution process of the target thread through the target node to obtain multiple sampling point information.

[0063] Optionally, different threads may be run on different nodes according to different needs of users. Therefore, for any one of the multiple nodes (i.e., the target node mentioned above), a target thread running on the target node among the multiple threads is determined, and then, the execution process of the target thread is sampled through the target node to obtain multiple sampling point information.

[0064] Through the above steps, users can define target threads according to their own needs, such as focusing on a specific functional module, a high-load task thread, or a thread with a specific performance bottleneck. This makes the sampling point information more relevant, and the generated flame graph can intuitively and accurately display the performance status and call stack information of the target thread, helping users quickly locate the core of the performance problem.

[0065] In order to improve the accuracy of determining symbol information, in the flame graph generation method provided in the first embodiment of the present application, before sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, the method also includes: for a target node in the multiple nodes, determining multiple functions involved in the target node, wherein the target node is any one of the multiple nodes; performing hash transformation on the address information corresponding to the multiple functions to obtain symbol information corresponding to the functions in the multiple functions; and forming a symbol information table according to the symbol information corresponding to the functions in the multiple functions.

[0066] Optionally, before sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center through multiple nodes, the following steps are used to obtain the symbol information table of any one of the multiple nodes: First, identify and determine all active functions on the target node. These functions involve the execution path of the target thread and are the basic units for generating flame graphs. In this way, it is possible to focus on functions that are closely related to performance analysis in a targeted manner. Then, the address information corresponding to the multiple functions is hashed, and finally the symbol information table is constructed by the symbol information corresponding to the function obtained by the hashing transformation, so that the data center can perform global symbol resolution and flame graph generation in the future.

[0067] The address information is mapped to the symbol information through hash transformation to obtain the symbol information table, which helps to quickly match the target address information in the sampling point information and improve the efficiency of subsequent flame graph generation.

[0068] In order to improve the transmission efficiency of symbol information, in the flame graph generation method provided in the first embodiment of the present application, sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end includes: matching the target address information based on a preset symbol information table through the target node to obtain the initial symbol information corresponding to the target address information; deduplicating the initial symbol information through the target node to obtain the target symbol information; and sending the target symbol information to the data center end through the target node.

[0069] Optionally, after acquiring information of multiple sampling points, the target address information captured during the sampling process is matched based on the previously constructed symbol information table, and the target address information is converted into initial symbol information. This initial conversion process greatly facilitates subsequent data analysis, translating the originally difficult-to-interpret address information into an intuitive function call stack, improving the readability and analysis value of the data.

[0070] Since multiple sampling points on the same node may frequently touch the same function call, this will cause a large amount of duplicate symbol information to occupy network bandwidth during transmission, increasing the processing burden on the data center. Therefore, the target node will perform deduplication processing on the initial symbol information. By deduplication, duplicate symbol information can be filtered out, which not only significantly reduces the amount of data transmission, but also reduces the data redundancy that needs to be processed by the data center, optimizing the overall performance analysis process. Finally, the target symbol information is sent to the data center through the target node.

[0071] By performing deduplication processing before transmission, the amount of data is reduced, the bandwidth and time required for network transmission are reduced, and the data transmission efficiency is improved.

[0072] In order to further improve the transmission efficiency of symbol information, in the flame graph generation method provided in Example 1 of the present application, after the initial symbol information is deduplicated through the target node to obtain the target symbol information, the method also includes: obtaining historical symbol information received by the data center end based on the announcement information published by the data center end through the target node; deduplicating the target symbol information based on the historical symbol information through the target node to obtain processed target symbol information; sending the target symbol information to the data center end through the target node includes: sending the processed target symbol information to the data center end through the target node.

[0073] Optionally, in order to further optimize the transmission efficiency of the symbol information, after the initial symbol information is deduplicated by the target node, the target node will actively obtain announcement information from the data center, wherein the announcement information includes all historical symbol information that has been received and processed by the data center, and the target node performs secondary deduplication processing on the locally generated target symbol information according to the symbol information in the announcement information. Finally, the processed target symbol information is sent to the data center.

[0074] The deduplication strategy based on historical data reduces the amount of data sent by the target node to the center, reduces network transmission delay, and improves the efficiency and performance of data transmission.

[0075] In the flame graph generation method provided in the first embodiment of the present application, the execution process of multiple threads is sampled and processed to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; the multiple sampling point information is sent to the data center end; the target symbol information corresponding to the sampling point information in the multiple sampling point information is sent to the data center end, wherein, at the data center end, the multiple sampling point information and the target symbol information are processed to obtain a target flame graph, which solves the technical problem of generating a flame graph through a single node, resulting in excessive resource occupation on the node side.

[0076] In this solution, the execution process of multiple threads is sampled and processed by multiple nodes to obtain the target address information corresponding to the multiple threads at the sampling time. The multiple nodes directly send the multiple sampling point information obtained by sampling to the data center end, and the multiple nodes also send the target symbol information corresponding to the sampling point information (that is, the function name corresponding to the address) to the data center end. After the data center end receives the sampling point information and target symbol information sent by each node, it generates a target flame graph according to the sampling point information and the target symbol information. By sending the multiple sampling point information and the target symbol information to the data center end, the resource-intensive tasks are migrated from the performance-sensitive node side to the data center end with higher computing power and storage capacity, avoiding the problem of excessive resource occupation caused by data processing on the node side. Since the processing of symbol information and sampling point data is carried out on the data center end, the powerful computing power of the data center end can be used to improve the efficiency and accuracy of data processing, thereby achieving the technical effect of optimizing the performance analysis process, reducing the resource occupation on the node side, and accelerating the location of problems.

[0077] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0079] Example 2

[0080] According to an embodiment of the present application, a method for generating a flame graph is also provided. Figure 3 is a flow chart of a method for generating a flame graph according to the second embodiment of the present application. The generation method is applied to a data center end, and the method includes: Figure 3 As shown, the method includes:

[0081] Step S301: receiving a plurality of sampling point information sent by a plurality of nodes, wherein the plurality of sampling point information is obtained by sampling the execution process of a plurality of threads by the plurality of nodes, and the sampling point information at least includes: target address information corresponding to the plurality of threads at the sampling time.

[0082] Optionally, multiple nodes will sample the running threads to obtain the memory address of the instruction currently being executed by the thread, that is, the target address information. In addition, the thread ID, thread call stack and other information can also be recorded to provide a more comprehensive running context. It should be noted that threads perform related tasks by calling multiple functions. After these functions are sampled at runtime, the information obtained is the address information corresponding to these functions. After obtaining multiple sampling point information, the multiple sampling point information is sent to the data center through multiple nodes. Receive multiple sampling point information sent by multiple nodes.

[0083] Step S302: receiving target symbol information corresponding to sampling point information in a plurality of sampling point information sent by a plurality of nodes.

[0084] Optionally, after collecting and obtaining multiple sampling point information, multiple nodes will perform address derivation symbols, that is, convert the target address information in the sampling point information into target symbol information. It should be noted that the target symbol information includes the function name corresponding to the address, so that a flame graph can be generated according to the function name later. After obtaining the target symbol information corresponding to the sampling point information, the target symbol information corresponding to the sampling point information in the multiple sampling point information is sent to the data center end through multiple nodes. The target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes is received through the data center end, so that a target flame graph can be generated according to the received multiple sampling point information and target symbol information. Through the target flame graph, the user can intuitively understand the consumption of system resources, identify performance bottlenecks, and provide accurate guidance for subsequent performance optimization.

[0085] Step S303: Process the multiple sampling point information and target symbol information to obtain a target flame graph.

[0086] Optionally, when the data center receives the sampling point information and target symbol information sent by each node, the target symbol information is re-associated with the corresponding sampling point information to restore the call stack corresponding to the sampling point. The execution time information of the function in the call stack is calculated according to the number of sampling points, and the target flame graph is generated according to the execution time information.

[0087] In summary, the execution process of multiple threads is sampled and processed through multiple nodes to obtain the target address information corresponding to the multiple threads at the sampling time. The multiple nodes directly send the multiple sampling point information obtained by sampling to the data center end, and the multiple nodes also send the target symbol information corresponding to the sampling point information (that is, the function name corresponding to the address) to the data center end. After the data center end receives the sampling point information and target symbol information sent by each node, it generates a target flame graph according to the sampling point information and the target symbol information. By sending the multiple sampling point information and the target symbol information to the data center end, the resource-intensive tasks are migrated from the performance-sensitive node side to the data center end with higher computing power and storage capacity, avoiding the problem of excessive resource occupation caused by data processing on the node side. Since the processing of symbol information and sampling point data is carried out on the data center end, the powerful computing power of the data center end can be used to improve the efficiency and accuracy of data processing, thereby achieving the technical effect of optimizing the performance analysis process, reducing the resource occupation on the node side, and accelerating the location of problems.

[0088] In order to improve the accuracy of the target flame graph, in the flame graph generation method provided in the second embodiment of the present application, multiple sampling point information and target symbol information are processed to obtain the target flame graph, including: based on the multiple sampling point information, determining the time proportion information of multiple functions in the threads of multiple threads; matching the time proportion information and the target symbol information to obtain the target flame graph.

[0089] Optionally, after receiving the sampling point information and target symbol information sent by multiple nodes, the data center processes the sampling data and target symbol information to determine the proportion of execution time of each function in the thread, that is, the proportion of their total execution time. By recording the timestamp, execution address and target symbol information in the sampling point information, the data center can accurately count the execution time of the function, and then calculate the proportion of the function relative to the overall execution time of the system. The data center matches the calculated time proportion information with the existing target symbol information to obtain the final target flame graph. In the target flame graph, different function call links are represented as rectangular bars of different colors and widths. The width of the rectangular bar corresponds to the execution time proportion of the corresponding function, and its vertical position reflects the hierarchy and order of the function call. This graphical display method can intuitively reflect the function call path with the most serious resource consumption in the system, providing a clear direction for performance optimization.

[0090] In order to improve data transmission efficiency, in the flame graph generation method provided in Example 2 of the present application, after receiving target symbol information corresponding to the sampling point information in multiple sampling point information sent by multiple nodes, the method also includes: composing target announcement information to be published based on the target symbol information; publishing the target announcement information to inform multiple nodes of the symbol information that has been received by the current data center end.

[0091] Optionally, after receiving the target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes, the data center will compose the target announcement information to be published based on the received target symbol information, and then publish the target announcement information to inform the multiple nodes of the symbol information that the current data center has received. Before the multiple nodes send the symbol information to the data center, the nodes will actively obtain the announcement information from the data center, and the nodes will perform secondary deduplication processing on the locally generated target symbol information based on the symbol information in the announcement information. Finally, the processed target symbol information is sent to the data center. The deduplication strategy based on historical data reduces the amount of data sent by the target node to the center, reduces network transmission delay, and improves the efficiency and performance of data transmission.

[0092] In an optional embodiment, the following may be used: Figure 4 The schematic diagram shown realizes the generation of flame graph, sampling is performed at the node end, and the sampled address information is directly pushed to the address library at the data center end. After deduplication processing of the symbol data corresponding to the address at the node end, it is pushed to the symbol library at the data center end. Finally, the center end synthesizes the sampled address information and symbol information to generate a flame graph.

[0093] By migrating address matching and flame graph calculation to the data center, the problems of high node-side symbol cache memory usage and high CPU usage of derived symbols are eliminated.

[0094] In the flame graph generation method provided in the second embodiment of the present application, multiple sampling point information sent by multiple nodes is received, wherein the multiple sampling point information is obtained by sampling the execution process of multiple threads, and the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes is received; the multiple sampling point information and the target symbol information are processed to obtain a target flame graph, which solves the technical problem of generating a flame graph through a single node, resulting in excessive resource occupation on the node side.

[0095] In this solution, the execution process of multiple threads is sampled and processed by multiple nodes to obtain the target address information corresponding to the multiple threads at the sampling time. The multiple nodes directly send the multiple sampling point information obtained by sampling to the data center end, and the multiple nodes also send the target symbol information corresponding to the sampling point information (that is, the function name corresponding to the address) to the data center end. After the data center end receives the sampling point information and target symbol information sent by each node, it generates a target flame graph according to the sampling point information and the target symbol information. By sending the multiple sampling point information and the target symbol information to the data center end, the resource-intensive tasks are migrated from the performance-sensitive node side to the data center end with higher computing power and storage capacity, avoiding the problem of excessive resource occupation caused by data processing on the node side. Since the processing of symbol information and sampling point data is carried out on the data center end, the powerful computing power of the data center end can be used to improve the efficiency and accuracy of data processing, thereby achieving the technical effect of optimizing the performance analysis process, reducing the resource occupation on the node side, and accelerating the location of problems.

[0096] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0097] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0098] Example 3

[0099] According to an embodiment of the present application, a flame graph generation device for implementing the flame graph generation method is also provided, such as Figure 5 As shown, the device includes: a first processing unit 501, a first sending unit 502 and a second sending unit 503.

[0100] The first processing unit 501 is used to perform sampling processing on the execution process of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time;

[0101] A first sending unit 502 is used to send information of multiple sampling points to a data center end;

[0102] The second sending unit 503 is used to send the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein the multiple sampling point information and the target symbol information are processed at the data center end to obtain a target flame graph.

[0103] In the flame graph generation device provided in the third embodiment of the present application, the first processing unit 501 performs sampling processing on the execution process of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; the first sending unit 502 sends the multiple sampling point information to the data center end; the second sending unit 503 sends the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein, at the data center end, the multiple sampling point information and the target symbol information are processed to obtain the target flame graph, which solves the technical problem of generating a flame graph through a single node, resulting in excessive resource occupation on the node side.

[0104] In this solution, the execution process of multiple threads is sampled and processed by multiple nodes to obtain the target address information corresponding to the multiple threads at the sampling time. The multiple nodes directly send the multiple sampling point information obtained by sampling to the data center end, and the multiple nodes also send the target symbol information corresponding to the sampling point information (that is, the function name corresponding to the address) to the data center end. After the data center end receives the sampling point information and target symbol information sent by each node, it generates a target flame graph according to the sampling point information and the target symbol information. By sending the multiple sampling point information and the target symbol information to the data center end, the resource-intensive tasks are migrated from the performance-sensitive node side to the data center end with higher computing power and storage capacity, avoiding the problem of excessive resource occupation caused by data processing on the node side. Since the processing of symbol information and sampling point data is carried out on the data center end, the powerful computing power of the data center end can be used to improve the efficiency and accuracy of data processing, thereby achieving the technical effect of optimizing the performance analysis process, reducing the resource occupation on the node side, and accelerating the location of problems.

[0105] Optionally, in the flame graph generation device provided in Example 3 of the present application, the first processing unit includes: a first sampling module, which is used to sample the time information of multiple threads when they are executed in the central processing unit if the flame graph to be generated is a flame graph of the first type, so as to obtain multiple sampling point information; and a second sampling module, which is used to sample the time information of multiple threads when they are called out of the central processing unit and called into the central processing unit if the flame graph to be generated is a flame graph of the second type, so as to obtain multiple sampling point information.

[0106] Optionally, in the flame graph generation device provided in Example 3 of the present application, the processing unit includes: a determination module, used to determine, for a target node among multiple nodes, a target thread among multiple threads running on the target node, wherein the target node is any one of the multiple nodes; and a processing module, used to sample and process the execution process of the target thread through the target node to obtain multiple sampling point information.

[0107] Optionally, in the flame graph generation device provided in Example 3 of the present application, the second sending unit includes: a matching module, which is used to match the target address information based on a preset symbol information table through the target node to obtain initial symbol information corresponding to the target address information; a processing module, which is used to deduplicate the initial symbol information through the target node to obtain target symbol information; and a sending module, which is used to send the target symbol information to the data center through the target node.

[0108] Optionally, in the flame graph generation device provided in Example 3 of the present application, the device also includes: a determination unit, which is used to determine, for a target node among multiple nodes, multiple functions involved in the target node before sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein the target node is any one of the multiple nodes; a transformation unit, which is used to perform hash transformation on the address information corresponding to the multiple functions to obtain symbol information corresponding to the functions among the multiple functions; and a first generation unit, which is used to form a symbol information table based on the symbol information corresponding to the functions among the multiple functions.

[0109] Optionally, in the flame graph generation device provided in Example 3 of the present application, the device also includes: an acquisition unit, which is used to deduplicate the initial symbol information through the target node to obtain the target symbol information, and then obtain the historical symbol information received by the data center through the target node based on the announcement information published by the data center; a second processing unit, which is used to deduplicate the target symbol information based on the historical symbol information through the target node to obtain the processed target symbol information; and a second sending unit, which is also used to send the processed target symbol information to the data center through the target node.

[0110] It should be noted that the first processing unit 501, the first sending unit 502 and the second sending unit 503 described above correspond to steps S201 to S203 in Embodiment 1, and the three units and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Embodiment 1.

[0111] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0112] Example 4

[0113] According to an embodiment of the present application, a flame graph generation device for implementing the flame graph generation method is also provided, such as Figure 6 As shown, the device includes: a first receiving unit 601, a second receiving unit 602 and a processing unit 603.

[0114] A first receiving unit 601 is configured to receive a plurality of sampling point information sent by a plurality of nodes, wherein the plurality of sampling point information is obtained by sampling the execution process of a plurality of threads by the plurality of nodes, and the sampling point information at least includes: target address information corresponding to the plurality of threads at sampling moments;

[0115] The second receiving unit 602 is configured to receive target symbol information corresponding to sampling point information in multiple sampling point information sent by multiple nodes;

[0116] The processing unit 603 is used to process the multiple sampling point information and the target symbol information to obtain a target flame graph.

[0117] In the flame graph generation device provided in the third embodiment of the present application, a first receiving unit 601 receives a plurality of sampling point information sent by a plurality of nodes, wherein the plurality of sampling point information is obtained by sampling the execution process of a plurality of threads, and the sampling point information at least includes: target address information corresponding to the plurality of threads at the sampling time; a second receiving unit 602 receives target symbol information corresponding to the sampling point information in the plurality of sampling point information sent by the plurality of nodes; and a processing unit 603 processes the plurality of sampling point information and the target symbol information to obtain a target flame graph, thereby solving the technical problem that a flame graph is generated by a single node, resulting in excessive resource occupation on the node side.

[0118] In this solution, the execution process of multiple threads is sampled and processed by multiple nodes to obtain the target address information corresponding to the multiple threads at the sampling time. The multiple nodes directly send the multiple sampling point information obtained by sampling to the data center end, and the multiple nodes also send the target symbol information corresponding to the sampling point information (that is, the function name corresponding to the address) to the data center end. After the data center end receives the sampling point information and target symbol information sent by each node, it generates a target flame graph according to the sampling point information and the target symbol information. By sending the multiple sampling point information and the target symbol information to the data center end, the resource-intensive tasks are migrated from the performance-sensitive node side to the data center end with higher computing power and storage capacity, avoiding the problem of excessive resource occupation caused by data processing on the node side. Since the processing of symbol information and sampling point data is carried out on the data center end, the powerful computing power of the data center end can be used to improve the efficiency and accuracy of data processing, thereby achieving the technical effect of optimizing the performance analysis process, reducing the resource occupation on the node side, and accelerating the location of problems.

[0119] Optionally, in the flame graph generation device provided in Example 4 of the present application, the processing unit includes: a determination module, used to determine the time proportion information of multiple functions in threads of multiple threads based on multiple sampling point information; and a matching module, used to match the time proportion information and target symbol information to obtain a target flame graph.

[0120] Optionally, in the flame graph generation device provided in Example 4 of the present application, the device also includes: a second generation unit, which is used to compose target announcement information to be published based on the target symbol information after receiving target symbol information corresponding to the sampling point information in multiple sampling point information sent by multiple nodes; and a publishing unit, which is used to publish the target announcement information to inform multiple nodes of the symbol information that has been received by the current data center end.

[0121] It should be noted that the first receiving unit 601, the second receiving unit 602 and the processing unit 603 described above correspond to steps S301 to S303 in the second embodiment, and the three units and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the second embodiment. It should be noted that the above modules as part of the device can be run in the computer terminal 10 provided in the first embodiment.

[0122] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 2 as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 2.

[0123] Example 5

[0124] The embodiment of the present application may provide an electronic device, which may be any electronic device in an electronic device terminal group. Optionally, in this embodiment, the electronic device may also be replaced by a terminal device such as a mobile terminal.

[0125] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0126] In this embodiment, the electronic device may execute the program code of the following steps in the method for generating a flame graph: performing sampling processing on the execution process of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; sending the multiple sampling point information to the data center end; sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein, at the data center end, the multiple sampling point information and the target symbol information are processed to obtain a target flame graph.

[0127] The electronic device can execute the program code of the following steps in the method for generating a flame graph: sampling the execution process of multiple threads to obtain multiple sampling point information includes: if the flame graph to be generated is a flame graph of the first type, sampling the time information when the multiple threads are executed in the central processing unit to obtain multiple sampling point information; if the flame graph to be generated is a flame graph of the second type, sampling the time information when the multiple threads are called out of the central processing unit and called into the central processing unit to obtain multiple sampling point information.

[0128] The electronic device can execute the following steps of the flame graph generation method: sampling the execution process of multiple threads to obtain multiple sampling point information, including: for a target node among multiple nodes, determining a target thread of multiple threads running on the target node, wherein the target node is any one of the multiple nodes; sampling the execution process of the target thread through the target node to obtain multiple sampling point information.

[0129] The electronic device can execute the program code of the following steps in the method for generating a flame graph: before sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center, the method also includes: for a target node in the multiple nodes, determining multiple functions involved in the target node, wherein the target node is any one of the multiple nodes; performing a hash transformation on the address information corresponding to the multiple functions to obtain the symbol information corresponding to the function in the multiple functions; and forming a symbol information table based on the symbol information corresponding to the function in the multiple functions.

[0130] The above-mentioned electronic device can execute the program code of the following steps in the method for generating a flame graph: sending the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end includes: matching the target address information based on a preset symbol information table through the target node to obtain the initial symbol information corresponding to the target address information; deduplicating the initial symbol information through the target node to obtain the target symbol information; and sending the target symbol information to the data center end through the target node.

[0131] The above-mentioned electronic device can execute the program code of the following steps in the method for generating a flame graph: after deduplicating the initial symbol information through the target node to obtain the target symbol information, the method also includes: obtaining the historical symbol information received by the data center end through the target node based on the announcement information released by the data center end; deduplicating the target symbol information based on the historical symbol information through the target node to obtain the processed target symbol information; sending the target symbol information to the data center end through the target node includes: sending the processed target symbol information to the data center end through the target node.

[0132] The electronic device can execute the program code of the following steps in the method for generating a flame graph: receiving multiple sampling point information sent by multiple nodes, wherein the multiple sampling point information is obtained by sampling the execution process of multiple threads by multiple nodes, and the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; receiving target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes; processing the multiple sampling point information and the target symbol information to obtain a target flame graph.

[0133] The above-mentioned electronic device can execute the program code of the following steps in the method for generating a flame graph: processing multiple sampling point information and target symbol information to obtain a target flame graph includes: determining the time proportion information of multiple functions in threads of multiple threads based on multiple sampling point information; matching the time proportion information and the target symbol information to obtain a target flame graph.

[0134] The above-mentioned electronic device can execute the program code of the following steps in the method for generating a flame graph: after receiving the target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes, the method also includes: forming the target announcement information to be published based on the target symbol information; publishing the target announcement information to inform the multiple nodes of the symbol information that has been received by the current data center end.

[0135] Optionally, Figure 7 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 7 As shown, the electronic device 70 may include: one or more ( Figure 7Only one is shown in the figure) processor 702, memory 704. The electronic device 70 may also include a storage controller, through which the memory 704 is controlled and managed; the electronic device 70 may also include a peripheral interface, through which the radio frequency module, audio module and display screen are connected.

[0136] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for generating the flame graph in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the method for generating the flame graph described above is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the electronic device 70 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0137] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: perform sampling processing on the execution process of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; send the multiple sampling point information to the data center end; send the target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein, at the data center end, the multiple sampling point information and the target symbol information are processed to obtain a target flame graph.

[0138] Optionally, the processor may also execute the following program code: sampling the execution process of multiple threads to obtain multiple sampling point information, including: if the flame graph to be generated is a flame graph of the first type, sampling the time information when the multiple threads are executed in the central processing unit to obtain multiple sampling point information; if the flame graph to be generated is a flame graph of the second type, sampling the time information when the multiple threads are called out of the central processing unit and called into the central processing unit to obtain multiple sampling point information.

[0139] Optionally, the processor may also execute program code of the following steps: sampling the execution process of multiple threads to obtain multiple sampling point information, including: for a target node among multiple nodes, determining a target thread on which multiple threads run on the target node, wherein the target node is any one of the multiple nodes; sampling the execution process of the target thread through the target node to obtain multiple sampling point information.

[0140] Optionally, the processor may also execute program code of the following steps: before sending target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center, the method further includes: for a target node in the multiple nodes, determining multiple functions involved in the target node, wherein the target node is any one of the multiple nodes; performing hash transformation on address information corresponding to the multiple functions to obtain symbol information corresponding to functions in the multiple functions; and forming a symbol information table based on the symbol information corresponding to the functions in the multiple functions.

[0141] Optionally, the processor may also execute program code of the following steps: sending target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end includes: matching the target address information based on a preset symbol information table through the target node to obtain initial symbol information corresponding to the target address information; deduplicating the initial symbol information through the target node to obtain target symbol information; and sending the target symbol information to the data center end through the target node.

[0142] Optionally, the processor may also execute the program code of the following steps: after deduplicating the initial symbol information through the target node to obtain the target symbol information, the method further includes: obtaining the historical symbol information received by the data center through the target node based on the announcement information published by the data center; deduplicating the target symbol information based on the historical symbol information through the target node to obtain the processed target symbol information; sending the target symbol information to the data center through the target node includes: sending the processed target symbol information to the data center through the target node.

[0143] Optionally, the processor may further execute program code of the following steps: receiving multiple sampling point information sent by multiple nodes, wherein the multiple sampling point information is obtained by sampling the execution process of multiple threads by multiple nodes, and the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; receiving target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes; and processing the multiple sampling point information and the target symbol information to obtain a target flame graph.

[0144] Optionally, the processor may also execute the program code of the following steps: processing multiple sampling point information and target symbol information to obtain a target flame graph, including: determining time proportion information of multiple functions in multiple threads based on multiple sampling point information; matching the time proportion information and the target symbol information to obtain a target flame graph.

[0145] Optionally, the processor may also execute the program code of the following steps: after receiving the target symbol information corresponding to the sampling point information in the multiple sampling point information sent by the multiple nodes, the method further includes: composing the target announcement information to be published based on the target symbol information; publishing the target announcement information to inform the multiple nodes of the symbol information that has been received by the current data center end.

[0146] It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only, and the electronic device 70 may also be a terminal device such as a smart phone, a tablet computer, a PDA, a mobile Internet device (MID), a PAD, etc. Figure 7 The structure of the electronic device is not limited. Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 7 Different configurations shown.

[0147] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0148] Example 6

[0149] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product can be used to store the program code executed by the method for generating a flame graph provided in the first embodiment.

[0150] Optionally, in this embodiment, the computer program product may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0151] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0152] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0153] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0154] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0155] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0156] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.

[0157] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for generating a flame graph, characterized in that: The generation method is applied to multiple nodes, including: Sampling the execution processes of the multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; Sending the plurality of sampling point information to a data center end; The target symbol information corresponding to the sampling point information in the plurality of sampling point information is sent to the data center end, wherein, at the data center end, the plurality of sampling point information and the target symbol information are processed to obtain a target flame graph.

2. The method according to claim 1, characterized in that The execution process of multiple threads is sampled and processed to obtain multiple sampling point information including: If the flame graph to be generated is a flame graph of the first type, sampling time information of the multiple threads when they are executed in the central processing unit to obtain the multiple sampling point information; If the flame graph to be generated is a flame graph of the second type, time information when the multiple threads are called out of the central processing unit and called into the central processing unit is sampled to obtain the multiple sampling point information.

3. The method according to claim 1, characterized in that The execution process of multiple threads is sampled and processed to obtain multiple sampling point information including: For a target node among the multiple nodes, determining a target thread of the multiple threads running on the target node, wherein the target node is any one of the multiple nodes; The execution process of the target thread is sampled to obtain the plurality of sampling point information.

4. The method according to claim 1, characterized in that: Sending target symbol information corresponding to the sampling point information in the plurality of sampling point information to the data center end includes: Matching the target address information based on a preset symbol information table to obtain initial symbol information corresponding to the target address information; Performing deduplication processing on the initial symbol information to obtain the target symbol information; The target symbol information is sent to the data center end.

5. The method according to claim 4, characterized in that Before sending the target symbol information corresponding to the sampling point information in the plurality of sampling point information to the data center end, the method further includes: For a target node among the multiple nodes, determining multiple functions involved in the target node, wherein the target node is any one of the multiple nodes; Performing hash transformation on address information corresponding to the multiple functions to obtain symbol information corresponding to a function in the multiple functions; A symbol information table is formed according to the symbol information corresponding to the functions in the plurality of functions.

6. The method according to claim 5, characterized in that After performing deduplication processing on the initial symbol information to obtain the target symbol information, the method further includes: Based on the announcement information published by the data center, acquiring the historical symbol information received by the data center; Performing deduplication processing on the target symbol information based on the historical symbol information to obtain processed target symbol information; Sending the target symbol information to the data center end includes: The processed target symbol information is sent to the data center end.

7. A method for generating a flame graph, characterized in that: The generation method is applied to a data center end, and includes: receiving a plurality of sampling point information sent by a plurality of nodes, wherein the plurality of sampling point information is obtained by sampling the execution process of a plurality of threads by the plurality of nodes, and the sampling point information at least includes: target address information corresponding to the plurality of threads at sampling moments; Receiving target symbol information corresponding to the sampling point information in the plurality of sampling point information sent by the plurality of nodes; The plurality of sampling point information and the target symbol information are processed to obtain a target flame graph.

8. The method according to claim 7, characterized in that Processing the plurality of sampling point information and the target symbol information to obtain a target flame graph includes: Determine time proportion information of multiple functions in threads of the multiple threads based on the multiple sampling point information; The time proportion information and the target symbol information are matched to obtain the target flame graph.

9. The method according to claim 7, characterized in that: After receiving target symbol information corresponding to the sampling point information in the plurality of sampling point information sent by the plurality of nodes, the method further includes: composing target announcement information to be released based on the target symbol information; The target announcement information is published to inform the multiple nodes of the symbol information currently received by the data center.

10. A flame graph generation device, characterized in that: include: A first processing unit is used to perform sampling processing on the execution process of multiple threads to obtain multiple sampling point information, wherein the sampling point information at least includes: target address information corresponding to the multiple threads at the sampling time; A first sending unit, configured to send the plurality of sampling point information to a data center end; The second sending unit is used to send target symbol information corresponding to the sampling point information in the multiple sampling point information to the data center end, wherein, at the data center end, the multiple sampling point information and the target symbol information are processed to obtain a target flame graph.

11. A flame graph generation device, characterized in that: include: A first receiving unit is configured to receive a plurality of sampling point information sent by a plurality of nodes, wherein the plurality of sampling point information is obtained by sampling the execution process of a plurality of threads by the plurality of nodes, and the sampling point information at least includes: target address information corresponding to the plurality of threads at sampling moments; A second receiving unit, configured to receive target symbol information corresponding to the sampling point information in the plurality of sampling point information sent by the plurality of nodes; A processing unit is used to process the multiple sampling point information and the target symbol information to obtain a target flame graph.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the flame graph generation method according to any one of claims 1 to 9.

13. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program, when running, executes the method for generating a flame graph according to any one of claims 1 to 9.

14. A computer program product, characterized in that The method comprises a computer program or an instruction, which, when executed by a processor, implements the method for generating a flame graph according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Data processing method, device and equipment

    CN110928750A

  • Jamming log information collection method and device, equipment and storage medium

    CN112860469A

  • File analysis and display method and device and electronic equipment

    CN116541356A

  • Data transmission method and device, equipment and storage medium

    CN116546105A

  • Data request processing method and device, equipment and storage medium

    CN119397166A