System and method for positioning storage and network performance problems of creative operating system
By introducing function stack management, time-consuming analysis and repair modules into the Xinchuang operating system, using BPF technology and bpftrace tools, the problem of failure to meet the storage and network performance of Xinchuang operating system is solved, and the rapid positioning and repair of performance problems is achieved, and the system performance and application response capabilities are improved.
Patent Information
- Application Number
- CN202510097814.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-23
AI Technical Summary
When running cloud computing, big data, database and other services, the storage performance and network performance do not meet the standards, and lack the methods to quickly locate and solve problems.
It provides a system that locates storage and network performance problems of Xinchuang operating system, including function stack management module, function time-consuming management module, function time-consuming analysis module and function time-consuming repair module. It obtains the kernel function call stack through BPF technology and bpftrace tool, analyzes time-consuming abnormal functions, and generates repair code to improve performance.
It has realized the rapid positioning and repair of storage and network performance issues of the Xinchuang operating system, improved system performance, ensured the response performance of cloud computing, big data, database and other applications, and provided stable and fast computing power support for Xinchuang applications.
Smart Images

Figure CN120034423A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of operating system technology, and specifically to a system and method for locating storage and network performance problems of a trusted computing operating system. Background Art
[0002] Trusted computing operating systems (TCS) were developed to meet the needs of specific trusted computing applications, becoming increasingly important when processing critical applications and data. However, the performance of trusted computing servers and operating systems combined has been less than satisfactory. When running cloud computing, big data, databases, and other services, storage and network performance both face practical challenges.
[0003] To quickly identify and resolve storage and network performance issues in trusted operating systems, operating system vendors need to take a series of measures. First, performance can be improved by optimizing kernel and system parameters. At the hardware level, consider using higher-performance hardware.
[0004] However, which kernel functions should be optimized? Which system parameters should be adjusted? What hardware specifications should be replaced to achieve performance requirements? These questions are all unsupported by actual data.
[0005] Therefore, how to quickly locate and solve the storage and network performance problems of the trusted operating system is a technical problem that needs to be solved. Summary of the Invention
[0006] The technical task of the present invention is to address the above deficiencies and provide a system and method for locating storage and network performance problems of the trusted operating system, so as to solve the technical problem of how to quickly locate and solve storage and network performance problems of the trusted operating system.
[0007] In a first aspect, the present invention provides a system for locating storage and network performance problems of a trusted operating system, which is a performance problem locating service system composed of a function stack management module, a function time management module, a function time analysis module, and a function time repair module configured in user mode;
[0008] The function stack management module is used to access the kernel state through the system call interface, obtain the operating system kernel function call stack based on the BPF technology, store the operating system kernel function call stack in the specified operating system kernel function call stack file, and analyze the kernel functions in the operating system kernel function call stack file to obtain the operating system kernel functions that affect the operating system performance and are below the baseline as target kernel functions;
[0009] The function time management module is used to generate the interception function of the function call start and function call end for the target kernel function, save it as the kernel function time program, and run the kernel function time program to obtain the function time running result;
[0010] The function time consumption analysis module is used to analyze the function time consumption results and obtain the kernel functions with abnormal time consumption;
[0011] The function time-consuming modification module is used to obtain the time-consuming abnormal function repair code, execute the time-consuming abnormal function repair code for verification, and determine whether the performance of the operating system is above the baseline. If not, the function stack management module is called.
[0012] Preferably, the function stack management module is used to write an operating system kernel function stack acquisition function through BPF technology, call the bpftrace tool and execute the operating system kernel function stack acquisition function to obtain the storage and network kernel function call stacks of the specified process.
[0013] As a preference, the storage type supports SATA type, NVME type, and BCache type. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack stored by the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probe related to kprobe:dma_direct*;
[0014] The network type supports sending and receiving data packets. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack of the network of the specified process, the kernel function call stack is generated by intercepting the kernel function probes related to kprobe:net*tx_* and kprobe:net_*rx_*.
[0015] The operating system kernel function call stack files are named storage_random number.kstack and net_random number.kstack.
[0016] Preferably, when analyzing the kernel function in the kernel function call stack file of the operating system, the function stack management module is used to perform the following: output the function name in the corresponding kernel function call stack of the operating system using the binary method, the quarter method, the eighth method and the full method respectively, and save it to the specified function file to provide input content for the function time management module;
[0017] Correspondingly, the function time-consuming management module is used to perform the following: read the function file obtained by the function stack management module through the binary division method, the quarter division method, the eighth division method and the full division method, obtain the function name of the corresponding operating system kernel function, for each target kernel function, generate the interception function of the function call start and the function call end, save them as the kernel function time-consuming program, and compile and build them into executable programs respectively, run the kernel function time-consuming program, and obtain the operating system kernel function time-consuming running results of the binary division method, the quarter division method, the eighth division method and the full division method;
[0018] Correspondingly, the function time analysis module is used to perform the following:
[0019] Analyze the binary operating system kernel function time-consuming running results to obtain whether the most time-consuming operating system kernel function is in the upper half or the lower half of the operating system kernel function call stack:
[0020] Based on the results of the binary analysis, analyze the running results of the kernel function time-consuming program of the quarter method to obtain the quarter in which the most time-consuming operating system kernel function is located;
[0021] Based on the results of the four-part analysis, analyze the running results of the eight-part kernel function time-consuming program to obtain the eighth part in which the most time-consuming operating system kernel function is located;
[0022] According to the results of the eight-part analysis, the running results of the kernel function time-consuming program of the full-part analysis method are analyzed to obtain the most time-consuming operating system kernel function.
[0023] Preferably, the function call start interception function starts with kprobe, calls the corresponding kernel function, obtains the function call start time in nanoseconds, and saves it in a starttime variable; the function call end interception function starts with kretprobe, calls the corresponding kernel function, obtains the function call end time in nanoseconds, subtracts the starttime variable, obtains the execution time of the corresponding kernel function, and prints it to the standard output.
[0024] In a second aspect, the present invention provides a method for locating storage and network performance problems of a trusted operating system, which implements storage and network performance problem locating of a trusted operating system by a system for locating storage and network performance problems of a trusted operating system as described in any one of the first aspects, and the method comprises the following steps:
[0025] S100, performing function stack management through a function stack management module: accessing kernel state through a system call interface, obtaining an operating system kernel function call stack based on BPF technology, storing the operating system kernel function call stack in a specified operating system kernel function call stack file, and analyzing kernel functions in the operating system kernel function call stack file to obtain operating system kernel functions that affect operating system performance and are below a baseline as target kernel functions;
[0026] S200, performing function time management through a function time management module: generating an interception function of a function call start and a function call end for a target kernel function, saving the function call start and end functions as a kernel function time program, and running the kernel function time program to obtain a function time running result;
[0027] S300, performing function time consumption analysis through a function time consumption analysis module: analyzing the function time consumption running results to obtain kernel functions with abnormal time consumption;
[0028] S400. Modify the function time consumption through the function time consumption modification module: obtain the time-consuming abnormal function repair code, execute the time-consuming abnormal function repair code for verification, and determine whether the performance of the operating system is above the baseline. If not, execute steps S100-S400.
[0029] Preferably, when function stack management is performed through the function stack management module, the operating system kernel function stack acquisition function is written through BPF technology, the bpftrace tool is called and the operating system kernel function stack acquisition function is executed to obtain the storage and network kernel function call stacks of the specified process.
[0030] As a preference, the storage type supports SATA type, NVME type, and BCache type. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack stored by the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probe related to kprobe:dma_direct*;
[0031] The network type supports sending and receiving data packets. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack of the network of the specified process, the kernel function call stack is generated by intercepting the kernel function probes related to kprobe:net*tx_* and kprobe:net_*rx_*.
[0032] The operating system kernel function call stack files are named storage_random number.kstack and net_random number.kstack.
[0033] As a preferred embodiment, when analyzing the kernel function in the operating system kernel function call stack file, the following operations are performed: using the binary method, the quarter method, the eighth method and the full method to output the function name in the corresponding operating system kernel function call stack, and save it to the specified function file to provide input content for the function time management module;
[0034] Correspondingly, when function time consumption management is performed through the function time consumption management module, the following operations are performed: read the function file obtained by the function stack management module through the binary division method, the quarter division method, the eighth division method and the full division method, obtain the function name of the corresponding operating system kernel function, for each target kernel function, generate the interception function of the function call start and the function call end, save them as the kernel function time consumption program, and compile and build them into executable programs respectively, run the kernel function time consumption program, and obtain the operating system kernel function time consumption running results of the binary division method, the quarter division method, the eighth division method and the full division method;
[0035] Correspondingly, when performing function time consumption analysis through the function time consumption analysis module, perform the following operations:
[0036] Analyze the binary operating system kernel function time-consuming running results to obtain whether the most time-consuming operating system kernel function is in the upper half or the lower half of the operating system kernel function call stack:
[0037] Based on the results of the binary analysis, analyze the running results of the kernel function time-consuming program of the quarter method to obtain the quarter in which the most time-consuming operating system kernel function is located;
[0038] Based on the results of the four-part analysis, analyze the running results of the eight-part kernel function time-consuming program to obtain the eighth part in which the most time-consuming operating system kernel function is located;
[0039] According to the results of the eight-part analysis, the running results of the kernel function time-consuming program of the full-part analysis method are analyzed to obtain the most time-consuming operating system kernel function.
[0040] Preferably, the function call start interception function starts with kprobe, calls the corresponding kernel function, obtains the function call start time in nanoseconds, and saves it in a starttime variable; the function call end interception function starts with kretprobe, calls the corresponding kernel function, obtains the function call end time in nanoseconds, subtracts the starttime variable, obtains the execution time of the corresponding kernel function, and prints it to the standard output.
[0041] The system and method for locating storage and network performance problems of the trusted operating system of the present invention have the following advantages: it realizes performance problem locating service, supports function stack management, supports function time consumption management, supports function time consumption analysis, supports function time consumption repair, realizes the rapid positioning and repair of performance problems of storage and network of the trusted operating system, improves the performance of the trusted operating system, ensures the response performance of applications such as cloud computing, big data, and databases, and provides stable and fast computing power support for trusted applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] The present invention will be further described below with reference to the accompanying drawings.
[0044] Figure 1 This is a structural block diagram of a system for locating storage and network performance issues of a trusted computing operating system in Example 1. DETAILED DESCRIPTION
[0045] The present invention will be further described below with reference to the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments given are not intended to limit the present invention. Unless there is a conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0046] The embodiments of the present invention provide a system and method for locating storage and network performance problems of a trusted operating system, which are used to solve the technical problem of how to quickly locate and solve storage and network performance problems of a trusted operating system.
[0047] Example 1:
[0048] The present invention provides a system for locating storage and network performance problems of a trusted computing operating system, which is a performance problem locating service system composed of a function stack management module, a function time consumption management module, a function time consumption analysis module, and a function time consumption repair module configured in user mode.
[0049] The function stack management module is used to access the kernel state through the system call interface, obtain the operating system kernel function call stack based on BPF technology, store the operating system kernel function call stack in the specified operating system kernel function call stack file, and analyze the kernel functions in the operating system kernel function call stack file to obtain the operating system kernel functions that affect the operating system performance and are below the baseline as the target kernel functions.
[0050] In this embodiment, the function stack management module is used to write the operating system kernel function stack acquisition function through BPF technology, call the bpftrace tool and execute the operating system kernel function stack acquisition function to obtain the storage and network kernel function call stacks of the specified process.
[0051] The storage types supported are SATA, NVME, and BCache. When the bpftrace tool is called and the operating system kernel function stack acquisition function is executed to obtain the kernel function call stack of the storage of the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probes related to kprobe:dma_direct*.
[0052] The network type supports sending and receiving data packets. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack of the network of the specified process, the kernel function call stack is generated by intercepting the kernel function probes related to kprobe:net*tx_* and kprobe:net_*rx_*.
[0053] The operating system kernel function call stack files are named storage_random number.kstack and net_random number.kstack.
[0054] When analyzing the kernel functions in the operating system kernel function call stack file, the function stack management module is used to perform the following: output the function names in the corresponding operating system kernel function call stack using binary, quarter, eighth and full division methods respectively, and save them to the specified function file to provide input content for the function time management module.
[0055] The interface for generating the operating system kernel function call stack is shown in Table 1.
[0056] Table 1. Interface for generating operating system kernel function call stack
[0057]
[0058] The following is a sample of the intercepted operating system kernel function call stack:
[0059] / / Store the received kernel function call stack
[0060] dma_direct_map_sg+1
[0061] dma_map_sg_attrs+48
[0062] scsi_dma_map+57
[0063] megasas_make_sgl64.constprop.0+20
[0064] megasas_build_ldio+481
[0065] megasas_build_and_issue_cmd+199
[0066] scsi_dispatch_cmd+152
[0067] scsi_queue_rq+635
[0068] blk_mq_dispatch_rq_list+278
[0069] __blk_mq_do_dispatch_sched+184
[0070] blk_mq_do_dispatch_sched+59
[0071] __blk_mq_sched_dispatch_requests+337
[0072] blk_mq_sched_dispatch_requests+48
[0073] __blk_mq_run_hw_queue+71
[0074] __blk_mq_delay_run_hw_queue+298
[0075] blk_mq_sched_insert_requests+104
[0076] blk_mq_flush_plug_list+256
[0077] blk_finish_plug+58
[0078] __iomap_dio_rw+1025
[0079] iomap_dio_rw+10
[0080] xfs_file_dio_aio_write+382
[0081] xfs_file_write_iter+149
[0082] aio_write+252
[0083] io_submit_one+218
[0084] __se_sys_io_submit+121
[0085] do_syscall_64+64
[0086] entry_SYSCALL_64_after_hwframe+103.
[0087] The function time-consuming management module is used to generate interception functions of the function call start and function call end for the target kernel function, save them as kernel function time-consuming programs, and run the kernel function time-consuming programs to obtain function time-consuming running results.
[0088] As a specific implementation, the function time-consuming management module is used to perform the following: read the function file obtained by the function stack management module through binary division, quarter division, eighth division and full division analysis, obtain the function name of the corresponding operating system kernel function, and for each target kernel function, generate interception functions for the start and end of the function call, save them as kernel function time-consuming programs, and compile and build them into executable programs respectively, run the kernel function time-consuming programs, and obtain the operating system kernel function time-consuming running results of the binary division, quarter division, eighth division and full division methods.
[0089] The function call start interception function begins with kprobe, calls the corresponding kernel function, obtains the function call start time in nanoseconds, and saves it to a variable called starttime. The function call end interception function begins with kretprobe, calls the corresponding kernel function, obtains the function call end time in nanoseconds, subtracts the starttime variable, and obtains the execution time of the corresponding kernel function, which is printed to standard output.
[0090] The following is an example of a time-consuming function program:
[0091]
[0092]
[0093] The function time consumption analysis module is used to analyze the function time consumption results and obtain the kernel functions with abnormal time consumption.
[0094] As a specific implementation, the function time consumption analysis module is used to perform the following:
[0095] (1) Analyze the binary operating system kernel function time-consuming running results to obtain whether the most time-consuming operating system kernel function is in the upper half or the lower half of the operating system kernel function call stack:
[0096] (2) Based on the results of the bisection analysis, analyze the running results of the kernel function time-consuming program of the quarter-partition method to obtain the quarter in which the most time-consuming operating system kernel function is located;
[0097] (3) Based on the results of the four-part analysis, analyze the running results of the eight-part kernel function time-consuming program to obtain the eighth part in which the most time-consuming operating system kernel function is located;
[0098] (4) Based on the results of the eight-part analysis, analyze the running results of the kernel function time-consuming program of the full-part analysis method to obtain the most time-consuming operating system kernel function.
[0099] Through the above analysis process, the most time-consuming kernel function can be obtained.
[0100] The function time-consuming modification module is used to obtain the time-consuming abnormal function repair code, execute the time-consuming abnormal function repair code for verification, and determine whether the performance of the operating system is above the baseline. If not, the function stack management module is called.
[0101] After obtaining the most time-consuming kernel function, relevant personnel analyze and modify the kernel function logic, output the kernel function repair plan, modify the kernel function, optimize the corresponding function, form the time-consuming abnormal function repair code, and import the time-consuming abnormal function repair code into the function time-consuming modification module.
[0102] The function time-consuming modification module executes the time-consuming abnormal function repair code for verification, tests the modified kernel, and verifies whether the storage and network performance tests meet the standards. If not, the modules in the performance problem location service system cooperate to search for the time-consuming kernel function, modify the corresponding kernel function, and verify it.
[0103] The system of this embodiment implements performance problem location service, supports function stack management, supports function time management, supports function time analysis, and supports function time repair
[0104] Example 2:
[0105] The present invention provides a method for locating storage and network performance problems of an ICT-based operating system, and implements storage and network performance problem locating of the ICT-based operating system through the system disclosed in Example 1. The method includes four steps: function stack management through a function stack management module, function time management through a function time management module, function time analysis through a function time analysis module, and function time modification through a function time modification module.
[0106] S100. Perform function stack management through the function stack management module: access the kernel state through the system call interface, obtain the operating system kernel function call stack based on the BPF technology, store the operating system kernel function call stack in the specified operating system kernel function call stack file, and analyze the kernel functions in the operating system kernel function call stack file to obtain the operating system kernel function that affects the operating system performance and is below the baseline as the target kernel function.
[0107] In this embodiment, the operating system kernel function stack acquisition function is written using BPF technology, the bpftrace tool is called and the operating system kernel function stack acquisition function is executed to obtain the storage and network kernel function call stacks of the specified process.
[0108] The storage types supported are SATA, NVME, and BCache. When the bpftrace tool is called and the operating system kernel function stack acquisition function is executed to obtain the kernel function call stack of the storage of the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probes related to kprobe:dma_direct*.
[0109] The network type supports sending and receiving data packets. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack of the network of the specified process, the kernel function call stack is generated by intercepting the kernel function probes related to kprobe:net*tx_* and kprobe:net_*rx_*.
[0110] The operating system kernel function call stack files are named storage_random number.kstack and net_random number.kstack.
[0111] When analyzing the kernel functions in the operating system kernel function call stack file, perform the following operations: use the binary method, the quarter method, the eighth method and the full method to output the function names in the corresponding operating system kernel function call stack, and save them to the specified function file to provide input content for the function time management module.
[0112] S200, performing function time management through a function time management module: generating interception functions of function call start and function call end for a target kernel function, saving them as a kernel function time program, and running the kernel function time program to obtain a function time running result.
[0113] As a specific implementation, when function time consumption management is performed through the function time consumption management module, the following operations are performed: read the function file obtained by the function stack management module through binary division, quarter division, eighth division and full division analysis, obtain the function name of the corresponding operating system kernel function, and for each target kernel function, generate interception functions for the start and end of the function call, save them as kernel function time consumption programs, and compile and build them into executable programs respectively, run the kernel function time consumption programs, and obtain the operating system kernel function time consumption running results of the binary division, quarter division, eighth division and full division methods.
[0114] The function call start interception function begins with kprobe, calls the corresponding kernel function, obtains the function call start time in nanoseconds, and saves it to a variable called starttime. The function call end interception function begins with kretprobe, calls the corresponding kernel function, obtains the function call end time in nanoseconds, subtracts the starttime variable, and obtains the execution time of the corresponding kernel function, which is printed to standard output.
[0115] S300 , performing function time consumption analysis through a function time consumption analysis module: performing analysis based on the function time consumption running result to obtain kernel functions with abnormal time consumption.
[0116] As a specific implementation, when performing function time consumption analysis through the function time consumption analysis module, perform the following operations:
[0117] (1) Analyze the binary operating system kernel function time-consuming running results to obtain whether the most time-consuming operating system kernel function is in the upper half or the lower half of the operating system kernel function call stack:
[0118] (2) Based on the results of the bisection analysis, analyze the running results of the kernel function time-consuming program of the quarter-partition method to obtain the quarter in which the most time-consuming operating system kernel function is located;
[0119] (3) Based on the results of the four-part analysis, analyze the running results of the eight-part kernel function time-consuming program to obtain the eighth part in which the most time-consuming operating system kernel function is located;
[0120] (4) Based on the results of the eight-part analysis, analyze the running results of the kernel function time-consuming program of the full-part analysis method to obtain the most time-consuming operating system kernel function.
[0121] Through the above analysis process, the most time-consuming kernel function can be obtained.
[0122] S400. Modify the function time consumption through the function time consumption modification module: obtain the time-consuming abnormal function repair code, execute the time-consuming abnormal function repair code for verification, and determine whether the performance of the operating system is above the baseline. If not, execute steps S100-S400.
[0123] After obtaining the most time-consuming kernel function, relevant personnel analyze and modify the kernel function logic, output the kernel function repair plan, modify the kernel function, optimize the corresponding function, form the time-consuming abnormal function repair code, and import the time-consuming abnormal function repair code into the function time-consuming modification module.
[0124] This step verifies the time-consuming abnormal function repair code by executing the function time-consuming modification module, tests the modified kernel, and verifies whether the storage and network performance tests meet the standards. If not, the modules in the performance problem location service system cooperate to search for the time-consuming kernel function, modify the corresponding kernel function, and verify it.
[0125] The above is a detailed introduction to the system and method for locating storage and network performance problems of the trusted computing operating system provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A system for locating storage and network performance problems of a trusted operating system, characterized in that: A performance problem location service system consisting of a function stack management module, a function time management module, a function time analysis module, and a function time repair module configured in user mode; The function stack management module is used to access the kernel state through the system call interface, obtain the operating system kernel function call stack based on the BPF technology, store the operating system kernel function call stack in the specified operating system kernel function call stack file, and analyze the kernel functions in the operating system kernel function call stack file to obtain the operating system kernel function that affects the operating system performance and is below the baseline as the target kernel function; The function time-consuming management module is used to generate interception functions of the function call start and the function call end for the target kernel function, save them as kernel function time-consuming programs, and run the kernel function time-consuming programs to obtain the function time-consuming running results; The function time consumption analysis module is used to analyze the function time consumption results and obtain the kernel functions with abnormal time consumption; The function time-consuming modification module is used to obtain the time-consuming abnormal function repair code, execute the time-consuming abnormal function repair code for verification, and determine whether the performance of the operating system is above the baseline. If not, call the function stack management module.
2. According to the system for locating storage and network performance problems of the trusted computing operating system according to claim 1, it is characterized in that: The function stack management module is used to write an operating system kernel function stack acquisition function through BPF technology, call the bpftrace tool and execute the operating system kernel function stack acquisition function to obtain the storage and network kernel function call stacks of the specified process.
3. The system for locating storage and network performance problems of a trusted computing operating system according to claim 2 is characterized in that: The storage type supports sata type, nvme type, and bcache type. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack of the storage of the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probes related to kprobe:dma_direct*; The network type supports sending data packets and receiving data packets. When the bpftrace tool is called and the operating system kernel function stack acquisition function is executed to obtain the kernel function call stack of the network of the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probes related to kprobe:net*tx_* and kprobe:net_*rx_*. The operating system kernel function call stack files are named storage_random number.kstack and net_random number.kstack.
4. The system for locating storage and network performance problems of a trusted computing operating system according to claim 1, 2 or 3, characterized in that: When analyzing the kernel function in the kernel function call stack file of the operating system, the function stack management module is used to perform the following: output the function name in the corresponding kernel function call stack of the operating system by using the binary method, the quarter method, the eighth method and the full method respectively, and save it to the specified function file to provide input content for the function time consumption management module; Correspondingly, the function time-consuming management module is used to perform the following: read the function file obtained by the function stack management module through binary division, quarter division, octave division and full division analysis, obtain the function name of the corresponding operating system kernel function, for each target kernel function, generate the interception function of the function call start and the function call end, save them as kernel function time-consuming programs, and compile and build them into executable programs respectively, run the kernel function time-consuming programs, and obtain the operating system kernel function time-consuming running results of the binary division, quarter division, octave division and full division methods; Correspondingly, the function time-consuming analysis module is used to perform the following: Analyze the time-consuming running results of the binary operating system kernel function to obtain whether the most time-consuming operating system kernel function is in the upper half or lower half of the operating system kernel function call stack: According to the results of the binary analysis, analyze the running results of the kernel function time-consuming program of the quarter method to obtain the quarter in which the most time-consuming operating system kernel function is located; According to the results of the four-part analysis, analyze the running results of the eight-part kernel function time-consuming program to find out which eighth part the most time-consuming operating system kernel function is in; According to the results of the eight-part analysis, the running results of the kernel function time-consuming program of the full-part analysis method are analyzed to obtain the most time-consuming operating system kernel function.
5. The system for locating storage and network performance problems of a trusted computing operating system according to claim 1, 2 or 3, characterized in that: The function call start interception function starts with kprobe, calls the corresponding kernel function, obtains the function call start time in nanoseconds, and saves it in a starttime variable; the function call end interception function starts with kretprobe, calls the corresponding kernel function, obtains the function call end time in nanoseconds, subtracts the starttime variable, obtains the execution time of the corresponding kernel function, and prints it to the standard output.
6. A method for locating storage and network performance problems of a trusted operating system, characterized in that: The problem location of the storage and network performance of the trusted operating system is achieved by using the system for locating the storage and network performance problems of the trusted operating system as described in any one of claims 1 to 5, and the method comprises the following steps: S100, performing function stack management through a function stack management module: accessing the kernel state through a system call interface, obtaining an operating system kernel function call stack based on the BPF technology, storing the operating system kernel function call stack in a specified operating system kernel function call stack file, and analyzing the kernel functions in the operating system kernel function call stack file to obtain an operating system kernel function that affects the operating system performance and is below the baseline as a target kernel function; S200, performing function time consumption management through a function time consumption management module: generating interception functions of function call start and function call end for a target kernel function, saving the functions as kernel function time consumption programs, and running the kernel function time consumption programs to obtain function time consumption running results; S300, performing function time consumption analysis through a function time consumption analysis module: analyzing based on the function time consumption running result, and obtaining the kernel function with abnormal time consumption; S400. Modify the function time consumption through the function time consumption modification module: obtain the time-consuming abnormal function repair code, execute the time-consuming abnormal function repair code for verification, and determine whether the performance of the operating system is above the baseline. If not, execute steps S100-S400.
7. The method for locating storage and network performance problems of a trusted operating system according to claim 6 is characterized in that: When function stack management is performed through the function stack management module, the operating system kernel function stack acquisition function is written through the BPF technology, the bpftrace tool is called and the operating system kernel function stack acquisition function is executed to obtain the kernel function call stack of the storage and network of the specified process.
8. The method for locating storage and network performance problems of a trusted operating system according to claim 7 is characterized in that: The storage type supports sata type, nvme type, and bcache type. When calling the bpftrace tool and executing the operating system kernel function stack acquisition function to obtain the kernel function call stack of the storage of the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probes related to kprobe:dma_direct*; The network type supports sending data packets and receiving data packets. When the bpftrace tool is called and the operating system kernel function stack acquisition function is executed to obtain the kernel function call stack of the network of the specified process, the corresponding kernel function call stack is generated by intercepting the kernel function probes related to kprobe:net*tx_* and kprobe:net_*rx_*. The operating system kernel function call stack files are named storage_random number.kstack and net_random number.kstack.
9. The method for locating storage and network performance problems of a trusted computing operating system according to claim 6, 7 or 8, characterized in that: When analyzing the kernel function in the kernel function call stack file of the operating system, the following operations are performed: the function name in the corresponding kernel function call stack of the operating system is outputted by using the binary method, the quarter method, the eighth method and the full method respectively, and saved to the specified function file, so as to provide input content for the function time consumption management module; Correspondingly, when function time consumption management is performed through the function time consumption management module, the following operations are performed: read the function file obtained by the function stack management module through binary division, quarter division, octave division and full division analysis, obtain the function name of the corresponding operating system kernel function, for each target kernel function, generate the interception function of the function call start and the function call end, save them as kernel function time consumption program, and compile and build them into executable programs respectively, run the kernel function time consumption program, and obtain the operating system kernel function time consumption running results of binary division, quarter division, octave division and full division; Correspondingly, when performing function time consumption analysis through the function time consumption analysis module, perform the following operations: Analyze the time-consuming running results of the binary operating system kernel function to obtain whether the most time-consuming operating system kernel function is in the upper half or lower half of the operating system kernel function call stack: According to the results of the binary analysis, analyze the running results of the kernel function time-consuming program of the quarter method to obtain the quarter in which the most time-consuming operating system kernel function is located; According to the results of the four-part analysis, analyze the running results of the eight-part kernel function time-consuming program to find out which eighth part the most time-consuming operating system kernel function is in; According to the results of the eight-part analysis, the running results of the kernel function time-consuming program of the full-part analysis method are analyzed to obtain the most time-consuming operating system kernel function.
10. The method for locating storage and network performance problems of a trusted operating system according to claim 6, 7 or 8, characterized in that: The function call start interception function starts with kprobe, calls the corresponding kernel function, obtains the function call start time in nanoseconds, and saves it in a starttime variable; the function call end interception function starts with kretprobe, calls the corresponding kernel function, obtains the function call end time in nanoseconds, subtracts the starttime variable, obtains the execution time of the corresponding kernel function, and prints it to the standard output.
Citation Information
Patent Citations
Method and device for determining time consumption of function, electronic equipment and storage medium
CN117648240A
Business request exception delimitation analysis method and system, electronic equipment and storage medium
CN119088612A
Method for monitoring full-stack network time delay between cloud native application and database based on eBPF
CN119182696A
Performance analysis method, electronic equipment, storage medium and program product
CN119292885A