CN111367745A - Memory stress testing method, system and related components without operating system support - Google Patents
Memory stress testing method, system and related components without operating system support Download PDFInfo
- Publication number
- CN111367745A CN111367745A CN202010177019.9A CN202010177019A CN111367745A CN 111367745 A CN111367745 A CN 111367745A CN 202010177019 A CN202010177019 A CN 202010177019A CN 111367745 A CN111367745 A CN 111367745A
- Authority
- CN
- China
- Prior art keywords
- memory
- memory stress
- stress testing
- tool
- boot
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/073—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2247—Verification or detection of system hardware configuration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
本发明公开了一种无操作系统支持的内存压力测试方法,包括:在待测试的主机的非系统盘中安装预设的内存压力测试工具;在主机重启并且BIOS读取了系统盘的MBR引导之后,编译出内存压力测试工具的引导项;基于内存压力测试工具的引导项运行内存压力测试工具,进行内存压力测试。应用本申请的方案,有利于降低内存压力测试时对系统盘的占用时间,为工作人员的开发进程提供了便利。本申请还提供了一种无操作系统支持的内存压力测试系统及相关组件,具有相应技术效果。
The invention discloses a memory pressure testing method without operating system support, comprising: installing a preset memory pressure testing tool in a non-system disk of a host to be tested; restarting the host and reading the MBR boot of the system disk by BIOS After that, compile the boot item of the memory stress test tool; run the memory stress test tool based on the boot item of the memory stress test tool to perform the memory stress test. The application of the solution of the present application is beneficial to reduce the occupation time of the system disk during the memory pressure test, and provides convenience for the development process of the staff. The present application also provides a memory stress testing system without operating system support and related components, which have corresponding technical effects.
Description
技术领域technical field
本发明涉及计算机技术领域,特别是涉及一种无操作系统支持的内存压力测试方法、系统及相关组件。The present invention relates to the technical field of computers, in particular to a memory stress testing method, system and related components without the support of an operating system.
背景技术Background technique
随着科学技术的快速发展,人工智能、物联网等技术在人们的生活中越来越普遍。大数据的应用需要高端服务器来支持。内存是服务器的重要部件,处理器的运算数据和外部存储器交换的数据都暂存在内存中,因此,内存的压力测试是服务器稳定性的重要测试指标之一。With the rapid development of science and technology, artificial intelligence, Internet of Things and other technologies are becoming more and more common in people's lives. The application of big data requires high-end servers to support. The memory is an important part of the server. The operation data of the processor and the data exchanged by the external memory are temporarily stored in the memory. Therefore, the stress test of the memory is one of the important test indicators for the stability of the server.
目前,在进行内存的压力测试时,通常是在Linux系统下运行内存测试工具,例如在Linux系统下运行的memtester工具,stressapptest工具等。以memtester工具为例,目前的内存压力测试方案是先在Linux系统下的系统盘中安装memtester工具,然后进行编译、安装和运行。具体的,安装了memtester工具之后,BIOS(Basic Input Output System,基本输入输出系统)会进行自我检查并根据BIOS的设置取得第一启动设备,从而读取第一启动设备的MBR(Master Boot Record,主引导记录)的引导。然后加载OS(Operating System,操作系统),具体包括加载内核kernel,再调用init进程,取得运行级别信息,之后执行rc.sysinit文件,启动内核中的各个服务,最后是执行/etc/rc.d/rc.local文件。OS加载完毕之后,通过OS运行memtester工具,进行内存的压力测试,例如通常会进行48小时的内存压力测试。At present, when performing memory stress testing, memory testing tools are usually run under the Linux system, such as the memtester tool and the stressapptest tool running under the Linux system. Taking the memtester tool as an example, the current memory stress testing solution is to first install the memtester tool in the system disk under the Linux system, and then compile, install, and run it. Specifically, after the memtester tool is installed, the BIOS (Basic Input Output System) will perform self-check and obtain the first boot device according to the BIOS settings, thereby reading the MBR (Master Boot Record, MBR) of the first boot device. Master Boot Record). Then load the OS (Operating System, operating system), including loading the kernel kernel, then call the init process to obtain the run level information, then execute the rc.sysinit file, start various services in the kernel, and finally execute /etc/rc.d /rc.local file. After the OS is loaded, run the memtester tool through the OS to perform a memory stress test. For example, a 48-hour memory stress test is usually performed.
而在进行内存压力测试的整个过程中,例如前文描述中进行48小时的内存压力测试,由于是通过OS运行memtester工具进行测试,因此系统盘无法被拿走用于其他用途。但是在服务器开发的场合下,经常会出现工作人员需要拿走系统盘进行其他项目用途的情况,内存压力测试对系统盘的长时间占用导致开发效率降低。During the whole process of the memory stress test, such as the 48-hour memory stress test described above, since the test is performed by running the memtester tool through the OS, the system disk cannot be taken away for other purposes. However, in the case of server development, there are often cases where staff need to take away the system disk for other project purposes. The long-term occupation of the system disk by the memory stress test reduces development efficiency.
综上所述,如何有效地降低内存压力测试时对系统盘的占用时间,是目前本领域技术人员急需解决的技术问题。To sum up, how to effectively reduce the occupation time of the system disk during the memory stress test is a technical problem that those skilled in the art urgently need to solve.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种无操作系统支持的内存压力测试方法、系统及相关组件,以有效地降低内存压力测试时对系统盘的占用时间。The purpose of the present invention is to provide a memory stress test method, system and related components without the support of an operating system, so as to effectively reduce the occupation time of the system disk during the memory stress test.
为解决上述技术问题,本发明提供如下技术方案:In order to solve the above-mentioned technical problems, the present invention provides the following technical solutions:
一种无操作系统支持的内存压力测试方法,包括:A memory stress testing method without OS support, including:
在待测试的主机的非系统盘中安装预设的内存压力测试工具;Install the preset memory stress test tool in the non-system disk of the host to be tested;
在所述主机重启并且BIOS读取了系统盘的MBR引导之后,编译出所述内存压力测试工具的引导项;After the host restarts and the BIOS reads the MBR boot of the system disk, compile the boot item of the memory stress test tool;
基于所述内存压力测试工具的引导项运行所述内存压力测试工具,进行内存压力测试。Run the memory stress testing tool based on the boot item of the memory stress testing tool to perform memory stress testing.
优选的,还包括:Preferably, it also includes:
接收内存压力测试项目调整指令,并根据所述内存压力测试项目调整指令对所述内存压力测试工具中的测试项进行调整。Receive a memory stress test item adjustment instruction, and adjust the test items in the memory stress test tool according to the memory stress test item adjustment instruction.
优选的,在所述主机重启并且BIOS读取了系统盘的MBR引导之后,在编译出所述内存压力测试工具的引导项之前,还包括:Preferably, after the host restarts and the BIOS reads the MBR boot of the system disk, before compiling the boot items of the memory stress test tool, the method further includes:
当判断出所述主机的kernel版本与所述内存压力测试工具生成的kernel版本不一致时,退出内存压力测试流程并输出第一提示信息。When it is determined that the kernel version of the host is inconsistent with the kernel version generated by the memory stress testing tool, exit the memory stress testing process and output the first prompt message.
优选的,在所述主机重启并且BIOS读取了系统盘的MBR引导之后,在编译出所述内存压力测试工具的引导项之前,还包括:Preferably, after the host restarts and the BIOS reads the MBR boot of the system disk, before compiling the boot items of the memory stress test tool, the method further includes:
当判断出所述主机的initrd文件与所述内存压力测试工具生成的initrd文件不一致时,退出内存压力测试流程并输出第二提示信息。When it is determined that the initrd file of the host is inconsistent with the initrd file generated by the memory pressure test tool, the memory pressure test process is exited and second prompt information is output.
优选的,在判断出所述主机的kernel版本与所述内存压力测试工具生成的kernel版本一致,并且判断出所述主机的initrd文件与所述内存压力测试工具生成的initrd文件一致之后,在编译出所述内存压力测试工具的引导项之前,还包括:Preferably, after judging that the kernel version of the host is consistent with the kernel version generated by the memory stress testing tool, and judging that the initrd file of the host is consistent with the initrd file generated by the memory stress testing tool, compile Before showing the boot items of the memory stress test tool, it also includes:
判断所述主机的GRUB配置文件是否与所述内存压力测试工具生成的GRUB配置文件一致,并判断所述主机的LILO配置文件是否与所述内存压力测试工具生成的LILO配置文件一致;Determine whether the GRUB configuration file of the host is consistent with the GRUB configuration file generated by the memory stress testing tool, and determine whether the LILO configuration file of the host is consistent with the LILO configuration file generated by the memory stress testing tool;
如果两项均一致,则编译出所述内存压力测试工具的引导项;If the two items are consistent, compile the boot item of the memory stress testing tool;
如果两项中至少有一项不一致,则退出内存压力测试流程并输出第三提示信息。If at least one of the two items is inconsistent, exit the memory stress test process and output a third prompt message.
优选的,所述内存压力测试工具为memtest86+。Preferably, the memory stress testing tool is memtest86+.
一种无操作系统支持的内存压力测试系统,包括:A memory stress testing system without operating system support, including:
内存压力测试工具安装单元,用于在待测试的主机的非系统盘中安装预设的内存压力测试工具;A memory stress testing tool installation unit, used to install a preset memory stress testing tool in the non-system disk of the host to be tested;
引导项编译单元,用于在所述主机重启并且BIOS读取了系统盘的MBR引导之后,编译出所述内存压力测试工具的引导项;A boot item compiling unit, configured to compile a boot item of the memory stress test tool after the host restarts and the BIOS reads the MBR boot of the system disk;
内存压力测试执行单元,用于基于所述内存压力测试工具的引导项运行所述内存压力测试工具,进行内存压力测试。A memory stress test execution unit, configured to run the memory stress test tool based on the boot item of the memory stress test tool to perform a memory stress test.
优选的,还包括:Preferably, it also includes:
测试项调整单元,用于接收内存压力测试项目调整指令,并根据所述内存压力测试项目调整指令对所述内存压力测试工具中的测试项进行调整。The test item adjustment unit is configured to receive a memory stress test item adjustment instruction, and adjust the test items in the memory stress test tool according to the memory stress test item adjustment instruction.
一种无操作系统支持的内存压力测试装置,包括:A memory stress testing device without operating system support, comprising:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行所述计算机程序以实现上述任一项所述的无操作系统支持的内存压力测试方法的步骤。The processor is configured to execute the computer program to implement the steps of any one of the foregoing memory stress testing methods without operating system support.
一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的无操作系统支持的内存压力测试方法的步骤。A computer-readable storage medium stores a computer program on the computer-readable storage medium, and when the computer program is executed by a processor, implements the steps of any one of the foregoing memory stress testing methods without operating system support.
应用本发明实施例所提供的技术方案,可以直接在硬盘上运行内存压力测试工具,即实现了无操作系统支持的内存压力测试。具体的,本申请将内存压力测试工具安装在待测试的主机的非系统盘中,使得后续利用内存压力测试工具进行内存压力测试时,拿走系统盘并不影响内存压力测试工具的运行。同时,本申请需要使得内存压力测试工具无需基于操作系统运行,具体方式是在主机重启并且BIOS读取了系统盘的MBR引导之后,编译出内存压力测试工具的引导项,使得本申请的方案在运行内存压力测试工具时,是基于编译出的内存压力测试工具的引导项运行,而无需基于操作系统运行,因此本申请可以直接在硬盘上运行内存压力测试工具。而由于本申请是直接在硬盘上运行内存压力测试工具,无需操作系统的支持,因此在进行内存压力测试时,系统盘可以被拿走用于其他项目用途,即本申请的方案有利于降低内存压力测试时对系统盘的占用时间,为工作人员的开发进程提供了便利。By applying the technical solutions provided by the embodiments of the present invention, the memory pressure test tool can be directly run on the hard disk, that is, the memory pressure test without the support of the operating system is realized. Specifically, the present application installs the memory stress testing tool in the non-system disk of the host to be tested, so that when the memory stress testing tool is subsequently used for memory stress testing, removing the system disk does not affect the operation of the memory stress testing tool. At the same time, the present application needs to make the memory stress test tool not need to run based on the operating system. The specific method is to compile the boot item of the memory stress test tool after the host restarts and the BIOS reads the MBR boot of the system disk, so that the solution of the present application is When running the memory pressure test tool, it is run based on the compiled boot items of the memory pressure test tool, and does not need to be run based on the operating system, so the application can directly run the memory pressure test tool on the hard disk. Since the application directly runs the memory stress test tool on the hard disk without the support of the operating system, the system disk can be taken away for other project purposes during the memory stress test, that is, the solution of the application is conducive to reducing memory The time occupied by the system disk during the stress test provides convenience for the development process of the staff.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
图1为本发明中一种无操作系统支持的内存压力测试方法的实施流程图;Fig. 1 is the implementation flow chart of a kind of memory stress testing method without operating system support in the present invention;
图2为本发明中一种无操作系统支持的内存压力测试系统的结构示意图;2 is a schematic structural diagram of a memory stress testing system without operating system support in the present invention;
图3为本发明中一种无操作系统支持的内存压力测试设备的结构示意图。FIG. 3 is a schematic structural diagram of a memory stress testing device without operating system support in the present invention.
具体实施方式Detailed ways
本发明的核心是提供一种无操作系统支持的内存压力测试方法,有利于降低内存压力测试时对系统盘的占用时间,为工作人员的开发进程提供了便利。The core of the present invention is to provide a memory pressure testing method without the support of an operating system, which is beneficial to reduce the occupation time of the system disk during the memory pressure testing, and provides convenience for the development process of the staff.
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make those skilled in the art better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
请参考图1,图1为本发明中一种无操作系统支持的内存压力测试方法的实施流程图,该无操作系统支持的内存压力测试方法可以包括以下步骤:Please refer to FIG. 1. FIG. 1 is an implementation flow chart of a memory stress testing method without operating system support in the present invention. The memory stress testing method without operating system support may include the following steps:
步骤S101:在待测试的主机的非系统盘中安装预设的内存压力测试工具。Step S101: Install a preset memory stress testing tool in a non-system disk of the host to be tested.
具体的,通常可以在Linux系统下安装内存压力测试工具,内存压力测试工具的具体类型可以根据实际需要进行设定和调整,例如在本发明的一种具体实施方式中,内存压力测试工具可以选取为较为广泛地应用,功能较为完备的memtest86+。Specifically, a memory pressure test tool can usually be installed under the Linux system, and the specific type of the memory pressure test tool can be set and adjusted according to actual needs. For example, in a specific embodiment of the present invention, the memory pressure test tool can be selected For more extensive application, memtest86+ with more complete functions.
当然,除了在Linux系统下安装内存压力测试工具,也可以在其他的系统下进行安装,例如可以在RHEL系统的Legacy模式下安装memtest86+。并且需要强调的是,本申请描述的无操作系统支持的内存压力测试方法,指的是步骤S103中具体执行内存压力测试时,内存压力测试工具可以无需操作系统的支持而直接在硬盘上运行,而在步骤S101中描述的安装内存压力测试工具时,还是需要用到系统盘的。Of course, in addition to installing the memory stress test tool under the Linux system, you can also install it under other systems. For example, you can install memtest86+ in the Legacy mode of the RHEL system. And it should be emphasized that the memory stress testing method without operating system support described in this application refers to that when the memory stress testing is specifically performed in step S103, the memory stress testing tool can run directly on the hard disk without the support of the operating system, However, when installing the memory pressure test tool described in step S101, the system disk still needs to be used.
并且可以理解的是,由于本申请的方案需要支持步骤S103中的在进行内存压力测试时,系统盘可以被拿走用于其他项目用途,因此,在安装内存压力测试工具时,需要安装在待测试的主机的非系统盘中。And it can be understood that, since the solution of the present application needs to support the memory pressure test in step S103, the system disk can be taken away for other project purposes. In the non-system disk of the host being tested.
步骤S102:在主机重启并且BIOS读取了系统盘的MBR引导之后,编译出内存压力测试工具的引导项。Step S102: After the host restarts and the BIOS reads the MBR boot of the system disk, compiles the boot item of the memory stress test tool.
在待测试的主机的非系统盘中安装了内存压力测试工具之后,便需要重启主机。主机在重启之后,BIOS通常会进行自我检查,并且根据BIOS自身的设置取得第一启动设备,第一启动设备通常默认是系统盘。取得了系统盘之后,BIOS便会读取系统盘的MBR的引导。After the memory stress test tool is installed in the non-system disk of the host to be tested, the host needs to be restarted. After the host is restarted, the BIOS usually performs a self-check, and obtains the first boot device according to the settings of the BIOS itself, and the first boot device is usually a system disk by default. After obtaining the system disk, the BIOS will read the MBR of the system disk to boot.
在传统的方案中,BIOS读取了系统盘的MBR的引导之后,便会执行后续的OS的启动流程,本申请的方案中,则是编译出内存压力测试工具的引导项,使得内存压力测试工具可以直接在硬盘上运行。In the traditional solution, after the BIOS reads the boot of the MBR of the system disk, it will execute the subsequent OS startup process. In the solution of the present application, the boot item of the memory stress test tool is compiled, so that the memory stress test Tools can be run directly on the hard drive.
进一步的,为了确定内存压力测试工具是否安装正确,还可以在主机重启并且BIOS读取了系统盘的MBR引导之后,在编译出内存压力测试工具的引导项之前,对kernel版本进行判断。Further, in order to determine whether the memory stress test tool is installed correctly, the kernel version can also be judged after the host restarts and the BIOS reads the MBR boot of the system disk, and before compiling the boot item of the memory stress test tool.
具体的,当判断出主机的kernel版本与内存压力测试工具生成的kernel版本不一致时,说明内存压力测试工具可能安装得不正确,本申请的该种实施方式便会退出内存压力测试流程并输出第一提示信息,使得工作人员及时发现该异常情况。Specifically, when it is judged that the kernel version of the host is inconsistent with the kernel version generated by the memory stress test tool, it means that the memory stress test tool may be installed incorrectly, and this implementation of the present application will exit the memory stress test process and output the first A prompt message enables the staff to detect the abnormal situation in time.
此外,除了判断kernel版本,在本发明的另一种实施方式中,还对initrd文件进行判断,即在主机重启并且BIOS读取了系统盘的MBR引导之后,在编译出内存压力测试工具的引导项之前,还包括:In addition, in addition to judging the kernel version, in another embodiment of the present invention, the initrd file is also judged, that is, after the host restarts and the BIOS reads the MBR boot of the system disk, the boot of the memory stress test tool is compiled. Before items, also include:
当判断出主机的initrd文件与内存压力测试工具生成的initrd文件不一致时,退出内存压力测试流程并输出第二提示信息。When it is determined that the initrd file of the host is inconsistent with the initrd file generated by the memory stress test tool, the process of memory stress test is exited and a second prompt message is output.
第一提示信息和第二提示信息的具体内容和形式均可以根据需要进行设定和调整,并且,在实际应用中,对kernel版本的判断以及对initrd文件的判断的先后顺序可以根据需要进行设定和调整,还可以是同时执行。例如下述代码所公开的实施例中,便是基于内存压力测试工具中的bootprefix程序,同时对kernel版本以及对initrd文件进行正误判断,kernel版本或者initrd文件出错时,都会终止本申请的内存压力测试的流程。The specific content and form of the first prompt information and the second prompt information can be set and adjusted as required, and, in practical applications, the judgment of the kernel version and the order of judgment of the initrd file can be set as required. The setting and adjustment can also be performed at the same time. For example, in the embodiment disclosed in the following code, it is based on the bootprefix program in the memory pressure test tool, and at the same time, the kernel version and the initrd file are judged right and wrong. When the kernel version or the initrd file is wrong, the memory pressure of the application will be terminated. testing process.
进一步地,在本发明的一种具体实施方式中,考虑到GRUB(GRand UnifiedBootloader,大一统启动加载器)配置文件以及LILO(Linux Loader,一种Linux引导程序)配置文件也是内存压力测试工具运行时所需要的重要文件,因此,为了保障后续能够正确地执行内存压力测试,该种实施方式中,在判断出主机的kernel版本与内存压力测试工具生成的kernel版本一致,并且判断出主机的initrd文件与内存压力测试工具生成的initrd文件一致之后,在编译出内存压力测试工具的引导项之前,还对GRUB配置文件以及LILO配置文件进行正误判断。具体地:Further, in a specific embodiment of the present invention, it is considered that the GRUB (GRand Unified Bootloader) configuration file and the LILO (Linux Loader, a Linux bootloader) configuration file are also the runtime of the memory stress test tool. Therefore, in order to ensure that the memory stress test can be performed correctly in the future, in this implementation, it is determined that the kernel version of the host is consistent with the kernel version generated by the memory stress test tool, and the initrd file of the host is determined. After it is consistent with the initrd file generated by the memory stress test tool, before compiling the boot items of the memory stress test tool, the GRUB configuration file and the LILO configuration file are also judged right or wrong. specifically:
判断主机的GRUB配置文件是否与内存压力测试工具生成的GRUB配置文件一致,并判断主机的LILO配置文件是否与内存压力测试工具生成的LILO配置文件一致;Determine whether the GRUB configuration file of the host is consistent with the GRUB configuration file generated by the memory stress test tool, and determine whether the LILO configuration file of the host is consistent with the LILO configuration file generated by the memory stress test tool;
如果两项均一致,即当判断出主机的GRUB配置文件与内存压力测试工具生成的GRUB配置文件一致,并且判断出主机的LILO配置文件与内存压力测试工具生成的LILO配置文件一致时,便可以执行后续的编译出内存压力测试工具的引导项的操作。If the two items are consistent, that is, when it is determined that the GRUB configuration file of the host is consistent with the GRUB configuration file generated by the memory stress test tool, and the LILO configuration file of the host is determined to be consistent with the LILO configuration file generated by the memory stress test tool, you can Perform subsequent operations of compiling the boot items of the memory stress test tool.
相应的,如果两项中至少有一项不一致,则退出内存压力测试流程并输出第三提示信息。Correspondingly, if at least one of the two items is inconsistent, exit the memory stress test process and output a third prompt message.
在一种具体实施方式中,对GRUB配置文件以及LILO配置文件进行正误判断的代码可以如下:In a specific implementation manner, the code for judging right and wrong for the GRUB configuration file and the LILO configuration file may be as follows:
在具体实施时,通常会在确定了kernel版本,initrd文件,GRUB配置文件以及LILO配置文件均无误之后,编译出内存压力测试工具的引导项。例如内存压力测试工具为memtest86+时,编译出内存压力测试工具的引导项可以具体为:编译initrd文件生成引导项memtest86+grub。During specific implementation, the boot entry of the memory stress test tool is usually compiled after the kernel version, initrd file, GRUB configuration file, and LILO configuration file are all correct. For example, when the memory stress test tool is memtest86+, the boot item for compiling the memory stress test tool can be specifically: compile the initrd file to generate the boot item memtest86+grub.
一种具体实施例中的代码可以表示为:The code in a specific embodiment can be expressed as:
步骤S103:基于内存压力测试工具的引导项运行内存压力测试工具,进行内存压力测试。Step S103: Run the memory stress testing tool based on the boot item of the memory stress testing tool to perform the memory stress test.
由于编译出了内存压力测试工具的引导项,因此,无需操作系统的支持,可以直接基于内存压力测试工具的引导项运行内存压力测试工具,进行内存压力测试,即可以直接在硬盘上运行内存压力测试工具。Since the boot item of the memory stress test tool is compiled, without the support of the operating system, the memory stress test tool can be run directly based on the boot item of the memory stress test tool to perform the memory stress test, that is, the memory stress can be directly run on the hard disk test tools.
内存压力测试工具在进行内存压力测试时,通常是基于读取内存,写入内存的方式进行测试。当然,具体的测试项目可以参照传统的内存压力测试的项目,并且,也可以根据需要进行测试项的调整,即在本发明的一种具体实施方式中,还可以包括:When a memory stress test tool performs a memory stress test, it is usually based on the way of reading memory and writing memory. Of course, the specific test items can refer to the traditional memory pressure test items, and the test items can also be adjusted as needed, that is, in a specific implementation of the present invention, it can also include:
接收内存压力测试项目调整指令,并根据内存压力测试项目调整指令对内存压力测试工具中的测试项进行调整。Receive the memory stress test item adjustment instruction, and adjust the test items in the memory stress test tool according to the memory stress test item adjustment instruction.
通过对内存压力测试工具中的测试项进行调整,有利于提高进行内存压力测试的灵活性。By adjusting the test items in the memory stress testing tool, it is beneficial to improve the flexibility of memory stress testing.
应用本发明实施例所提供的技术方案,可以直接在硬盘上运行内存压力测试工具,即实现了无操作系统支持的内存压力测试。具体的,本申请将内存压力测试工具安装在待测试的主机的非系统盘中,使得后续利用内存压力测试工具进行内存压力测试时,拿走系统盘并不影响内存压力测试工具的运行。同时,本申请需要使得内存压力测试工具无需基于操作系统运行,具体方式是在主机重启并且BIOS读取了系统盘的MBR引导之后,编译出内存压力测试工具的引导项,使得本申请的方案在运行内存压力测试工具时,是基于编译出的内存压力测试工具的引导项运行,而无需基于操作系统运行,因此本申请可以直接在硬盘上运行内存压力测试工具。而由于本申请是直接在硬盘上运行内存压力测试工具,无需操作系统的支持,因此在进行内存压力测试时,系统盘可以被拿走用于其他项目用途,即本申请的方案有利于降低内存压力测试时对系统盘的占用时间,为工作人员的开发进程提供了便利。By applying the technical solutions provided by the embodiments of the present invention, the memory pressure test tool can be directly run on the hard disk, that is, the memory pressure test without the support of the operating system is realized. Specifically, the present application installs the memory stress testing tool in the non-system disk of the host to be tested, so that when the memory stress testing tool is subsequently used for memory stress testing, removing the system disk does not affect the operation of the memory stress testing tool. At the same time, the present application needs to make the memory stress test tool not need to run based on the operating system. The specific method is to compile the boot item of the memory stress test tool after the host restarts and the BIOS reads the MBR boot of the system disk, so that the solution of the present application is When running the memory pressure test tool, it is run based on the compiled boot items of the memory pressure test tool, and does not need to be run based on the operating system, so the application can directly run the memory pressure test tool on the hard disk. Since the application directly runs the memory stress test tool on the hard disk without the support of the operating system, the system disk can be taken away for other project purposes during the memory stress test, that is, the solution of the application is conducive to reducing memory The time occupied by the system disk during the stress test provides convenience for the development process of the staff.
相应于上面的方法实施例,本发明实施例还提供了一种无操作系统支持的内存压力测试系统,可与上文相互对应参照。Corresponding to the above method embodiments, the embodiments of the present invention further provide a memory stress testing system without the support of an operating system, which can be cross-referenced with the above.
参见图2所示,为本发明中一种无操作系统支持的内存压力测试系统的结构示意图,包括:Referring to FIG. 2, it is a schematic structural diagram of a memory stress testing system without operating system support in the present invention, including:
内存压力测试工具安装单元201,用于在待测试的主机的非系统盘中安装预设的内存压力测试工具;A memory stress testing
引导项编译单元202,用于在主机重启并且BIOS读取了系统盘的MBR引导之后,编译出内存压力测试工具的引导项;The boot
内存压力测试执行单元203,用于基于内存压力测试工具的引导项运行内存压力测试工具,进行内存压力测试。The memory stress
在本发明的一种具体实施方式中,还包括:In a specific embodiment of the present invention, it also includes:
测试项调整单元,用于接收内存压力测试项目调整指令,并根据内存压力测试项目调整指令对内存压力测试工具中的测试项进行调整。The test item adjustment unit is used to receive the memory stress test item adjustment instruction, and adjust the test items in the memory stress test tool according to the memory stress test item adjustment instruction.
在本发明的一种具体实施方式中,在主机重启并且BIOS读取了系统盘的MBR引导之后,在引导项编译单元202编译出内存压力测试工具的引导项之前,还包括:In a specific embodiment of the present invention, after the host restarts and the BIOS reads the MBR boot of the system disk, before the boot
第一判断单元,用于当判断出主机的kernel版本与内存压力测试工具生成的kernel版本不一致时,退出内存压力测试流程并输出第一提示信息。The first judgment unit is configured to exit the memory pressure test process and output first prompt information when it is judged that the kernel version of the host is inconsistent with the kernel version generated by the memory pressure test tool.
在本发明的一种具体实施方式中,在主机重启并且BIOS读取了系统盘的MBR引导之后,在引导项编译单元202编译出内存压力测试工具的引导项之前,还包括:In a specific embodiment of the present invention, after the host restarts and the BIOS reads the MBR boot of the system disk, before the boot
第二判断单元,用于当判断出主机的initrd文件与内存压力测试工具生成的initrd文件不一致时,退出内存压力测试流程并输出第二提示信息。The second judgment unit is configured to exit the memory pressure test process and output the second prompt information when it is judged that the initrd file of the host is inconsistent with the initrd file generated by the memory pressure test tool.
在本发明的一种具体实施方式中,在第一判断单元判断出主机的kernel版本与内存压力测试工具生成的kernel版本一致,并且第二判断单元判断出主机的initrd文件与内存压力测试工具生成的initrd文件一致之后,在引导项编译单元202编译出内存压力测试工具的引导项之前,还包括:In a specific embodiment of the present invention, the first judging unit judges that the kernel version of the host is consistent with the kernel version generated by the memory stress testing tool, and the second judging unit judges that the initrd file of the host is generated by the memory stress testing tool After the initrd files are consistent, before the boot
第三判断单元,用于判断主机的GRUB配置文件是否与内存压力测试工具生成的GRUB配置文件一致,并判断主机的LILO配置文件是否与内存压力测试工具生成的LILO配置文件一致;The third judgment unit is used to judge whether the GRUB configuration file of the host is consistent with the GRUB configuration file generated by the memory stress test tool, and to judge whether the LILO configuration file of the host is consistent with the LILO configuration file generated by the memory stress test tool;
如果两项均一致,则触发引导项编译单元202,编译出内存压力测试工具的引导项;If the two items are consistent, trigger the boot
如果两项中至少有一项不一致,则退出内存压力测试流程并输出第三提示信息。If at least one of the two items is inconsistent, exit the memory stress test process and output a third prompt message.
在本发明的一种具体实施方式中,内存压力测试工具为memtest86+。In a specific embodiment of the present invention, the memory stress testing tool is memtest86+.
相应于上面的方法和系统实施例,本发明实施例还提供了一种无操作系统支持的内存压力测试装置以及一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述任一实施例中的无操作系统支持的内存压力测试方法的步骤。这里所说的计算机可读存储介质包括随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质。Corresponding to the above method and system embodiments, embodiments of the present invention further provide a memory stress testing device without operating system support and a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and a computer When the program is executed by the processor, the steps of the memory stress testing method without operating system support in any of the foregoing embodiments are implemented. The computer-readable storage medium mentioned here includes random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, Or any other form of storage medium known in the technical field.
该无操作系统支持的内存压力测试装置可以包括:The memory stress testing device without operating system support may include:
存储器301,用于存储计算机程序;a
处理器302,用于执行计算机程序以实现上述任一实施例中的无操作系统支持的内存压力测试方法的步骤。The
还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply those entities or operations There is no such actual relationship or order between them. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article, or device that includes the element.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的技术方案及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of functionality. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention. The principles and implementations of the present invention are described herein by using specific examples, and the descriptions of the above embodiments are only used to help understand the technical solutions and core ideas of the present invention. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, several improvements and modifications can also be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010177019.9A CN111367745B (en) | 2020-03-13 | 2020-03-13 | Memory pressure testing method and system without support of operating system and related components |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010177019.9A CN111367745B (en) | 2020-03-13 | 2020-03-13 | Memory pressure testing method and system without support of operating system and related components |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111367745A true CN111367745A (en) | 2020-07-03 |
| CN111367745B CN111367745B (en) | 2022-08-02 |
Family
ID=71207327
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010177019.9A Active CN111367745B (en) | 2020-03-13 | 2020-03-13 | Memory pressure testing method and system without support of operating system and related components |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111367745B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111949529A (en) * | 2020-08-06 | 2020-11-17 | 曙光信息产业(北京)有限公司 | System debugging method and device, computer equipment and storage medium |
| CN113468009A (en) * | 2021-07-21 | 2021-10-01 | 宁畅信息产业(北京)有限公司 | Pressure testing method and device, electronic equipment and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090113249A1 (en) * | 2007-10-24 | 2009-04-30 | Inventec Corporation | Stress testing method of file system |
| CN103309706A (en) * | 2013-05-24 | 2013-09-18 | 中标软件有限公司 | Memory file system preparation method and unit based on Linux operation system |
| CN110491440A (en) * | 2019-07-02 | 2019-11-22 | 深圳市金泰克半导体有限公司 | A kind of internal storage testing method and system |
-
2020
- 2020-03-13 CN CN202010177019.9A patent/CN111367745B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20090113249A1 (en) * | 2007-10-24 | 2009-04-30 | Inventec Corporation | Stress testing method of file system |
| CN103309706A (en) * | 2013-05-24 | 2013-09-18 | 中标软件有限公司 | Memory file system preparation method and unit based on Linux operation system |
| CN110491440A (en) * | 2019-07-02 | 2019-11-22 | 深圳市金泰克半导体有限公司 | A kind of internal storage testing method and system |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111949529A (en) * | 2020-08-06 | 2020-11-17 | 曙光信息产业(北京)有限公司 | System debugging method and device, computer equipment and storage medium |
| CN111949529B (en) * | 2020-08-06 | 2024-03-22 | 曙光信息产业(北京)有限公司 | System debugging method, device, computer equipment and storage medium |
| CN113468009A (en) * | 2021-07-21 | 2021-10-01 | 宁畅信息产业(北京)有限公司 | Pressure testing method and device, electronic equipment and storage medium |
| CN113468009B (en) * | 2021-07-21 | 2024-05-24 | 宁畅信息产业(北京)有限公司 | Pressure testing method and device, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111367745B (en) | 2022-08-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN1163824C (en) | Quick start device and method | |
| US7107588B2 (en) | System and method for installing window installer service without rebooting | |
| CN113377586B (en) | Automatic detection method and device for server and storage medium | |
| CN101763277A (en) | Method for automatically installing operating system | |
| CN107766084B (en) | Boot loading and installation method and computing system thereof | |
| CN111475175B (en) | Operating system installation and booting method, device and medium based on ARM server | |
| CN110780942A (en) | System starting method and device, node equipment and computer readable storage medium | |
| JP7454011B2 (en) | Firmware publishing method for multiple binary images and electronic devices | |
| CN111367745B (en) | Memory pressure testing method and system without support of operating system and related components | |
| CN111880818B (en) | Installation method, system and device of virtual machine operating system | |
| CN113064646A (en) | BIOS starting method, system and related device | |
| CN111090546B (en) | Method, device and equipment for restarting operating system and readable storage medium | |
| US20040225874A1 (en) | Method for reduced BIOS boot time | |
| CN114756290B (en) | Operating system installation method, device and readable storage medium | |
| CN103106086B (en) | Operating system disposal route and system | |
| US20070214345A1 (en) | System and method for porting an operating system | |
| CN110286953B (en) | Method and device for starting embedded system, embedded device and storage medium | |
| CN116700823A (en) | Operating system installation method, device, equipment and storage medium | |
| CN101276281A (en) | How to install the driver | |
| CN110908725B (en) | Application program starting method and device, electronic equipment and readable medium | |
| US20240241815A1 (en) | Method for efficiently improving test case coverage and robustness | |
| CN110825421A (en) | Firmware upgrading method and system and readable storage medium | |
| CN113646745A (en) | Disable software persistence | |
| CN116302543A (en) | Continuous integration job processing method, device, equipment and storage medium | |
| US11354109B1 (en) | Firmware updates using updated firmware files in a dedicated firmware volume |
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 | ||
| CP03 | Change of name, title or address |
Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd. Country or region after: China Address before: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Country or region before: China |