CN109542341A - A kind of read-write IO monitoring method, device, terminal and computer readable storage medium - Google Patents
A kind of read-write IO monitoring method, device, terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN109542341A CN109542341A CN201811314005.6A CN201811314005A CN109542341A CN 109542341 A CN109542341 A CN 109542341A CN 201811314005 A CN201811314005 A CN 201811314005A CN 109542341 A CN109542341 A CN 109542341A
- Authority
- CN
- China
- Prior art keywords
- read
- information
- write operation
- write
- operation information
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0653—Monitoring storage devices or systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
- G06F3/0676—Magnetic disk device
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present embodiments relate to Internet technical field, a kind of read-write IO monitoring method, device, terminal and computer readable storage medium are disclosed.In the section Example of the application, read-write IO monitoring method includes: to monitor read-write operation by interior nuclear probe;After monitoring result instruction is written and read disk there are process, the read-write operation information of process and the information of process are determined;Wherein, read-write operation information includes the information of the file of process read-write;According to the information of process, the read-write operation information of record the process.The case where IO detection method allows users to grasp process to the operational circumstances of the file of disk, the read-write operation occurred in more macroscopical understanding disk.
Description
Technical field
The present embodiments relate to Internet technical field, in particular to a kind of read-write IO monitoring method, device, terminal and
Computer readable storage medium.
Background technique
Currently, can the tool that is monitored of read-write (Input/Output, IO) operation to system substantially have following three
Kind:
1. system read-write status command iostat
Using iostat it can be seen that the performance indexes of disk, such as: the data number of blocks of read-write per second, it is per second to write
Number, reading number, disk utilization rate, average queue length etc..These information are able to reflect out a certain piece of disk in some spy
The activity condition fixed time in section, so as to make a rough assessment according to performance of these performance indicators to disk.
2. system read-write status command block_dump
Block_dump is actually kernel switch, and after opening block_dump, kernel will will be on disk
The read-write situation of data block is fed back into journal file, which has some more deep changes compared to iostat:
It a) can be that individual (being distinguished using process number) probes into the case where IO with process;
B) performance of IO be using on some disk some data block occur write-in or read action as standard, the disk
And data block can be clearly identified.
The function is that the positioning of data exception or data block error provides a great help.If some data block is sent out
Mistake has been given birth to, by the journal file can look into, to find that the mistake is which process generates.
3. system read-write status command iotop
Iotop remains the time factor in iostat, and joined process factor, the reading from the angle of process to data
It writes into and has gone statistics, the data source of iotop is /proc/pid/io.Its advantage is that can clearly see in seconds
To the IO situation of some process, each process is read and write variation caused by disk, can be fed back in the form of rate.
It is currently which process is consuming I/O resource that user, which will be clearly understood that, to be carried out according to actual service conditions
Corresponding adjustment.
However, it is found by the inventors that at least there are the following problems in the prior art: iostat tool is capable of providing one more
Data in macroscopic aspect, still, when encountering nonmagnetic disk problem and further progress is needed to probe into, iostat tool is just
It is limited.The log content that block_dump tool generates is crossed to be detailed, as long as change will be by for some data block
It is recorded in log, when some process has modified the plurality of positions of a file, block_dump will generate a large amount of day
Will information increases difficulty for analysis IO.Iotop tool can not know the file that process is operating, when process generates largely
When IO, can not learn it is that reason causes in time.Therefore, a kind of new IO monitoring instrument is needed, so as to preferably right
IO is monitored analysis.
It should be noted that information is only used for reinforcing the reason to the background of the disclosure disclosed in above-mentioned background technology part
Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
Embodiment of the present invention is designed to provide a kind of read-write IO monitoring method, device, terminal and computer-readable
Storage medium makes it possible to as unit of file, the read-write operation information on recording disc.
In order to solve the above technical problems, embodiments of the present invention provide a kind of read-write IO monitoring method, including following
Step: read-write operation is monitored by interior nuclear probe;After monitoring result instruction is written and read disk there are process, determine
The read-write operation information of process and the information of process;Wherein, read-write operation information includes the information of the file of process read-write;According to
The information of process, the read-write operation information of record the process.
Embodiments of the present invention additionally provide a kind of read-write IO monitoring device, comprising: determining module and logging modle;Really
Cover half block is used to monitor read-write operation by interior nuclear probe;It indicates that there are processes in monitoring result to be written and read disk
Afterwards, the read-write operation information of process and the information of process are determined;Wherein, read-write operation information includes the letter of the file of process read-write
Breath;Logging modle is used for the information according to process, the read-write operation information of record the process.
Embodiments of the present invention additionally provide a kind of terminal, comprising: at least one processor;And at least one
The memory of processor communication connection;Wherein, memory is stored with the instruction that can be executed by least one processor, instructs by extremely
A few processor executes, so that at least one processor is able to carry out the read-write IO monitoring method that above embodiment refers to.
Embodiments of the present invention additionally provide a kind of computer readable storage medium, are stored with computer program, calculate
The read-write IO monitoring method that above embodiment refers to is realized when machine program is executed by processor.
Embodiment of the present invention in terms of existing technologies, when process is written and read disk, according to process
Information the information for the file that process is read and write is recorded, allow user which process determined according to the data of record
Read-write operation has been carried out to disk, which file inside disk read and write respectively, has read and write how many times for each process, so that with
Family will appreciate that process to the operational circumstances of the file of disk, the case where the read-write operation occurred in more macroscopical understanding disk.
In addition, further include the size for the data that process reads or is written hereof in read-write operation information, and/or, into
Journey access path information.In the realization, user can determine the data volume of process modification according to the information of record, and/or, process
Access path, make it possible to more fully understand process I/O operation situation.
In addition, the information of process includes the information of the subprocess of No. 1 process corresponding with process, wherein corresponding No. 1 into
The information of the subprocess of journey is determined according to the set membership between the information and process of process.In the realization, end can be reduced
Categorical measure when the statistics read-write operation information of end, facilitates the later period to merge and analyze the information of record, reduces user
The classification of reading is more convenient user and reads.
In addition, the read-write operation information of record the process specifically includes according to the information of process: according to corresponding No. 1 process
Subprocess information, the subprocess that the read-write operation information of process is recorded in corresponding No. 1 process corresponding data storage
Qu Zhong.
In addition, in the information according to process, before the read-write operation information of record the process, IO monitoring method further include: really
The sizes of the corresponding data of process is determined less than the first preset value, includes the read-write operation information of process in the corresponding data of process.
In the realization, the size of the corresponding data of the process of record is limited, the data for avoiding read-write operation from generating occupy excessive
The case where memory.
In addition, in the information according to process, after the read-write operation information of record the process, IO monitoring method further include: root
According to the read-write operation information of record, the number that process is written and read file is determined.
In addition, further including the time that process is written and read in read-write operation information;In the information according to process, record
Before the read-write operation information of process, IO monitoring method further include: determine this time for being written and read of process and record
The interval of time that is written and read of process last time be greater than the second preset value.In the realization, terminal is selectively recorded
The read-write operation information of process can effectively reduce data the space occupied size that monitoring IO is generated, read-write operation is avoided to produce
Raw data occupy the case where excessive memory.
In addition, process is written and read disk by file system.
In addition, file system is that forth generation extends file system EXT4;Read-write operation is monitored by interior nuclear probe, it is specific to wrap
It includes: monitoring the read/write function of EXT4 by interior nuclear probe, however, it is determined that the read/write function of EXT4 is called, determines that monitoring result indicates
There are processes to be written and read disk.
In addition, monitoring the read/write function of EXT4 by interior nuclear probe, specifically includes: whether judging pre-set sensing point
It is triggered;Wherein, the read/write function of EXT4: ext4_readpage, ext4_readpages and ext4_ is arranged in sensing point
On the corresponding address file_write;If it is determined that being to determine that the read/write function of EXT4 is called;Otherwise, it determines the read-write of EXT4
Function is not called upon.
Detailed description of the invention
One or more embodiments are illustrated by the picture in corresponding attached drawing, these exemplary theorys
The bright restriction not constituted to embodiment, the element in attached drawing with same reference numbers label are expressed as similar element, remove
Non- to have special statement, composition does not limit the figure in attached drawing.
Fig. 1 is the flow chart of the IO monitoring method of first embodiment of the invention;
Fig. 2 is the schematic diagram of the execution process instruction for being not inserted into interior nuclear probe of first embodiment of the invention;
Fig. 3 is the schematic diagram of the execution process instruction in the insertion of first embodiment of the invention after nuclear probe;
Fig. 4 is the set membership schematic diagram between the process of the terminal of first embodiment of the invention;
Fig. 5 is the flow chart of the IO monitoring method of second embodiment of the present invention;
Fig. 6 is the structural schematic diagram of the IO monitoring device of third embodiment of the present invention;
Fig. 7 is the structural schematic diagram of the terminal of the 4th embodiment of the invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Each embodiment be explained in detail.However, it will be understood by those skilled in the art that in each embodiment party of the present invention
In formula, in order to make the reader understand this application better, many technical details are proposed.But even if without these technical details
And various changes and modifications based on the following respective embodiments, the application technical solution claimed also may be implemented.
The first embodiment of the present invention is related to a kind of read-write IO monitoring methods, are applied to terminal, which can be electricity
The devices such as brain, mobile phone, robot.As shown in Figure 1, the IO monitoring method the following steps are included:
Step 101: read-write operation is monitored by interior nuclear probe.
Specifically, interior nuclear probe can be interior nuclear probe kprobe, be also possible to interior nuclear probe jprobe or other in
Nuclear probe, herein within for nuclear probe kprobe, the process of IO monitoring device monitoring read-write operation is illustrated, is used
The process of other interior nuclear probe monitoring read-write operations can refer to the associated description of embodiments of the present invention, and present embodiment is not
The specific means of limitation monitoring read/write function.
The general principles of kprobe are illustrated below.Kprobe can dynamically collect Debugging message and performance letter
Breath, a sensing point (function) can be initiatively arranged in user, and corresponding abnormality processing function, such as abnormality processing function is arranged
Pre_handler and abnormality processing function post_handler.When program goes to the position of sensing point, kprobe can will be visited
The function instruction of measuring point is substituted for BREAKPOINT, and original function instruction is moved on to the other positions in memory.When
When BREAKPOINT is triggered, system falls into "abnormal".Terminal executes previously positioned abnormality processing function pre_handler,
After pre_handler is finished, kprobe allows terminal to execute the original function for being originally moved to memory other positions, original function
After being finished, terminal falls into "abnormal" again, and then executes abnormality processing function post_handler.Work as post_
After handler is finished, kprobe also completes to detect, and terminal continues to execute the function after original function.For example, in being not inserted into
The schematic diagram of the execution process instruction of nuclear probe instructs as shown in Fig. 2, in the position of instruction 2 is inserted into after nuclear probe kprobe
The schematic diagram of implementation procedure is as shown in Figure 3.From the figure 3, it may be seen that originally the position of instruction 2 has been replaced by BREAKPOINT, terminal
Instruction 1 has been executed, after reaching BREAKPOINT, pre_handler, 2 and post_handler of instruction has then been executed, executes
After complete post_handler, 3 are executed instruction.
Step 102: after monitoring result instruction is written and read disk there are process, determining the read-write operation of process
The information of information and process.
Specifically, read-write operation information includes the information of the file of process read-write.It can store multiple files in disk,
It may include multiple data blocks in each file, when process operates some or certain data blocks, determine data block institute
The information of the file of category.Wherein, the file information of read-write can be the filename of the file of read-write or the other identifier letter of file
Breath, the information of process may include the process name and/or process number of process.
It should be noted that since process may operate the data block in different files, read-write operation letter
It may include the information of multiple files in breath.
It should be noted that it will be understood by those skilled in the art that can also include process in read-write operation information in text
The size for the data for reading or being written in part, and/or, the other informations such as process access path information, wherein process access path
Information refers to that the information in the path of process access file, present embodiment do not limit the class for the information for including in read-write operation information
Not with the quantity of classification.
It is noted that being used when the size for the data that terminal reads or is written hereof to process is monitored
Family can determine that the data volume of process modification, terminal supervise the information in the path of process access file according to the information of record
When survey, user will be seen that the path of process access file, make it possible to more fully understand the I/O operation situation of process.
In the specific implementation, process is written and read disk by file system.Wherein, file system can be new skill
Art file system (New Technology File System, NTFS), the second generation extend file system (Second
Extended filesystem, EXT2), the third generation extension file system (Third extended filesystem, EXT3)
Etc. any one file system in file system.
It is below to illustrate terminal for forth generation extends file system EXT4 and determine process to disk by file system
The method being written and read.
Terminal monitors the read/write function of EXT4 by interior nuclear probe kprobe, however, it is determined that and the read/write function of EXT4 is called,
Determine that monitoring result indicates that there are processes and is written and read to disk.Specifically, terminal judges pre-set sensing point
Whether it is triggered;Wherein, sensing point is arranged in the read/write function of EXT4: ext4_readpage, ext4_readpages and
On the corresponding address ext4_file_write;If it is determined that being to determine that the read/write function of EXT4 is called;Otherwise, it determines EXT4
Read/write function is not called upon.When process carries out reading and writing data to disk by EXT4, need using following three Key Functions:
Ext4_readpage, ext4_readpages and ext4_file_write are inserted into kprobe, kprobe in these positions respectively
The address of these functions can be replaced with breakpoint (BREAKPOINT).Process accesses the call by location file system of above-mentioned function
When read/write function, kprobe will be triggered, and the information and read-write operation information to process are collected.
It can be seen from the above content that the nuclear probe in the position of three Key Functions of EXT4 is inserted into, can be such that process jumps
It goes to and executes pre_handler, the instruction that terminal will acquire the information of read-write operation information and process is set to pre_handler
It is interior, the information of read-write operation information and process can be obtained when process is written and read disk.Wherein, the crucial letter of EXT4
Several positions can be obtained by configuration file.Configuration file can be Kernel Symbol Table (/proc/kallsyms).Due to opening
Originator can extract the address (position in memory) of all functions, global variable and static variable in kernel code
Kernel Symbol Table is formed, facilitates kernel code debugging process.By inquiring Kernel Symbol Table, that is, it can determine the crucial letter of EXT4
Several positions.
Step 103: according to the information of process, the read-write operation information of record the process.
Specifically, terminal records the read-write operation information of the read-write operation monitored.Wherein, terminal record is read
The mode of write operation information includes but is not limited to following four:
Mode 1: the information of process includes the process name of process and/or the process number of process.Terminal in table form, is remembered
The information and read-write operation information of record process.For example, the information of process includes the process name and process number of process, read-write operation letter
Breath includes the filename of read-write, and terminal obtains process name, the process of process after monitoring that process is written and read disk
Process number and read-write filename, above- mentioned information are filled in into table 1.
It should be noted that terminal can also otherwise by the read-write operation information of the information of process and process one by one
It is corresponding to be recorded in memory, it does not repeat one by one herein.
Table 1
The process number of process | The process name of process | The filename of read-write |
Mode 2: the information of process includes the process name of process and/or the process number of process.Terminal is the distribution of each process
One data storage area determines the read-write operation of this read-write operation after determining that some process is written and read disk
Information stores the read-write operation information into the corresponding data storage area of the process.In the specific implementation, read-write operation information can
With in table form or other forms are stored in data storage area.
Mode 3: the information of process includes the information of the subprocess of No. 1 process corresponding with process, wherein corresponding with process
No. 1 process subprocess information according between the information and process of process set membership determine.Terminal is with table
Form records the information and read-write operation information of the subprocess of No. 1 process corresponding with process.Wherein, No. 1 corresponding with process
The information of the subprocess of process may include the process name of the subprocess of No. 1 process corresponding with process, and/or, with process pair
The process number of the subprocess for No. 1 process answered.Wherein, No. 1 process refers to init process, which is that kernel starts and runs
First consumer process.
Mode 4: the information of process includes the information of the subprocess of No. 1 process corresponding with process.Terminal according to process
The read-write operation information of process is recorded in the son of No. 1 process corresponding with process by the information of the subprocess of corresponding No. 1 process
In the corresponding data storage area of process.
It should be noted that the information of process can also include the process name and/or process of process in mode 3 and mode 4
Process number, the terminal process name of record the process and/or the process number of process and read-write operation information correspondingly.
Hereinafter the process for the subprocess for determining No. 1 process corresponding with process in mode 3 and mode 4 illustrate
It is bright.It is assumed that the set membership schematic diagram between the process of terminal is as shown in Figure 4.When process 15 by file system to disk into
When row read-write operation, terminal determines that the process that this is written and read is process 15, and determines the read-write of this read-write operation
Operation information.Terminal determines that the subprocess of No. 1 process corresponding with process 15 is according to the set membership between the process of storage
Process 1.Therefore, the read-write operation information of 15 this read-write operation of process is grouped into process 1 under one's name by terminal, i.e., by this read-write
Operation information is recorded in the corresponding data storage area of process 1, or, by the process name of process 1 and/or the process number of process 1 with
This read-write operation information records in the table correspondingly.Similarly, the read-write of process 5, process 8, process 9 and process 10
Operation also will be grouped into process 1 under one's name.And the read-write operation of process 6 and process 7 will be grouped into process 4 under one's name.
It should be noted that it will be understood by those skilled in the art that the read-write operation information of process is grouped into mode 3
The merging mode under one's name of the subprocess of No. 1 process corresponding with process by way of example only, can also will be into practical application
The read-write operation information of journey is grouped into the process of other ranks under one's name.For example, merging mode is arranged are as follows: by process 8, process 9,
The read-write operation of process 10 and process 15 is grouped into process 5 under one's name, and the read-write operation of process 11 and process 12 is grouped into process 6
Under one's name, the read-write operation of process 13 and process 14 is grouped into process 7 under one's name.
It is noted that the reading writing information of process is grouped into the subprocess of No. 1 process corresponding with process under one's name, it can
Categorical measure when terminal statistics read-write operation information is reduced, facilitates the later period to merge and analyze the information of record, reduces
The classification that user reads is more convenient user and reads.
It should be noted that after the read-write operation information of record the process, terminal can be with root in the information according to process
According to the read-write operation information of record, the number that process is written and read file is determined.Specifically, terminal can according to
The demand at family and the read-write operation information of record, determine the total degree that process is written and read All Files, i.e. process pair
The sum of the total degree that each file is written and read.Terminal can also be believed with the read-write operation of record according to the demand of user
Breath, determines the number that process is written and read some file within certain time.
It should be noted that the above is only limit for example, not constituting to technical solution of the present invention.
Compared with prior art, the read-write IO monitoring method provided in present embodiment, is written and read disk in process
When operation, is recorded according to information of the information of process to the file that process is read and write, allow user according to the number of record
According to, determine which process has carried out read-write operation to disk, each process has read and write which file inside disk respectively, read-write
How many times allow users to grasp process to the operational circumstances of the file of disk, occur in more macroscopical understanding disk
The case where read-write operation.In addition to this, terminal further includes that process reads or writes hereof in the read-write operation data of record
When the size of the data entered, allows users to grasp each process and read and write how many data respectively.
Second embodiment of the present invention is related to a kind of IO monitoring method, and present embodiment is on the basis of first embodiment
On be further improved, specific improvements are as follows: before step 102, increase other correlation steps.
Specifically, as shown in figure 5, in the present embodiment, include step 201 to step 204, wherein step 201 and
Step 204 respectively in first embodiment step 101 and step 102 it is roughly the same, details are not described herein again.It is main below to be situated between
Continue difference:
Execute step 201 and step 202.
Step 203: determining the size of the corresponding data of process less than the first preset value.
Specifically, including the read-write operation information of process in the corresponding data of process.Read-write of the terminal in record the process
Before operation information, judge the size of the corresponding data of the process whether less than the first preset value;If it is determined that being to record the process
This read-write operation information, alternatively, the information of read-write operation information and process;Otherwise, this read-write of the process is not recorded
Operate the information generated.Wherein, the first preset value can be determined according to the memory size of terminal.
It should be noted that the corresponding data of process further include the information of recorded process itself in practical application,
Alternatively, the corresponding data of process further include the read-write operation letter of other processes of the subprocess of corresponding No. 1 process of process under one's name
Breath, it will be understood by those skilled in the art that the content of the corresponding data of process can according to need setting.
In the specific implementation, in order to avoid the data that monitoring I/O operation obtains occupy excessive memory, number corresponding for process
According to the memory space of one fixed size of setting, for example, memory space is set as 1kb, when the corresponding data institute of the process of storage
When taking up space greater than fixed size, it would not continue to record.
It is noted that limiting the size of the corresponding data of process, the number that can be generated to avoid read-write operation
The case where according to excessive memory is occupied.
Step 204: determining that the process last time of process this time and record that are written and read are written and read
Time interval be greater than the second preset value.
Specifically, further including the time that process is written and read in read-write operation information.Due in the system of terminal
May be all the time not in the event that disk read-write occurs, it, can if terminal records all read-write operation information
It can occupy excessive memory.In addition to this, the operation of terminal record read-write operation information may also be to the central processing of terminal
The use of device (Central Processing Unit, CPU) has some impact on.Therefore, terminal can be using similar " sampling "
Mode, the case where read-write operation occurred in terminal, is recorded.
For example, terminal at a time creates a new process, referred to as process 16.Process 16 is at the first moment to magnetic
Disk carries out first time read-write operation, since process 16 is to be written and read for the first time, terminal record the process 16 is for the first time
The information of the read-write operation information and process 16 that are written and read.Then, process 16 carries out second of read-write at the second moment
Operation, terminal first judge whether the time interval between the second moment and the first moment is greater than the second preset value, however, it is determined that are, then
The read-write operation information of second of the read-write operation of record the process 16 and the information of process 16, otherwise, terminal not record the process 16
The read-write operation information of secondary read-write operation and the information of process 16.If process 16 carries out third time read-write behaviour at the third moment
Make, and terminal has recorded the read-write operation information of second of the read-write operation of process 16 and the information of process 16, then terminal judges the
Whether the time interval between three moment and the second moment is greater than the second preset value, however, it is determined that is that record the process 16 is read for the third time
The read-write operation information of write operation and the information of process 16, otherwise, the not read-write operation of 16 third time read-write operation of record the process
The information of information and process 16.If process 16 carries out third time read-write operation at the third moment, and the non-record the process of terminal 16 the
The read-write operation information of secondary read-write operation and the information of process 16, then terminal judge between third moment and the first moment when
Between be spaced whether be greater than the second preset value, however, it is determined that be, the read-write operation information of 16 third time read-write operation of record the process and into
The information of journey 16, otherwise, the not information of the read-write operation information and process 16 of 16 third time read-write operation of record the process.
It is noted that the read-write operation information of the selectable record the process of terminal, can effectively reduce monitoring IO and produce
The case where raw data the space occupied size, the data for avoiding read-write operation from generating occupy excessive memory.
Execute step 205.
It should be noted that step 203 and step 204 are not necessarily meant to the step of executing, can selectively execute
Step 203 and step 204, or execute any one in step 203 and step 204.
It should be noted that in present embodiment, it is clear to describe, set step 204 to the subsequent step of step 203
Suddenly.It will be appreciated by a person skilled in the art that in practical application step 204 can also be first carried out, then execute step 203, this reality
The mode of applying is not limiting.
It should be noted that in present embodiment, it is clear to illustrate, step 203 and step 204 is set to determine process
Information and read-write operation information after the step of executing, in practical application, behaviour can also be written and read to disk in the process that determines
After executing after work, step 203 and step 204 are first carried out, then determine the information and read-write operation information of process, present embodiment is not
Play restriction effect.
It should be noted that the above is only limit for example, not constituting to technical solution of the present invention.
Compared with prior art, the read-write IO monitoring method provided in present embodiment, is written and read disk in process
When operation, is recorded according to information of the information of process to the file that process is read and write, allow user according to the number of record
According to, determine which process has carried out read-write operation to disk, each process has read and write which file inside disk respectively, read-write
How many times allow users to grasp process to the operational circumstances of the file of disk, occur in more macroscopical understanding disk
The case where read-write operation.In addition to this, terminal limits the size of the corresponding data of process, to the read-write operation of process with
The case where mode of " sampling " is recorded, and the data occupancy excessive memory of read-write operation generation is avoided.
The step of various methods divide above, be intended merely to describe it is clear, when realization can be merged into a step or
Certain steps are split, multiple steps are decomposed into, as long as including identical logical relation, all in the protection scope of this patent
It is interior;To adding inessential modification in algorithm or in process or introducing inessential design, but its algorithm is not changed
Core design with process is all in the protection scope of the patent.
Third embodiment of the invention is related to a kind of read-write IO monitoring device, as shown in fig. 6, comprising determining that 301 He of module
Logging modle 302;Determining module 301 is used to monitor read-write operation by interior nuclear probe;In monitoring result instruction, there are processes pair
After disk is written and read, the read-write operation information of process and the information of process are determined;Wherein, read-write operation information include into
The information of the file of journey read-write;Logging modle 302 is used for the information according to process, the read-write operation information of record the process.
In the specific implementation, can also include the big of the data that process reads or is written hereof in read-write operation information
It is small, and/or, process access path information.
In the specific implementation, the information of process may include the information of the subprocess of No. 1 process corresponding with process, wherein
The information of the subprocess of No. 1 process corresponding with process is determined according to the set membership between the information and process of process.
In the specific implementation, logging modle 302 is specifically used for: according to the information of the subprocess of No. 1 process corresponding with process,
The read-write operation information of process is recorded in the corresponding data storage area of subprocess of No. 1 process corresponding with process.
In the specific implementation, IO monitoring device further includes the first determination module, the first determination module is for judging that process is corresponding
Data size whether less than the first preset value, and after the size of the corresponding data of the process that determines is less than the first preset value,
Control information of the logging modle 302 according to process, the read-write operation information of record the process.
In the specific implementation, IO monitoring device further includes statistical module, statistical module is used to be believed according to the read-write operation of record
Breath, determines the number that process is written and read file.
In the specific implementation, IO monitoring device further includes the second determination module, the second determination module for judge process this
Whether the interval of the time of the read-write operation of the process of the time and last record that are written and read is greater than the second preset value,
And the interval of the time that this is written and read in the process that determines and the time of the read-write operation of the upper process once recorded are big
After the second preset value, information of the logging modle 302 according to process, the read-write operation information of record the process are controlled.
In the specific implementation, process is written and read disk by file system.File system is forth generation extension text
Part system EXT4 determines the method that process is written and read disk are as follows: uses the read/write function of interior nuclear probe monitoring EXT4
Whether it is called, however, it is determined that the read/write function of EXT4 is called, determines that there are processes and is written and read to disk.
It is not difficult to find that present embodiment is system embodiment corresponding with first embodiment and second embodiment,
Present embodiment can work in coordination implementation with first embodiment and second embodiment.First embodiment and the second embodiment party
The relevant technical details mentioned in formula are still effective in the present embodiment, and in order to reduce repetition, which is not described herein again.Accordingly
Ground, the relevant technical details mentioned in present embodiment are also applicable in first embodiment and second embodiment.
It is noted that each module involved in present embodiment is logic module, and in practical applications, one
A logic unit can be a physical unit, be also possible to a part of a physical unit, can also be with multiple physics lists
The combination of member is realized.In addition, in order to protrude innovative part of the invention, it will not be with solution institute of the present invention in present embodiment
The technical issues of proposition, the less close unit of relationship introduced, but this does not indicate that there is no other single in present embodiment
Member.
Four embodiment of the invention is related to a kind of terminal, as shown in fig. 7, comprises: at least one processor 401;And
With the memory 402 of at least one processor 401 communication connection;Wherein, be stored with can be by least one processor for memory 402
401 instructions executed, instruction is executed by least one processor 401, so that at least one processor 401 is able to carry out above-mentioned reality
The read-write IO monitoring method that the mode of applying refers to.
The terminal includes: one or more processors 401 and memory 402, in Fig. 7 by taking a processor 401 as an example.
Processor 401, memory 402 can be connected by bus or other modes, in Fig. 7 for being connected by bus.Storage
Device 402 is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software program, non-volatile meter
Calculation machine executable program and module.Processor 401 by operation be stored in memory 402 non-volatile software program,
Instruction and module thereby executing the various function application and data processing of equipment realize above-mentioned read-write IO monitoring method.
Memory 402 may include storing program area and storage data area, wherein storing program area can store operation system
Application program required for system, at least one function;It storage data area can the Save option list etc..In addition, memory 402 can be with
It can also include nonvolatile memory, for example, at least disk memory, a flash memory including high-speed random access memory
Device or other non-volatile solid state memory parts.In some embodiments, it includes relative to processing that memory 402 is optional
The remotely located memory of device 401, these remote memories can pass through network connection to external equipment.The example of above-mentioned network
Including but not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
One or more module is stored in memory 402, when being executed by one or more processor 401, is held
Read-write IO monitoring method in the above-mentioned any means embodiment of row.
The said goods can be performed the application embodiment provided by method, have the corresponding functional module of execution method and
Beneficial effect, the not technical detail of detailed description in the present embodiment, reference can be made to method provided by the application embodiment.
Fifth embodiment of the invention is related to a kind of computer readable storage medium, is stored with computer program.Computer
Above method embodiment is realized when program is executed by processor.
That is, it will be understood by those skilled in the art that implement the method for the above embodiments be can be with
Relevant hardware is instructed to complete by program, which is stored in a storage medium, including some instructions are to make
It obtains an equipment (can be single-chip microcontroller, chip etc.) or processor (processor) executes side described in each embodiment of the application
The all or part of the steps of method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention,
And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.
Claims (13)
1. a kind of read-write IO monitoring method characterized by comprising
Read-write operation is monitored by interior nuclear probe;
After monitoring result instruction is written and read disk there are process, read-write operation information and the institute of the process are determined
State the information of process;Wherein, the read-write operation information includes the information of the file of the process read-write;
According to the information of the process, the read-write operation information of the process is recorded.
2. IO monitoring method according to claim 1, which is characterized in that further include in the read-write operation information it is described into
The size for the data that journey reads or is written in the file, and/or, process access path information.
3. IO monitoring method according to claim 1, which is characterized in that the information of the process includes and the process pair
The information of the subprocess for No. 1 process answered, wherein the information of the subprocess of corresponding No. 1 process is according to the process
Set membership between information and process determines.
4. IO monitoring method according to claim 3, which is characterized in that the information according to the process records institute
The read-write operation information for stating process, specifically includes:
According to the information of the subprocess of corresponding No. 1 process, it is described right that the read-write operation information of the process is recorded in
In the corresponding data storage area of the subprocess for No. 1 process answered.
5. IO monitoring method according to any one of claim 1 to 4, which is characterized in that described according to the process
Information, before the read-write operation information for recording the process, the IO monitoring method further include:
The sizes of the corresponding data of the process is determined less than the first preset value, include in the corresponding data of the process it is described into
The read-write operation information of journey.
6. IO monitoring method according to any one of claim 1 to 4, which is characterized in that described according to the process
Information, after the read-write operation information for recording the process, the IO monitoring method further include:
According to the read-write operation information of record, the number that the process is written and read the file is determined.
7. IO monitoring method according to any one of claim 1 to 4, which is characterized in that in the read-write operation information
It further include the time that the process is written and read;
Before the information according to the process, the read-write operation information for recording the process, the IO monitoring method is also
Include:
Determine that the process last time of the process this time and record that are written and read is written and read when
Between interval be greater than the second preset value.
8. IO monitoring method according to any one of claim 1 to 4, which is characterized in that the process passes through file system
System is written and read the disk.
9. IO monitoring method according to claim 8, which is characterized in that the file system is that forth generation extends file system
Unite EXT4;
It is described that read-write operation is monitored by interior nuclear probe, it specifically includes:
The read/write function of EXT4 is monitored by the interior nuclear probe, however, it is determined that the read/write function of the EXT4 is called, determines institute
Stating monitoring result instruction, there are processes to be written and read to disk.
10. IO detection method according to claim 9, which is characterized in that described to monitor EXT4 by the interior nuclear probe
Read/write function, specifically include:
Judge whether pre-set sensing point is triggered;Wherein, the read/write function of the EXT4 is arranged in the sensing point:
On the corresponding address ext4_readpage, ext4_readpages and ext4_file_write;
If it is determined that being to determine that the read/write function of the EXT4 is called;
Otherwise, it determines the read/write function of the EXT4 is not called upon.
11. a kind of read-write IO monitoring device characterized by comprising determining module and logging modle;
The determining module is used to monitor read-write operation by interior nuclear probe;In monitoring result instruction, there are processes to disk progress
After read-write operation, the read-write operation information of the process and the information of the process are determined;Wherein, the read-write operation packet
Include the information of the file of the process read-write;
The logging modle is used for the information according to the process, records the read-write operation information of the process.
12. a kind of terminal characterized by comprising at least one processor;And
The memory being connect at least one described processor communication;Wherein, be stored with can be by described at least one for the memory
The instruction that a processor executes, described instruction is executed by least one described processor, so that at least one described processor energy
Enough read-write IO monitoring methods executed as described in any one of claims 1 to 10.
13. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the computer program is located
Reason device realizes read-write IO monitoring method described in any one of claims 1 to 10 when executing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811314005.6A CN109542341B (en) | 2018-11-06 | 2018-11-06 | Read-write IO monitoring method, device, terminal and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811314005.6A CN109542341B (en) | 2018-11-06 | 2018-11-06 | Read-write IO monitoring method, device, terminal and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109542341A true CN109542341A (en) | 2019-03-29 |
CN109542341B CN109542341B (en) | 2022-07-19 |
Family
ID=65846149
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811314005.6A Active CN109542341B (en) | 2018-11-06 | 2018-11-06 | Read-write IO monitoring method, device, terminal and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109542341B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111159117A (en) * | 2019-12-17 | 2020-05-15 | 复旦大学 | Low-overhead file operation log acquisition method |
CN113076233A (en) * | 2021-03-30 | 2021-07-06 | 中国建设银行股份有限公司 | IO performance detection method, device, equipment and storage medium |
CN115098017A (en) * | 2022-05-12 | 2022-09-23 | 北京卡普拉科技有限公司 | Data processing method and device, electronic equipment and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102393829A (en) * | 2011-10-31 | 2012-03-28 | 华南理工大学 | Disk I/O (Input/Output) test system oriented to embedded system |
CN102810092A (en) * | 2011-05-31 | 2012-12-05 | 腾讯科技(深圳)有限公司 | Data read-write method and system |
CN103177080A (en) * | 2013-02-07 | 2013-06-26 | 华为技术有限公司 | File pre-reading method and file pre-reading device |
CN103761175A (en) * | 2013-11-25 | 2014-04-30 | 中国科学院计算技术研究所 | System and method for monitoring program execution paths under Linux system |
CN104331324A (en) * | 2014-11-04 | 2015-02-04 | 哈尔滨工业大学 | MapReduce fault injection external member |
CN104462955A (en) * | 2014-12-25 | 2015-03-25 | 中国科学院信息工程研究所 | Host behavior active detection system and method based on virtualization |
US9183111B2 (en) * | 2011-05-10 | 2015-11-10 | Microsoft Technology Licensing, Llc | Methods and computer program products for collecting storage resource performance data using file system hooks |
CN105354050A (en) * | 2015-09-30 | 2016-02-24 | 深圳市九洲电器有限公司 | Application software calling method for intelligent terminal |
CN108399118A (en) * | 2018-03-20 | 2018-08-14 | 广东欧珀移动通信有限公司 | file system test data processing method, device, storage medium and terminal |
-
2018
- 2018-11-06 CN CN201811314005.6A patent/CN109542341B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9183111B2 (en) * | 2011-05-10 | 2015-11-10 | Microsoft Technology Licensing, Llc | Methods and computer program products for collecting storage resource performance data using file system hooks |
CN102810092A (en) * | 2011-05-31 | 2012-12-05 | 腾讯科技(深圳)有限公司 | Data read-write method and system |
CN102393829A (en) * | 2011-10-31 | 2012-03-28 | 华南理工大学 | Disk I/O (Input/Output) test system oriented to embedded system |
CN103177080A (en) * | 2013-02-07 | 2013-06-26 | 华为技术有限公司 | File pre-reading method and file pre-reading device |
CN103761175A (en) * | 2013-11-25 | 2014-04-30 | 中国科学院计算技术研究所 | System and method for monitoring program execution paths under Linux system |
CN104331324A (en) * | 2014-11-04 | 2015-02-04 | 哈尔滨工业大学 | MapReduce fault injection external member |
CN104462955A (en) * | 2014-12-25 | 2015-03-25 | 中国科学院信息工程研究所 | Host behavior active detection system and method based on virtualization |
CN105354050A (en) * | 2015-09-30 | 2016-02-24 | 深圳市九洲电器有限公司 | Application software calling method for intelligent terminal |
CN108399118A (en) * | 2018-03-20 | 2018-08-14 | 广东欧珀移动通信有限公司 | file system test data processing method, device, storage medium and terminal |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111159117A (en) * | 2019-12-17 | 2020-05-15 | 复旦大学 | Low-overhead file operation log acquisition method |
CN111159117B (en) * | 2019-12-17 | 2023-07-04 | 复旦大学 | Low-overhead file operation log acquisition method |
CN113076233A (en) * | 2021-03-30 | 2021-07-06 | 中国建设银行股份有限公司 | IO performance detection method, device, equipment and storage medium |
CN113076233B (en) * | 2021-03-30 | 2024-02-27 | 中国建设银行股份有限公司 | IO performance detection method, device, equipment and storage medium |
CN115098017A (en) * | 2022-05-12 | 2022-09-23 | 北京卡普拉科技有限公司 | Data processing method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109542341B (en) | 2022-07-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106326067B (en) | A kind of method and device that cpu performance is monitored under pressure test | |
CN111756575B (en) | Performance analysis method and device of storage server and electronic equipment | |
CN109542341A (en) | A kind of read-write IO monitoring method, device, terminal and computer readable storage medium | |
CN110502374A (en) | The traffic capture debugging tool of the basic reason of equipment fault when identification is tested automatically | |
CN106055464B (en) | Data buffer storage testing schooling pressure device and method | |
CN110188306A (en) | A kind of method and device of web form Auto-writing | |
WO2016008398A1 (en) | Program performance test method and device | |
US10353789B1 (en) | Analog fault simulation control with multiple circuit representations | |
CN107122669A (en) | A kind of method and apparatus for assessing leaking data risk | |
CN109491860A (en) | Method for detecting abnormality, terminal device and the medium of application program | |
CN109583194A (en) | The system and method for popularization degree detection anomalous event for the convolution based on event | |
US10467590B2 (en) | Business process optimization and problem resolution | |
CN106021045A (en) | Method for testing IO (input/output) performance of hard disk of server under linux system | |
US10657028B2 (en) | Method for replicating production behaviours in a development environment | |
CN107515716B (en) | Billboard card management method, apparatus, computer equipment and storage medium | |
WO2022001125A1 (en) | Method, system and device for predicting storage failure in storage system | |
Devroey et al. | Abstract test case generation for behavioural testing of software product lines | |
CN109324968A (en) | A kind of system detection method and device | |
CN106546278A (en) | The statistical test device and method of checking nuclear safe level instrument control platform safety crash rate | |
CN105446848B (en) | The test method and device of the data processing performance of electronic equipment | |
CN111091863A (en) | Storage equipment fault detection method and related device | |
CN113760187B (en) | Method, system, terminal and storage medium for generating deduplication IO thread | |
CN106502887A (en) | A kind of stability test method, test controller and system | |
CN106127558B (en) | Bill generation method and mobile terminal | |
CN107608841A (en) | Hard disk test document generating method, device, equipment and readable storage medium storing program for executing |
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 |