[go: up one dir, main page]

CN116302945B - Test method for measuring real-time performance of Linux system - Google Patents

Test method for measuring real-time performance of Linux system

Info

Publication number
CN116302945B
CN116302945B CN202211743406.XA CN202211743406A CN116302945B CN 116302945 B CN116302945 B CN 116302945B CN 202211743406 A CN202211743406 A CN 202211743406A CN 116302945 B CN116302945 B CN 116302945B
Authority
CN
China
Prior art keywords
kernel
test
data
linux
real
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211743406.XA
Other languages
Chinese (zh)
Other versions
CN116302945A (en
Inventor
光锐
王元卓
殷子迅
何永玉
金瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Science And Technology Big Data Research Institute
Zhengzhou University
Original Assignee
China Science And Technology Big Data Research Institute
Zhengzhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Science And Technology Big Data Research Institute, Zhengzhou University filed Critical China Science And Technology Big Data Research Institute
Priority to CN202211743406.XA priority Critical patent/CN116302945B/en
Publication of CN116302945A publication Critical patent/CN116302945A/en
Application granted granted Critical
Publication of CN116302945B publication Critical patent/CN116302945B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3698Environments for analysis, debugging or testing of software
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3604Analysis of software for verifying properties of programs
    • G06F11/3608Analysis of software for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种用于衡量Linux系统实时性的测试方法,涉及计算机技术领域,包括多个步骤,首先将源代码导入Linux系统中生成Linux内核模块和可执行文件,再将内核模块插入到Linux内核中,实现对内核信息的收集保存,之后将通过分类后的细粒度测试点通过内核模块进行测试,粗粒度测试点在用户态进行测试,并将在内核中获取到需求点延时数据后反应到用户态,通过内核模块结合粗粒度的模拟过程进行计算整理,输出反应Linux系统实时性数据。本发明通过将Linux内核态和用户态的协作,进行丰富的模拟测试,获取相应的实时性相关量化数据,使得测试结果更全面更准确。

The invention discloses a test method for measuring the real-time performance of a Linux system, relates to the field of computer technology, and includes a plurality of steps, firstly, source code is imported into a Linux system to generate a Linux kernel module and an executable file, and then the kernel module is inserted into the Linux kernel to realize the collection and preservation of kernel information, and then the classified fine-grained test points are tested through the kernel module, the coarse-grained test points are tested in the user state, and the delay data of the demand point is obtained in the kernel and then reflected to the user state, and the kernel module is combined with the coarse-grained simulation process to calculate and sort, and output the real-time performance data of the Linux system. The invention performs rich simulation tests by the collaboration of the Linux kernel state and the user state, obtains the corresponding real-time related quantitative data, and makes the test results more comprehensive and accurate.

Description

Test method for measuring real-time performance of Linux system
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a testing method for measuring real-time performance of a Linux system.
Background
The Linux system is taken as outstanding figure of an open source system, and the application scene is very wide. The origin of the Linux system is a user interactive system, and the real-time performance of the Linux system is not considered, but as the open-source Linux system is more and more popular, the Linux system obtains a kernel patch with optimized real-time performance, so that the kernel of the Linux system can become a real-time system kernel, and the Linux system improves the real-time performance of the Linux kernel by patching the Linux kernel so as to meet the real-time performance requirements of most scenes. The real-time performance of the operating system is a comparatively abstract concept, and can be understood as that the specified work is completed within the specified time, and can be called as the real-time performance of the operating system reaching a certain level, which is easy to be affected by hardware resources, software and the like, and the real-time performance of the Linux system is measured and needs to be embodied through data by a test tool.
The CYCLICTEST tool is a relatively authoritative tool for measuring the real-time performance of the Linux system at present, the kernel interrupt delay and the kernel scheduling delay are obtained by simulating the scheduling of the Linux system in a user mode and a method of subtracting a time stamp, so that the real-time performance of the Linux system is reflected, but the CYCLICTEST tool is also a tool which is centralized by a real-time test tool of Linux, is used for measuring a relatively less simulation process of the real-time performance, the reflected real-time performance data is relatively simple, and CYCLICTEST only carries out simulation and data output in the user mode, so that slight additional time expenditure is unavoidable.
In addition, ftrace is taken as a built-in module of a Linux system kernel, the real-time performance of the system can track related detectable points in the running process of the system through a Ftrace tool, and the aim of quantifying the real-time performance is achieved by focusing on a function calling process related to the real-time performance, but Ftrace is supported by Linux authorities and is essentially a Linux kernel tracking mechanism module, the real-time performance is detected as one of functions, the data acquired through Ftrace is often not intuitive, the operation is complex, the integration level is not high, and the quantized real-time performance data can be acquired only by further processing the data.
Disclosure of Invention
Aiming at the defects and problems that existing tools for measuring the real-time performance of the Linux system, such as CYCLICTEST tools and Ftrace tools, have relatively fewer simulation processes for measuring the real-time performance, reflected real-time performance data are simpler, additional time cost exists, the acquired data are not visual enough, the operation is complex, the integration level is not enough, and further quantization processing is needed to be carried out on the data, the invention provides a test method for measuring the real-time performance of the Linux system.
The invention solves the technical problems by adopting a scheme that the testing method for measuring the real-time performance of the Linux system comprises the following steps:
Firstly, a special kernel module and a testing tool are constructed, namely a source code is imported into a Linux system for compiling, and a Linux kernel module and an executable file are generated through compiling, wherein the executable file is the testing tool;
Inserting the kernel module into the Linux kernel, and according to the work content of the self-defined kernel module, realizing the collection of kernel information and storing the collection information in the kernel module;
step three, determining and classifying test index items, namely distinguishing the test index items according to granularity, so that fine-granularity test points test through a kernel module to obtain data, and testing coarse-granularity test points in a user mode in a Linux system;
Step four, executing user mode test, wherein a user runs the executable file compiled in the step one, performs user mode test point simulation, simulates a coarse-granularity simulation program, marks time stamps before and after a simulation process, and performs time period statistics to obtain test point data;
Testing the kernel module, namely triggering the event in the running of the kernel through the set TRACE EVENT in the kernel, realizing statistics of system parameters, subtracting time stamps of different event statistics to obtain the delay of a tested demand point, and reacting to a user state after obtaining delay data of the demand point in the kernel;
And step six, the kernel module combines the coarse-granularity simulation process and combines the kernel data collected from the steps to calculate and arrange, so as to output the real-time data of the Linux system which is concerned by the user.
As a preferable technical scheme of the invention, in the second step, the kernel module is inserted into the Linux kernel by using an insmod command.
As a preferable technical scheme of the invention, the test index item in the third step comprises interrupt response delay, semaphore operation delay, message queue operation delay, context switch delay, mutex operation delay, timer operation delay, event operation delay, task operation delay and scheduling operation delay.
As a preferred technical solution of the present invention, the criterion for distinguishing the test index items in the third step is whether the packaging of the demand point can be achieved.
As a preferable technical scheme of the invention, the kernel module in the fifth step adopts tracer technology, interacts with the kernel module through the input of a user, sets and calls corresponding functions, acquires the kernel module test data required by the user, and feeds back the test data to the user through a proc file system.
As a preferable technical scheme of the invention, the proc file system is a communication window of kernel mode and user mode in the Linux system, and a user observes real-time test data through the proc file system.
As a preferable technical scheme of the invention, the process of calculating and sorting the data in the step six is to process a large amount of time data acquired by cyclic test, the minimum value, the maximum value and the accumulation sum of the data item are updated each time the time data are acquired in each cycle, the accumulation sum is used for outputting an average value finally, and the real-time quantized data of the Linux system concerned by the user is output finally.
Compared with the prior art, the method for measuring the real-time performance of the Linux system has the advantages that the special kernel module is constructed, the real-time performance simulation test can be carried out in the kernel state, so that the time loss is reduced, the accuracy of a test result is improved, the Linux kernel state and the user state are combined, the test index items in the existing real-time test tool are enriched, the test environment is more specific, and the time of the test process concerned by the user is acquired before and after the simulation environment, so that the real-time performance test of the Linux system is more comprehensive and accurate.
Drawings
FIG. 1 is a schematic overall flow chart of the present invention;
FIG. 2 is a schematic diagram of a compiling process according to the present invention;
FIG. 3 is a schematic diagram of a testing workflow of the present invention.
Detailed Description
The invention will be further described with reference to the drawings and examples.
Referring to fig. 1-3, the invention provides a testing method for measuring real-time performance of a Linux system, which combines a measuring method of kernel mode and user mode testing data of the Linux system, provides richer testing points, simulates a more specific environment, and acquires time before and after the environment is simulated to acquire time of a testing process concerned by a user, so that real-time performance of the Linux system is reflected better.
Embodiment one:
The test method for measuring the real-time performance of the Linux system provided by the invention comprises the following steps,
Firstly, a special kernel module and a testing tool are constructed, namely a source code is imported into a Linux system with a Linux5.10rt kernel to be compiled, the Linux system comprises a user mode and a kernel mode, a Linux kernel module and an executable file are generated after compiling, the kernel module belongs to the kernel mode, the executable file belongs to the user mode, the kernel module is used for detecting a detectable point in the kernel to obtain related calling information, and the executable file is the testing tool through proc file system and user mode interaction, namely the executable file in the user mode is not only communicated with the kernel module to obtain data, but also performs simulation tests with larger granularity to enrich test data;
The method comprises the steps that a Linux kernel module is inserted into a Linux kernel, the Linux kernel module is divided into a module which is statically compiled into the kernel and a module which is dynamically loaded by an insmod command, the ko file is essentially an ELF file, compared with a common ELF file, a section of structure is added, the ko module is used for recording some information of the ko module, the information is used when the kernel is loaded into the Linux kernel, the kernel module which is dynamically inserted is inserted into the Linux kernel by using the insmod command, the corresponding kernel module is inserted into the kernel when certain functions are needed by the Linux kernel, the kernel module starts to work according to the working content of the self-defined kernel module after the Linux kernel module is inserted into the kernel, in the method, kernel information is collected on the basis of the Linux kernel operation, for example, a time stamp is added to a calling place of two functions of interrupt and on interrupt in the kernel module, the corresponding interrupt processing time can be obtained by subtracting the time, the obtained information is the time delay of each required point in the kernel, and the obtained information is stored in the collection module;
Step three, determining and classifying test index items: distinguishing test index items according to granularity, wherein the test index items comprise interrupt response delay, semaphore operation delay, message queue operation delay, context switching delay, mutex operation delay, timer operation delay, event operation delay, task operation delay and scheduling operation delay, distinguishing the test index items according to granularity, and judging whether a system realizes packaging of the demand point or not, wherein a fine-granularity test point tests through a kernel module to obtain data, a coarse-granularity test point tests in a user state in a Linux system, namely the interrupt response delay and the context switching delay pass through the test in the kernel module, and the other index items are placed in the user state to test, so that each abstract behavior is abstracted through various basic behaviors of a refined operation system, such as interrupt processing time, context switching time and the like, and a simulation test is performed on each abstracted behavior to obtain corresponding time values, and the time values can well reflect the real-time of the operation system;
And step four, executing user mode test, namely, when the user mode test is carried out, the user runs the executable file compiled in the step one, and the executable file is used for bearing the input of the user so as to modify other adjustable data such as test cycle times and the like. The method comprises the steps of executing different test schemes of file simulation, obtaining data concerned by a user, carrying out user state test point simulation, running a coarse-grained simulation program of user state simulation, stamping time stamps before and after the simulation process of the corresponding index item in the step three, carrying out time period statistics, and adopting a memory lock and a real-time scheduling strategy to avoid the influence of preemption as much as possible so as to obtain the data of the test point;
And fifthly, testing the kernel module, namely testing the interrupt response delay and the context switching delay in the kernel module, wherein the kernel module triggers the set event in the kernel operation by means of tracer technology through the set TRACE EVENT in the kernel, so as to realize statistics of system parameters such as time, and the time stamps of different event statistics are subtracted to obtain the delay of a tested demand point, the delay data of the demand point is obtained in the kernel, and then is reacted to a user state through a proc file system, so that user interaction is facilitated, namely interaction is performed with the kernel module through input of a user, a corresponding function is set and called, kernel module test data required by the user is obtained, the proc file system is fed back to the user, a custom directory under the proc file system is defined in the kernel module, and is used for interaction of the user, the proc file system is a communication window of the kernel state and the user state in the Linux system, is a virtual file system, is very suitable for observing kernel information in the Linux system, the kernel information is used as a communication channel of the kernel state and the user state, and the proc file system is created dynamically.
In the method, a part of files are defined for user input, the input content can be copied from a user state to a kernel state through a system interface and used for observing real-time test data, wherein the data are copied from the kernel state, a tracepoint mechanism is adopted by a kernel module, tracepoint is reserved at some fixed positions in the kernel, the insertable codes are mainly data with corresponding time stamps and are stored, the stored time stamp data are subtracted by the kernel module to obtain a time delay time value of a test requirement point, the time delay value is reflected to the user state through a proc file system from the kernel state, and the interface of the proc file system is called by the user state code.
Step six, the kernel module combines the coarse-grained simulation process and the kernel data collected from the steps, performs calculation and arrangement, namely processes a large amount of time data obtained through cyclic test, updates the minimum value, the maximum value and the accumulation sum of the data item every time the time data are obtained in a cyclic way, performs subtraction of the time stamp, and the accumulation sum is used for outputting an average value finally to output Linux system real-time quantized data concerned by a user. The method for measuring the real-time performance of the Linux system provided by the invention adopts a certain relatively short process of operating the operating system to summarize the abstract description of the real-time performance of the system, and then judges the real-time performance of the system by using the abstract description and the test data, combines the advantage of acquiring the Linux data from the kernel mode, simultaneously gives consideration to the convenience of a user mode test tool, enriches the method for testing the real-time performance of the Linux, and ensures that the real-time performance test of the Linux system is more comprehensive and accurate.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the particular embodiments disclosed, but on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.

Claims (7)

1. A test method for measuring real-time performance of a Linux system is characterized by comprising the following steps:
Firstly, a special kernel module and a testing tool are constructed, namely a source code is imported into a Linux system for compiling, and a Linux kernel module and an executable file are generated through compiling, wherein the executable file is the testing tool;
Inserting the kernel module into the Linux kernel, and according to the work content of the self-defined kernel module, realizing the collection of kernel information and storing the collection information in the kernel module;
step three, determining and classifying test index items, namely distinguishing the test index items according to granularity, so that fine-granularity test points test through a kernel module to obtain data, and testing coarse-granularity test points in a user mode in a Linux system;
Step four, executing user mode test, wherein a user runs the executable file compiled in the step one, performs user mode test point simulation, simulates a coarse-granularity simulation program, marks time stamps before and after a simulation process, and performs time period statistics to obtain test point data;
Testing the kernel module, namely triggering the event in the running of the kernel through the set TRACE EVENT in the kernel, realizing statistics of system parameters, subtracting time stamps of different event statistics to obtain the delay of a tested demand point, and reacting to a user state after obtaining delay data of the demand point in the kernel;
And step six, the kernel module combines the coarse-granularity simulation process and combines the kernel data collected from the steps to calculate and arrange, so as to output the real-time data of the Linux system which is concerned by the user.
2. The method for measuring real-time performance of a Linux system according to claim 1, wherein the kernel module is inserted into the Linux kernel by using an insmod command in the second step.
3. The method for measuring real-time performance of a Linux system as in claim 1, wherein the test index items in the third step include interrupt response delay, semaphore operation delay, message queue operation delay, context switch delay, mutex operation delay, timer operation delay, event operation delay, task operation delay and scheduling operation delay.
4. The method for measuring real-time performance of a Linux system according to claim 1, wherein the criterion for distinguishing the test index items in the third step is whether packaging of the demand points can be achieved.
5. The method for measuring real-time performance of a Linux system according to claim 1, wherein the kernel module in the fifth step adopts tracer technology, interacts with the kernel module through input of a user, sets and calls corresponding functions, acquires kernel module test data required by the user, and feeds back the kernel module test data to the user through a proc file system.
6. The method for measuring real-time performance of a Linux system according to claim 5, wherein the proc file system is a communication window between a kernel mode and a user mode in the Linux system, and the user observes real-time performance test data through the proc file system.
7. The method for measuring real-time performance of a Linux system according to claim 1, wherein the calculating and sorting process of the data in the sixth step is to process a large amount of time data obtained by cyclic test, and the minimum value, the maximum value and the accumulation sum of the data item are updated every time the time data are obtained in each cycle, the accumulation sum is used for outputting an average value finally, and the real-time performance quantized data of the Linux system concerned by a user is output finally.
CN202211743406.XA 2022-12-30 2022-12-30 Test method for measuring real-time performance of Linux system Active CN116302945B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211743406.XA CN116302945B (en) 2022-12-30 2022-12-30 Test method for measuring real-time performance of Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211743406.XA CN116302945B (en) 2022-12-30 2022-12-30 Test method for measuring real-time performance of Linux system

Publications (2)

Publication Number Publication Date
CN116302945A CN116302945A (en) 2023-06-23
CN116302945B true CN116302945B (en) 2025-07-25

Family

ID=86778681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211743406.XA Active CN116302945B (en) 2022-12-30 2022-12-30 Test method for measuring real-time performance of Linux system

Country Status (1)

Country Link
CN (1) CN116302945B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722434A (en) * 2012-05-24 2012-10-10 兰雨晴 Performance test method and tool aiming at Linux process scheduling
CN109343960A (en) * 2018-10-12 2019-02-15 郑州云海信息技术有限公司 A task scheduling method, system and related device of a Linux system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760305A (en) * 2016-03-09 2016-07-13 上海博达数据通信有限公司 Real-time system monitoring method under linux
KR102306624B1 (en) * 2016-03-31 2021-09-28 엔티티 디스럽션 유에스 Persistent companion device configuration and deployment platform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722434A (en) * 2012-05-24 2012-10-10 兰雨晴 Performance test method and tool aiming at Linux process scheduling
CN109343960A (en) * 2018-10-12 2019-02-15 郑州云海信息技术有限公司 A task scheduling method, system and related device of a Linux system

Also Published As

Publication number Publication date
CN116302945A (en) 2023-06-23

Similar Documents

Publication Publication Date Title
US8522176B2 (en) Method of recording and replaying call frames for the testbench
KR100921514B1 (en) A Software Development Apparatus for Providing Performance Prediction and A method thereof
CN110825618A (en) Method and related device for generating test case
US6856951B2 (en) Repartitioning performance estimation in a hardware-software system
CN111679984A (en) Performance analysis method and device
CN106529304B (en) An Android application concurrency vulnerability detection system
CN109542444B (en) JAVA application monitoring method, device, server and storage medium
US10241957B2 (en) Workload patterns for realistic load recreation in performance testing
CN113806231B (en) Code coverage rate analysis method, device, equipment and medium
CN102385511B (en) Across the visualization that the motion time of dynamic boundary is analysed
CN117195568B (en) Simulation engine performance analysis method and device based on discrete event
CN116302945B (en) Test method for measuring real-time performance of Linux system
CN109101414B (en) Massive UI test generation method and device based on buried point data
CN114238048A (en) Automatic testing method and system for Web front-end performance
CN116701164B (en) Test method and electronic equipment
CN112416727B (en) Batch processing job verification method, device, equipment and medium
US20040054515A1 (en) Methods and systems for modeling the performance of a processor
CN113886351A (en) Task operation instruction mapping model training data generation method, system, device and storage medium
CN119149358B (en) A GPU driver performance analysis method
CN120596393B (en) Statistical method and system for delta patch code coverage rate based on browser test
Schulz et al. The MPI Tool Interfaces: Past, Present, and Future—Capabilities and Prospects
CN118445214B (en) Code file modification-based method, device, equipment, medium and product for obtaining measurement
Singhal et al. Profiling minisat based on user defined execution time--GPROF
CN111143221A (en) Test method and device
Eskenazi et al. Analysis and prediction of performance for evolving architectures

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant