Performance report generation method and device, electronic equipment and storage medium
By sorting and summarizing the instruction analysis reports of multiple channels at the moment they are pushed into the stack, a performance report display page is generated, which solves the problem of developers having difficulty analyzing the parallel performance of multiple channels and enables intuitive analysis of parallel performance.
Patent Information
- Application Number
- CN202310264892.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2024-09-20
AI Technical Summary
During the program development process, it is difficult for developers to determine the parallel running performance of multiple program channels through separate analysis reports, because the existing technology usually separates the instruction execution of different channels into independent analysis reports.
By obtaining multiple instruction analysis reports for different channels, they are sorted according to the stacking time of the instruction information, summarized into a target summary report, and a performance report display page is generated to display the channel type and stacking time corresponding to each instruction information. Dimensional information.
Users can intuitively determine which channels' instructions are pushed into the stack in parallel through the performance report display page, thus facilitating subsequent analysis of the parallel performance of multiple channels.
Smart Images

Figure CN118672882A
Abstract
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 performance report, an electronic device, and a storage medium. Background Art
[0002] During the process of program development, it is usually necessary to summarize the execution status of program instructions and form a report, so that subsequent developers can analyze the performance of the program based on the formed report.
[0003] In the related art, independent analysis reports are usually generated for the instruction execution status of different channels, which makes it difficult for developers to determine the parallel operation performance of multiple program channels based on the independent analysis reports. Summary of the invention
[0004] The embodiments of the present application disclose a method and device for generating a performance report, an electronic device, and a storage medium, which can aggregate the instruction information of multiple channels into the same report, thereby facilitating subsequent analysis of the parallel performance of multiple channels.
[0005] A first aspect of an embodiment of the present application discloses a method for generating a performance report, the method comprising:
[0006] Acquire multiple instruction analysis reports, each instruction analysis report corresponds to a channel, each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information includes at least the time when the program instruction is pushed into the stack;
[0007] Sorting the instruction information included in the plurality of instruction analysis reports according to the time of being pushed into the stack to obtain a target summary report;
[0008] A performance report display page is generated according to the target summary report, and the performance report display page includes at least two dimensions of information, namely, the channel type corresponding to each piece of instruction information and the corresponding stacking time.
[0009] A second aspect of an embodiment of the present application discloses a device for generating a performance report, the method comprising:
[0010] An acquisition unit, used to acquire multiple instruction analysis reports, each instruction analysis report corresponds to a channel, each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information includes at least the time when the program instruction is pushed into the stack;
[0011] A summary unit, used to sort the instruction information included in the plurality of instruction analysis reports according to the time of stacking, to obtain a target summary report;
[0012] A generating unit is used to generate a performance report display page according to the target summary report, wherein the performance report display page includes at least two dimensions of information, namely, a channel corresponding to each piece of instruction information and a corresponding stacking time.
[0013] A third aspect of the present application discloses an electronic device, including:
[0014] A memory storing executable program code;
[0015] a processor coupled to the memory;
[0016] The processor calls the executable program code stored in the memory to execute the method for generating a performance report disclosed in the first aspect of the embodiment of the present application.
[0017] A fourth aspect of an embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for generating a performance report disclosed in the first aspect of an embodiment of the present application.
[0018] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0019] In an embodiment of the present application, multiple instruction analysis reports for different channels can be obtained, wherein each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information includes at least the push time of the program instruction; the instruction information included in the multiple instruction analyses can then be sorted according to the push time to obtain a target summary report; further, a performance report display page can be generated based on the target summary report, wherein the performance report display page includes at least two dimensions of information, namely, the channel type corresponding to each instruction, and the corresponding push time. Since the target summary report brings together the instruction analysis reports corresponding to multiple channels, and the target summary report has been sorted according to the push time of each instruction information, the user can intuitively determine through the performance report display page which channels' instructions are pushed in parallel, thereby facilitating the subsequent analysis of the parallel performance of multiple channels. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a flowchart of a method for generating a performance report disclosed in an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of an instruction analysis report disclosed in an embodiment of the present application;
[0023] Figure 3 It is a flowchart of another method for generating a performance report disclosed in an embodiment of the present application;
[0024] Figure 4 It is a flowchart of another method for generating a performance report disclosed in an embodiment of the present application;
[0025] Figure 5 It is a schematic diagram of a display page of a performance report disclosed in an embodiment of the present application;
[0026] Figure 6 It is a structural schematic diagram of a performance report generation device disclosed in an embodiment of the present application;
[0027] Figure 7 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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 are within the scope of protection of this application.
[0029] It should be noted that the terms "first", "second", "third" and "fourth" in the specification and claims of the present application are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present application and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device including 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.
[0030] The embodiments of the present application disclose a method and device for generating a performance report, an electronic device, and a storage medium, which can aggregate the instruction information of multiple channels into the same report, thereby facilitating subsequent analysis of the parallel performance of multiple channels.
[0031] The technical solution of the present application will be described in detail below in conjunction with specific embodiments.
[0032] In order to more clearly explain a method for generating a performance report disclosed in an embodiment of the present application, the instruction analysis report in the related art is first introduced. As mentioned above, during the development of an application, it is usually necessary to summarize the execution status of the program instructions of the application to form a report, so as to facilitate subsequent developers to analyze the performance of the application according to the formed report.
[0033] A computer is usually provided with multiple "channels". A channel is one of the operation control components of the computer, which stores the currently executed program instructions. Each channel can independently execute the program instructions stored inside it. Based on this structural feature, in the related technology, independent analysis reports are usually formed for the execution of instructions in different channels. However, the independent report of a single channel is not conducive to comprehensive consideration of the parallelism and timely requirements of multiple channels, which makes it difficult for developers to determine the parallel operation performance of multiple program channels.
[0034] In this regard, an embodiment of the present application discloses a method for generating a performance report, which can obtain multiple instruction analysis reports for different channels, wherein each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information at least includes the push time of the program instruction; then, the instruction information included in the multiple instruction analyses can be sorted and summarized according to the push time to obtain a target summary report; further, a performance report display page can be generated according to the target summary report; wherein the performance report display page includes at least two dimensions of information, namely, the channel type corresponding to each instruction, and the corresponding push time, and since the target summary report brings together the instruction analysis reports corresponding to multiple channels, and the target summary report has been sorted according to the push time of each instruction information, the user can intuitively determine through the performance report display page which channels' instructions are pushed in parallel, thereby facilitating the subsequent analysis of the parallel performance of multiple channels.
[0035] Based on this, the method and device for generating a performance report, the electronic device, and the storage medium disclosed in the embodiments of the present application are introduced below.
[0036] See also Figure 1 , Figure 1 1 is a flow chart of a method for generating a performance report disclosed in an embodiment of the present application. Optionally, the method can be applied to electronic devices, including but not limited to: computers, servers, etc., which are not limited here. Optionally, the method can include the following steps:
[0037] 102. Obtain multiple instruction analysis reports.
[0038] In an embodiment of the present application, each instruction analysis report may correspond to a channel, and each instruction analysis includes instruction information of each program instruction executed by the corresponding channel. Optionally, the instruction information includes at least the time when the program instruction is pushed into the stack. In other optional embodiments, the instruction information may also include one or more of the end time of the program instruction, the delay duration, the length information of the operation register, and the assembly code.
[0039] Among them, the program instructions need to be stored in the stack from the external memory first, and then executed in the order in which the program instructions are arranged in the stack. The push time refers to the time when the program instruction enters the stack. The end time refers to the time when the program instruction is executed.
[0040] It should be noted that the program instruction may not be executed immediately after entering the stack, so the time of stacking is not equal to the execution time, and the execution time may be later than the time of stacking. The above delay time is the difference between the time when the program instruction is stacked and the time when it is executed.
[0041] It is understandable that data calculations are inevitably required during the execution of program instructions. Electronic devices are provided with calculation registers for storing operands and calculation results to be calculated. The length information of the above-mentioned calculation registers indicates the amount of data of the operands that need to be calculated in the corresponding program instructions.
[0042] Assembly code is assembly instructions, which are some operators and mnemonics used in assembly language. The assembly code corresponding to the program instruction represents the assembly instructions required to implement the program instruction.
[0043] See also Figure 2 , Figure 2 2 is a schematic diagram of an instruction analysis report disclosed in an embodiment of the present application. The stack push time is 210, the end time is 220, the delay time is 230, the length information of the operation register is 240, and the assembly code is 250. It should be further explained that: Figure 2 This is just an example for convenience of explanation. In other optional embodiments, the instruction analysis report may only include the stack push time, end time, delay time, length information of the operation register and part of the assembly code; in some other optional embodiments, the instruction analysis report may include other parameters in addition to the stack push time, end time, delay time, length information of the operation register and the assembly code, such as: the execution time of the program instruction, the storage address of the program instruction, etc. Figure 2 This should not be construed as limiting the embodiments of the present application.
[0044] As an optional implementation, the developer can set up data collection scripts in advance in the multiple channels corresponding to the application, and then the electronic device can collect the instruction information of the program instructions executed by the channel through the data collection scripts set in each channel, and generate an instruction analysis report for the corresponding channel. In another optional implementation, the electronic device can also query the operation log of each channel, and extract the instruction information of the program instructions executed by the corresponding channel from the operation log, and then generate an instruction analysis report for the corresponding channel.
[0045] 104. Sort the instruction information included in the multiple instruction analysis reports according to the time of being pushed into the stack to obtain a target summary report.
[0046] In an embodiment of the present application, the electronic device can scan each instruction analysis report through a batch scanning statement (e.g., argadd statement) based on a text editor to add the instruction information in each instruction analysis report to an operation list. Optionally, the text editor can include but is not limited to VIM (Vi IMproved, text editor). VIM is a powerful text editor that is simple and easy to use, does not require script support such as Python, and is written in native Vim scripts to achieve mature instruction aggregation, screening, and sorting operations, thereby improving the efficiency of summarizing multiple instruction analysis reports.
[0047] Furthermore, the electronic device can summarize the instruction information of multiple instruction analysis reports in the operation list, and sort the summarized instruction information according to the stacking time to generate a target summary report. Optionally, the electronic device can sort the summarized instruction information in the order of stacking time from early to late, or can also sort the summarized instruction information in the order of stacking time from late to early, which is not limited here.
[0048] 106. Generate a performance report display page based on the target summary report.
[0049] In the embodiment of the present application, the performance report display page includes at least two dimensions of information: the channel type corresponding to each instruction information and the corresponding stacking time. Then, the user can intuitively determine which channel instructions are stacked in parallel through the performance report display page, so as to facilitate the subsequent analysis of the parallel performance of multiple channels.
[0050] As an optional implementation, the electronic device may generate a corresponding front-end statement according to the target summary report, and then the electronic device may render a performance report display page on the front end of the electronic device according to the generated front-end statement through a front-end rendering program. Optionally, the front-end rendering program may include but is not limited to Javascript, which is a front-end development language for web pages.
[0051] As another optional implementation, the electronic device can generate front-end statements corresponding to the target summary report at one time through front-end statement generation instructions (eg, source instructions), thereby eliminating the need for cumbersome command line operations and improving the efficiency of front-end statement generation.
[0052] By implementing the methods disclosed in the above embodiments, multiple instruction analysis reports for different channels can be obtained, wherein each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information includes at least the push time of the program instruction; the instruction information included in the multiple instruction analyses can then be sorted according to the push time to obtain a target summary report; further, a performance report display page can be generated according to the target summary report, wherein the performance report display page includes at least two dimensions of information: the channel type corresponding to each instruction, and the corresponding push time. Since the target summary report brings together the instruction analysis reports corresponding to multiple channels, and the target summary report has been sorted according to the push time of each instruction information, the user can intuitively determine through the performance report display page which channels' instructions are pushed in parallel, thereby facilitating the subsequent analysis of the parallel performance of multiple channels.
[0053] See also Figure 3 , Figure 3 1 is a flow chart of another method for generating a performance report disclosed in an embodiment of the present application. Optionally, the method can be applied to electronic devices, including but not limited to: computers, servers, etc., which are not limited here. Optionally, the method can include the following steps:
[0054] 302. Obtain multiple instruction analysis reports.
[0055] Each instruction analysis report corresponds to a channel, and each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information at least includes the time when the program instruction is pushed into the stack.
[0056] 304. Traverse each row of data in a first instruction analysis report, and extract target row of data including instruction information, where the first instruction analysis report is any one of multiple instruction analysis reports.
[0057] In the embodiment of the present application, in addition to the row data including the instruction information, the instruction analysis report may also include other row data such as the title row data and the explanation row data, and the other row data is not helpful for the analysis of the instruction execution status. In order to reduce the amount of data of the first summary report to be subsequently summarized and reduce the amount of calculation for the subsequent analysis of the first summary report, the electronic device can optionally extract the target row data including the instruction information in each instruction analysis report and summarize them into the first summary report.
[0058] By implementing the above method, the electronic device can eliminate the header row data, explanation row data and other row data in the instruction analysis report that are not helpful for the subsequent instruction execution analysis process, and only summarize the target row data including the instruction information into a first summary report, thereby reducing the amount of data in the first summary report obtained by summarizing, and reducing the amount of calculation for subsequent analysis of the first summary report.
[0059] Optionally, the electronic device may traverse each row of data in the first instruction analysis report through a traversal statement (e.g., a global statement), and extract the row of data that satisfies the first condition as the target row of data. Optionally, the first condition includes that the row of data satisfies a first regular expression, and the first regular expression is used to determine whether the row of data includes a stacking time.
[0060] Optionally, the first regular expression may be “start_cc\s*=\s*\d\+”, wherein “start_cc” indicates the time when the program instruction is pushed into the stack, and “\s*=\s*\d\+” is a regular expression character.
[0061] By implementing the above method, the electronic device can quickly traverse each line of data in the instruction analysis report through the traversal statement, and determine the target line of data including the instruction information through the first regular expression. The entire process can be completed automatically and quickly by the back end of the electronic device, thereby improving the efficiency of generating the first summary report.
[0062] 306. Generate a first summary report based on the multiple target row data extracted from each instruction analysis report.
[0063] In an embodiment of the present application, the electronic device can write multiple target line data extracted from each instruction analysis report directly into the first summary report to obtain the first summary report. Optionally, the format of the first summary report may include a first format, and the first format includes IlluReport.csv. Among them, the first summary report adopts the first format, which can be reused with more analysis plug-ins to ensure its scalability and compatibility. Optionally, statistics on variable access can be added to the first summary report to avoid misuse across modules.
[0064] As an optional implementation, the electronic device can summarize multiple target row data extracted from each instruction analysis report, and add corresponding target parameters to the end of each target row data to obtain a first summary report, wherein the target parameters match the instruction information included in the corresponding target row data.
[0065] Optionally, the target parameters may include one or more of the time when the program instruction is pushed into the stack, the end time, the delay time, the length information of the operation register and the assembly code, and the delay time is the difference between the time when the program instruction is pushed into the stack and the time when it is executed.
[0066] Optionally, the electronic device may add a special separator between the target parameter and the target row data to separate the target parameter from the instruction information in the target row data, thereby facilitating subsequent identification of the target parameter or the instruction information separately.
[0067] By implementing the above method, the electronic device can add one or more of the program instruction's stack push time, end time, delay duration, calculation register length information and assembly code to the end of the target row data in a certain order. If the parameters of the instruction program need to be modified later, the target parameters at the end can be modified directly, which is also convenient for the subsequent direct assignment of the generated performance report display page according to the target parameters.
[0068] 308. Sort the instruction information in the first summary report according to the time of being pushed into the stack to obtain a target summary report.
[0069] In an optional embodiment, the electronic device can store multiple target line data extracted from each instruction analysis report in the memory variable of the electronic device's text editor, and then sort the instruction information in the memory variable of the text editor according to the time of stacking, and generate a target summary report based on the sorted instruction information in the memory variable.
[0070] Among them, multiple target line data extracted from each instruction analysis report are stored in the memory variable of the text editor of the electronic device, and then the sorting operation is performed. This is so that if other operations other than the sorting operation need to be performed on the instruction information in the future, the instruction information stored in the memory variable can be directly operated, and there is no need to extract the instruction information from multiple instruction analysis reports in turn, thereby reducing the calculation amount of the electronic device and improving the scalability of the method.
[0071] Optionally, the electronic device may sort the instruction information in the first summary report according to the stacking time through a sorting statement to obtain a target summary report. Optionally, the sorting statement may include a sort statement. Optionally, the electronic device may sort the instruction information in the first summary report according to the stacking time from early to late through a sorting statement according to a second regular expression to obtain a target summary report.
[0072] As an optional implementation, the second regular expression is used to sort the instruction information according to the stacking time from early to late. Optionally, the second regular expression can be "start_cc\s*=\s*\zs\d\+\ze", where "start_cc" represents the stacking time of the program instruction, and "\s*=\s*\zs\d\+\ze" is a regular expression character.
[0073] Optionally, the electronic device may perform additional calculations on the corresponding instruction information according to the target parameters at the end of each instruction information to obtain a calculation result, which is used to indicate the performance of the hardware executing the instruction information. Optionally, the additional calculation may include calculating whether there is a delay in the execution of the instruction information.
[0074] As an optional implementation, the instruction information may include the length information of the operation register corresponding to the program instruction, and the end time corresponding to the program instruction (the end time refers to the time when the program instruction actually ends). The electronic device may determine the predicted end time corresponding to the first instruction information according to the stacking time and the length information of the operation register included in the first instruction information, and the first instruction information is any one of the multiple instruction information included in the target summary report.
[0075] Furthermore, if the end time included in the first instruction information does not match the predicted end time, it means that there is a delay in the execution of the program instruction corresponding to the first instruction information. In this regard, the electronic device can add a target mark to the first instruction information in the target summary report, so as to facilitate the subsequent positioning of the program instruction with delayed execution according to the target mark.
[0076] Optionally, the electronic device may calculate the length of the operation register included in the first instruction information and the first product of the target duration, and add the stacking time to the first product to obtain the predicted end time corresponding to the first instruction information, wherein the target duration is the duration required for each operand operation.
[0077] By implementing the above method, the time required for the electronic device to complete the operation of the first instruction information can be determined by calculating the length of the operation register and the first product of the target time length, and then the time required for the electronic device to complete the operation of the first instruction information is added to the time of pushing the stack to obtain the predicted end time of the electronic device completing the first instruction information.
[0078] It is understandable that when the electronic device actually executes the program instructions corresponding to the first instruction information, due to the influence of hardware performance, the time it takes for the electronic device to execute the program instructions may increase compared to the predicted execution time, resulting in the actual end time of the program instructions being later than the predicted end time. In this regard, the electronic device can mark the first instruction information corresponding to these delayed program instructions in the target summary report, so as to facilitate subsequent users to locate the delayed program instructions and adjust the hardware performance.
[0079] 310. Generate a performance report display page based on the target summary report.
[0080] By implementing the methods disclosed in the above embodiments, other row data such as title row data and explanation row data that are not helpful for the subsequent instruction execution analysis process can be eliminated from the instruction analysis report, and only the target row data including the instruction information can be summarized into a first summary report, thereby reducing the amount of data in the first summary report obtained by summarization, and reducing the amount of calculation for the subsequent analysis of the first summary report; and, each row of data in the instruction analysis report can be quickly traversed through a traversal statement, and the target row data including the instruction information can be determined through a first regular expression. The entire process can be automatically and quickly completed by the back end of the electronic device, thereby improving the efficiency of generating the first summary report; and, the program instruction can be The stacking time, end time, delay time, length information of the operation register and one or more of the assembly code of the command are added to the end of the target row data in a certain order. If the parameters of the instruction program need to be modified later, the target parameters at the end can be directly modified, which is also convenient for assigning values to the generated performance report display page directly according to the target parameters. In addition, the time required for the electronic device to complete the operation of the first instruction information can be determined by calculating the length of the operation register and multiplying it by the first product of the target time, and then the time required for the electronic device to complete the operation of the first instruction information is added to the stacking time to obtain the predicted end time when the electronic device completes the first instruction information.
[0081] See also Figure 4 , Figure 4 This is a flow chart of another method for generating a performance report disclosed in an embodiment of the present application. Optionally, the method can be applied to electronic devices, including but not limited to: computers, servers, etc., which are not limited here. Optionally, the method can include the following steps:
[0082] 402. Obtain multiple instruction analysis reports.
[0083] 404. Sort the instruction information included in the multiple instruction analysis reports according to the time of being pushed into the stack to obtain a target summary report.
[0084] 406 . Generate an initial page, and generate image blocks corresponding to each piece of instruction information in the initial page according to each piece of instruction information included in the target summary report, so as to obtain a performance report display page.
[0085] In the embodiment of the present application, the electronic device can generate an initial page according to the channel type, the earliest stacking time and the latest end time included in the target summary report. The channel type included in the target summary report is the channel type corresponding to the multiple instruction analysis reports summarized in the target summary report; the earliest stacking time is the earliest stacking time among the stacking times corresponding to the multiple instruction information included in the target summary report; and the latest end time is the latest end time among the end times corresponding to the multiple instruction information included in the target summary report.
[0086] Optionally, the coordinate attribute corresponding to the first axis of the initial page can be the channel type, and the coordinate attribute corresponding to the second axis can be the time. Figure 5 , Figure 5 is a schematic diagram of a display page of a performance report disclosed in an embodiment of the present application. In the initial page, the horizontal axis is the first axis 510 and the vertical axis is the second axis 520. In other optional embodiments, the vertical axis may be the first axis and the horizontal axis may be the second axis. Figure 5 This should not be construed as limiting the embodiments of the present application.
[0087] Optionally, the lower limit value of the time range corresponding to the second axis can be less than the earliest stacking time, and the upper limit value can be greater than the latest ending time, so as to avoid the situation where the stacking time or ending time corresponding to the instruction information exceeds the time range corresponding to the second axis when new instruction information needs to be added to the performance report display page later, thereby improving the compatibility of the method.
[0088] Then, the electronic device can generate an image block corresponding to the first instruction information in the initial page, wherein the first instruction information is any one of the multiple instruction information included in the target summary report, the first axis coordinate of the display coordinate corresponding to the image block corresponding to the first instruction information matches the channel type corresponding to the first instruction information, and the second axis coordinate corresponding to the image block matches the stacking time corresponding to the first instruction information.
[0089] Combination Figure 5 For example, the third channel corresponding to the first instruction information is pushed into the stack at "16432", then the first-axis coordinate of the display coordinate corresponding to the image block 530 corresponding to the first instruction information can be "channel 3", and the second-axis coordinate of the corresponding display coordinate can be "16432".
[0090] By implementing the above method, the electronic device can generate image blocks corresponding to each instruction information on the performance report display page, wherein the first-axis coordinates of the display coordinates corresponding to the image block match the channel type corresponding to the first instruction information, and the second-axis coordinates corresponding to the image block match the stacking time corresponding to the first instruction information, so that the user can quickly and conveniently determine which channels' instructions are stacked in parallel through the positional relationship between the image blocks, thereby facilitating the subsequent analysis of the parallel performance of multiple channels.
[0091] As an optional implementation manner, the electronic device may determine a target height and a target width of the image block corresponding to the first instruction information, wherein the target height is positively correlated with the first difference, the first difference is the difference between the end time and the stacking time corresponding to the first instruction information, and the target width is positively correlated with the delay time included in the first instruction information;
[0092] An image block corresponding to the first instruction information is generated in the initial page according to the channel type, stacking time, target height and target width corresponding to the first instruction information.
[0093] Among them, the height of the image block corresponding to the first instruction information is determined according to the difference between the end time and the stacking time corresponding to the first instruction information, so that subsequent users can determine the approximate execution time of the first instruction information through the height of the image block; the width of the image block corresponding to the first instruction information is determined according to the delay time corresponding to the first instruction information, so that subsequent users can determine which instruction information has more serious delays through the width differences between each image block.
[0094] In some other optional embodiments, the target width may also be negatively correlated with the delay duration included in the first instruction information, which is not limited here.
[0095] As an optional implementation, the electronic device may set a zoom component for the performance report display page, wherein the zoom component is used to perform a zoom operation on the performance report display page.
[0096] In another optional embodiment, the electronic device may set a mouse response event for an image block in the performance report display page, and the mouse response event includes outputting instruction information corresponding to the target image block when a mouse input event is detected to trigger the target image block.
[0097] The mouse input event may include, but is not limited to: clicking on the target image block, selecting the target image block, hovering the mouse pointer over the target image block, etc.
[0098] Optionally, the electronic device may also generate corresponding legend items according to the assembly instructions corresponding to each instruction information, and the legend items are matched with the image blocks corresponding to the instruction information, so that the user can quickly determine the image blocks corresponding to the assembly instructions to be queried through the legend items.
[0099] By implementing the above method, it is possible to set a zoom component and / or a mouse response event, so that the user can conveniently browse the performance report display page, thereby improving the user experience.
[0100] By implementing the methods disclosed in the above embodiments, an image block corresponding to each instruction information can be generated on the performance report display page, wherein the first-axis coordinate of the display coordinate corresponding to the image block matches the channel type corresponding to the first instruction information, and the second-axis coordinate corresponding to the image block matches the stacking time corresponding to the first instruction information, so that the user can quickly and conveniently determine which channels' instructions are stacked in parallel through the positional relationship between the image blocks, thereby facilitating the subsequent analysis of the parallel performance of multiple channels; and by setting a zoom component and / or a mouse response event, the user can conveniently consult the performance report display page, thereby improving the user experience.
[0101] See also Figure 6 , Figure 6 6 is a schematic diagram of a performance report generation device disclosed in an embodiment of the present application. Optionally, the device can be applied to electronic devices, including but not limited to: computers, servers, etc., which are not limited here. Optionally, the device may include an acquisition unit 602, a summary unit 604 and a generation unit 606, wherein:
[0102] An acquisition unit 602 is used to acquire multiple instruction analysis reports, each instruction analysis report corresponds to a channel, each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information at least includes the time when the program instruction is pushed into the stack;
[0103] A summary unit 604, used to sort the instruction information included in the multiple instruction analysis reports according to the stacking time to obtain a target summary report;
[0104] The generating unit 606 is used to generate a performance report display page according to the target summary report, and the performance report display page includes at least two dimensions of information: the channel corresponding to each instruction information and the corresponding stacking time.
[0105] By implementing the above-mentioned device, multiple instruction analysis reports for different channels can be obtained, wherein each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information at least includes the push time of the program instruction; then, the instruction information included in the multiple instruction analyses can be sorted according to the push time to obtain a target summary report; further, a performance report display page can be generated according to the target summary report, wherein the performance report display page includes at least two dimensions of information: the channel type corresponding to each instruction, and the corresponding push time. Since the target summary report brings together the instruction analysis reports corresponding to multiple channels, and the target summary report has been sorted according to the push time of each instruction information, the user can intuitively determine which channels' instructions are pushed in parallel through the performance report display page, thereby facilitating the subsequent analysis of the parallel performance of multiple channels.
[0106] As an optional implementation, the summary unit 604 is also used to traverse each line of data in the first instruction analysis report and extract the target line data including instruction information, the first instruction analysis report is any one of multiple instruction analysis reports; and, based on the multiple target line data extracted from each instruction analysis report, generate a first summary report; and, sort the instruction information in the first summary report according to the time of stacking to obtain a target summary report.
[0107] By implementing the above-mentioned device, the electronic device can eliminate the header row data, explanation row data and other row data in the instruction analysis report that are not helpful for the subsequent instruction execution analysis process, and only summarize the target row data including the instruction information into a first summary report, thereby reducing the amount of data in the first summary report obtained by summarizing, and reducing the amount of calculation for subsequent analysis of the first summary report.
[0108] As an optional implementation, the summary unit 604 is also used to traverse each line of data in the first instruction analysis report and extract the line data that meets the first condition as the target line data. The first condition includes that the line data satisfies the first regular expression, and the first regular expression is used to determine whether the line data includes the stack push time.
[0109] By implementing the above device, the electronic device can quickly traverse each line of data in the instruction analysis report through the traversal statement, and determine the target line of data including the instruction information through the first regular expression. The whole process can be completed automatically and quickly by the back end of the electronic device, thereby improving the efficiency of generating the first summary report.
[0110] As an optional implementation, the summarizing unit 604 is further configured to summarize the multiple target row data extracted from each instruction analysis report, and add a corresponding target parameter at the end of each target row data to obtain a first summary report, wherein the target parameter matches the instruction information included in the corresponding target row data;
[0111] The target parameters include one or more of the stacking time, the end time, the delay time, the length information of the operation register and the assembly code. The delay time is the difference between the stacking time and the execution time of the program instruction.
[0112] By implementing the above device, the electronic device can add one or more of the program instruction's stack push time, end time, delay duration, calculation register length information and assembly code to the end of the target row data in a certain order. If the parameters of the instruction program need to be modified later, the target parameters at the end can be modified directly, which is also convenient for the subsequent assignment of the generated performance report display page directly according to the target parameters.
[0113] As an optional implementation, the instruction information further includes the length information of the operation register corresponding to the program instruction and the end time corresponding to the program instruction; Figure 6 The device shown may also include a determination unit and a marking unit (not shown), wherein:
[0114] a determination unit, configured to determine, after sorting instruction information included in the plurality of instruction analysis reports according to the stacking time to obtain a target summary report, a predicted end time corresponding to the first instruction information according to the stacking time and the length information of the operation register included in the first instruction information, where the first instruction information is any one of the plurality of instruction information included in the target summary report;
[0115] A marking unit is used to add a target mark to the first instruction information in the target summary report when the end time included in the first instruction information does not match the predicted end time. The target mark is used to indicate that there is a delay in the execution of the program instruction corresponding to the first instruction information.
[0116] By implementing the above-mentioned device, the time required for the electronic device to complete the operation of the first instruction information can be determined by calculating the length of the operation register and the first product of the target time length, and then the time required for the electronic device to complete the operation of the first instruction information is added to the time of pushing the stack to obtain the predicted end time of the electronic device completing the first instruction information.
[0117] As an optional implementation, the generation unit 606 is also used to generate an initial page, the coordinate attribute corresponding to the first axis of the initial page is the channel type, and the coordinate attribute corresponding to the second axis is the moment; and, based on the various instruction information included in the target summary report, an image block corresponding to each instruction information is generated in the initial page to obtain a performance report display page; wherein the first axis coordinate of the display coordinate corresponding to the image block corresponding to the first instruction information matches the channel type corresponding to the first instruction information, and the second axis coordinate corresponding to the image block matches the stacking moment corresponding to the first instruction information, and the first instruction information is any one of the multiple instruction information included in the target summary report.
[0118] By implementing the above device, the electronic device can generate image blocks corresponding to each instruction information on the performance report display page, wherein the first-axis coordinate of the display coordinate corresponding to the image block matches the channel type corresponding to the first instruction information, and the second-axis coordinate corresponding to the image block matches the stacking time corresponding to the first instruction information. This allows the user to quickly and conveniently determine which channels' instructions are stacked in parallel through the positional relationship between the image blocks, thereby facilitating the subsequent analysis of the parallel performance of multiple channels.
[0119] As an optional implementation, the instruction information also includes the end time and delay duration of the program instruction, and the delay duration is the difference between the time when the program instruction is pushed into the stack and the time when the program instruction is executed; the generation unit 606 is also used to determine the target height and target width of the image block corresponding to the first instruction information, the target height is positively correlated with the first difference, the first difference is the difference between the end time and the push time corresponding to the first instruction information, and the target width is positively correlated with the delay duration included in the first instruction information; and, according to the channel type, push time, target height and target width corresponding to the first instruction information, generate the image block corresponding to the first instruction information in the initial page.
[0120] By implementing the above-mentioned device, the height of the image block corresponding to the first instruction information can be determined according to the difference between the end time and the stacking time corresponding to the first instruction information, so that subsequent users can determine the approximate execution time of the first instruction information through the height of the image block; the width of the image block corresponding to the first instruction information can be determined according to the delay time corresponding to the first instruction information, so that subsequent users can determine which instruction information has more serious delays through the width differences between each image block.
[0121] As an optional implementation, Figure 6 The device shown may also include a setting unit not shown, wherein:
[0122] a setting unit, configured to generate image blocks corresponding to the respective instruction information in the initial page according to the respective instruction information included in the target summary report to obtain the performance report display page, and then set a zoom component for the performance report display page, wherein the zoom component is used to perform a zoom operation on the performance report display page, and / or,
[0123] A mouse response event is set for the image block in the performance report display page. The mouse response event includes outputting instruction information corresponding to the target image block when a mouse input event is detected to trigger the target image block.
[0124] By implementing the above device, it is possible to set a zoom component and / or a mouse response event to facilitate users to browse the performance report display page, thereby improving the user experience.
[0125] See also Figure 7 , Figure 7 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0126] like Figure 7 As shown, the electronic device may include:
[0127] A memory 701 storing executable program codes;
[0128] a processor 702 coupled to the memory 701;
[0129] The processor 702 calls the executable program code stored in the memory 701 to execute the method for generating the performance report disclosed in the above embodiments.
[0130] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for generating a performance report disclosed in the above embodiments.
[0131] The embodiments of the present application also disclose an application publishing platform, wherein the application publishing platform is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes part or all of the steps of the method in the above method embodiments.
[0132] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
[0133] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0134] The units described above 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.
[0135] 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.
[0136] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, 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, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.
[0137] Those skilled 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 related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0138] The above is a detailed introduction to a method and device for generating a performance report, an electronic device, and a storage medium disclosed in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for a person skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and scope of application. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for generating a performance report, characterized in that: The method comprises: Acquire multiple instruction analysis reports, each instruction analysis report corresponds to a channel, each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information includes at least the time when the program instruction is pushed into the stack; Sorting the instruction information included in the plurality of instruction analysis reports according to the time of being pushed into the stack to obtain a target summary report; A performance report display page is generated according to the target summary report, and the performance report display page includes at least two dimensions of information, namely, the channel type corresponding to each piece of instruction information and the corresponding stacking time.
2. The method according to claim 1, characterized in that The instruction information included in the plurality of instruction analysis reports is sorted according to the time of being pushed into the stack to obtain a target summary report, including: Traversing each row of data in a first instruction analysis report, and extracting target row of data including instruction information, wherein the first instruction analysis report is any one of the multiple instruction analysis reports; Generate a first summary report based on the plurality of target row data extracted from each of the instruction analysis reports; The instruction information in the first summary report is sorted according to the time of being pushed into the stack to obtain a target summary report.
3. The method according to claim 2, characterized in that The traversing each row of data in the first instruction analysis report and extracting the target row of data including instruction information includes: Each line of data in the first instruction analysis report is traversed, and line data satisfying a first condition is extracted as target line data, wherein the first condition includes that the line data satisfies a first regular expression, and the first regular expression is used to determine whether the line data includes a stack push time.
4. The method according to claim 2, characterized in that: Generating a first summary report according to the plurality of target row data extracted from each of the instruction analysis reports includes: Summarizing the multiple target row data extracted from each of the instruction analysis reports, and adding a corresponding target parameter at the end of each of the target row data to obtain a first summary report, wherein the target parameter matches the instruction information included in the corresponding target row data; The target parameters include one or more of a push time, an end time, a delay time, length information of an operation register, and an assembly code. The delay time is the difference between a program instruction push time and an execution time.
5. The method according to claim 1, characterized in that: The instruction information also includes length information of arithmetic registers corresponding to the program instructions and an end time corresponding to the program instructions; after the instruction information included in the plurality of instruction analysis reports is sorted according to the stacking time to obtain a target summary report, the method further includes: Determining a predicted end time corresponding to the first instruction information according to the stack push time and the length information of the operation register included in the first instruction information, wherein the first instruction information is any one of the multiple instruction information included in the target summary report; If the end time included in the first instruction information does not match the predicted end time, a target mark is added to the first instruction information in the target summary report, and the target mark is used to indicate that there is a delay in the execution of the program instruction corresponding to the first instruction information.
6. The method according to claim 1, characterized in that The generating a performance report display page according to the target summary report includes: Generate an initial page, wherein the coordinate attribute corresponding to the first axis of the initial page is the channel type, and the coordinate attribute corresponding to the second axis is the time; According to each instruction information included in the target summary report, an image block corresponding to each instruction information is generated in the initial page to obtain a performance report display page, wherein the first axis coordinate of the display coordinate corresponding to the image block corresponding to the first instruction information matches the channel type corresponding to the first instruction information, and the second axis coordinate corresponding to the image block matches the push time corresponding to the first instruction information, and the first instruction information is any one of the multiple instruction information included in the target summary report.
7. The method according to claim 6, characterized in that The instruction information also includes the end time and delay time of the program instruction, and the delay time is the difference between the time when the program instruction is pushed into the stack and the time when it is executed; and the image blocks corresponding to the various instruction information included in the target summary report are generated in the initial page, including: Determine a target height and a target width of the image block corresponding to the first instruction information, wherein the target height is positively correlated with a first difference value, the first difference value is a difference between an end time and a push time corresponding to the first instruction information, and the target width is positively correlated with a delay duration included in the first instruction information; An image block corresponding to the first instruction information is generated in the initial page according to the channel type, stacking time, the target height and the target width corresponding to the first instruction information.
8. The method according to claim 6 or 7, characterized in that: After generating image blocks corresponding to the pieces of instruction information included in the target summary report in the initial page to obtain a performance report display page, the method further includes: A zoom component is set for the performance report display page, wherein the zoom component is used to perform a zoom operation on the performance report display page, and / or, A mouse response event is set for the image block in the performance report display page, and the mouse response event includes outputting instruction information corresponding to the target image block when a mouse input event is detected to trigger the target image block.
9. A device for generating a performance report, characterized in that: The method comprises: An acquisition unit, used to acquire multiple instruction analysis reports, each instruction analysis report corresponds to a channel, each instruction analysis report includes instruction information of each program instruction executed by the corresponding channel, and the instruction information includes at least the time when the program instruction is pushed into the stack; A summary unit, used to sort the instruction information included in the plurality of instruction analysis reports according to the time of stacking, to obtain a target summary report; A generating unit is used to generate a performance report display page according to the target summary report, wherein the performance report display page includes at least two dimensions of information, namely, a channel corresponding to each piece of instruction information and a corresponding stacking time.
10. An electronic device, characterized in that: It comprises a memory storing executable program code and a processor coupled to the memory; wherein the processor calls the executable program code stored in the memory to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
