CN108563503A - A kind of stream data recording method and data flow for program test records system - Google Patents

A kind of stream data recording method and data flow for program test records system Download PDF

Info

Publication number
CN108563503A
CN108563503A CN201810002249.4A CN201810002249A CN108563503A CN 108563503 A CN108563503 A CN 108563503A CN 201810002249 A CN201810002249 A CN 201810002249A CN 108563503 A CN108563503 A CN 108563503A
Authority
CN
China
Prior art keywords
details
program
thread
binary file
buffer area
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.)
Pending
Application number
CN201810002249.4A
Other languages
Chinese (zh)
Inventor
李雅明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810002249.4A priority Critical patent/CN108563503A/en
Publication of CN108563503A publication Critical patent/CN108563503A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

A kind of stream data recording method for program test provided herein, including:Obtain the number of threads and number when program operation;It is that each thread divides corresponding buffer area in memory according to number;The details of each I/O operation of each thread are preserved into corresponding buffer area;Corresponding binary file is written into details in buffer area;Binary file is decoded to obtain details.One section of caching is opened up for per thread, and the I/O operation in thread is all first recorded in caching, I/O operation is written in readable binary file from caching again, and it is decoded to obtain the details of I/O operation in thread to binary file, it realizes that all details by I/O operation show to debug for tester with readable form whereby to use, help is provided for the analysis and positioning problems of data flow.The application also provides a kind of data current test system for program test and a kind of readable storage medium storing program for executing, has above-mentioned advantageous effect.

Description

A kind of stream data recording method and data flow for program test records system
Technical field
This application involves storage system field, more particularly to a kind of stream data recording methods and data for program test Flow record system and a kind of readable storage medium storing program for executing.
Background technology
When analyzing storage system problem, what is be generally concerned with is the temporal information of I/O operation, facility information, the addresses LBA letter Information as whether breath, data model and size of data, the rate of IO and delay, operation are successful etc., these information are to fast Speed analysis and orientation problem are required.For program test, once mistake occurs when program is run, need Corresponding I/O operation information is solved, timely clear error reason, preferably to carry out related commissioning work.
Apply for content
The purpose of the application is to provide a kind of stream data recording method for program test and data flow record system, with And a kind of readable storage medium storing program for executing, solving the problems, such as in the prior art can not all I/O operation details in record thread.
In order to solve the above technical problems, the application provides a kind of stream data recording method for program test, specific skill Art scheme is as follows:
Obtain the number of threads and number when described program operation;
It is that each thread divides corresponding buffer area in memory according to the number;
The details of each each I/O operation of thread are preserved into the corresponding buffer area;
Corresponding binary file is written into details described in the buffer area;
The binary file is decoded to obtain the details.
Wherein, before the number of threads and number when obtaining described program operation, further include:
Flag bit is set before described program is run;
When program is run, flag bit is judged whether;
If so, starting to obtain the number of threads and number when described program operation.
Wherein, after corresponding binary file being written in details described in the buffer area, further include:
It is named for the binary file and is resident locally disk.
Wherein, after the binary file being decoded to obtain the details, further include:
The details are saved as to readable text file.
Wherein, the details are specially timestamp, data rate, data type, delay, the knot of the I/O operation Fruit, and the device name of the storage volume currently tested, the addresses LBA, file handle.
The application also provides a kind of data flow record system for program test, including:
Acquisition module, for obtaining number of threads and number when described program operation;
Division module, for being that each thread divides corresponding buffer area in memory according to the number;
Preserving module, for preserving the details of each each I/O operation of thread to the corresponding buffer area In;
Writing module, for corresponding binary file to be written in details described in the buffer area;
Decoder module, for decoding the binary file to obtain the details.
Wherein, further include:
Setup module, for flag bit to be arranged before described program is run;
Judgment module judges whether flag bit when for program operation;
Jump module jumps to the acquisition module for if there are flag bits.
Wherein, further include:
Module is named, for being named for the binary file and being resident locally disk.
Wherein, further include:
Memory module, for the details to be saved as to readable text file.
The application also provides a kind of readable storage medium storing program for executing, is stored thereon with program, it is above-mentioned that described program is performed realization Step corresponding to stream data recording method.
A kind of stream data recording method for program test provided herein, including:Obtain described program operation When number of threads and number;It is that each thread divides corresponding buffer area in memory according to the number;By each thread The details of each I/O operation are preserved into the corresponding buffer area;By the write-in pair of details described in the buffer area The binary file answered;The binary file is decoded to obtain the details.One section of caching is opened up for per thread, And the I/O operation in thread is all first recorded in caching, then I/O operation is written in readable binary file from caching, And it is decoded to obtain the details of I/O operation in thread to binary file, it is realized whereby by all detailed letters of I/O operation Breath is shown to debug for tester with readable form and be used, and help is provided for the analysis and positioning problems of data flow.The application is also A kind of data current test system for program test and a kind of readable storage medium storing program for executing are provided, there is above-mentioned advantageous effect, herein It repeats no more.
Description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
A kind of flow chart for stream data recording method for program test that Fig. 1 is provided by the embodiment of the present application;
Fig. 2 records system structure diagram by a kind of data flow for program test that the embodiment of the present application provides.
Specific implementation mode
To keep the purpose, technical scheme and advantage of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, technical solutions in the embodiments of the present application is clearly and completely described, it is clear that described embodiment is The embodiment of the application part, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art The every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Referring to FIG. 1, a kind of stream data recording method for program test that Fig. 1 is provided by the embodiment of the present application Flow chart is as follows:
S101:Obtain the number of threads and number when described program operation;
This step is intended to obtain all threads when program operation.It is to be understood that program generally includes at runtime Multiple threads have respective I/O operation in per thread again.Different threads can be run parallel, it is also possible to which there are certain priorities Sequentially.For program test, all I/O operations for obtaining all threads are needed, because each I/O operation is likely to occur Mistake.The purpose of number is used as differentiation, is usually distributed by system.
It is not to need to record all I/O operations of all periods even if should be noted that in program test yet, It is understood that the details for recording all I/O operations of all threads are sizable workloads, therefore can select One target time section carries out the tracking of data flow.Sentence for example, flag bit is arranged when program is run before described program is run It is disconnected to whether there is flag bit, if so, proceeding by above-mentioned steps again.The meaning of this method debugging process that has been convenient.For example, Find that mistake occurs for some thread when first test, tested again after modified, at this point it is possible to close on thread operation when Between point one flag bit of setting, and proceed by from the flag bit tracking of data flow.
Details of the above I/O operation are not limited at this, it is to be understood that the details are answered When be to analyze the helpful information of I/O operation, such as the timestamp of I/O operation, data rate, data type, delay, as a result, And the device name of the storage volume currently tested, the addresses LBA, file handle etc., there can also be other of I/O operation certainly Information, as long as corresponding I/O operation error analysis can be made according to details.
S102:It is that each thread divides corresponding buffer area in memory according to the number;
Buffer area refers to as the corresponding buffer area of each thread dividing, and " corresponding " here refers to can be according to buffer area Thread is clearly corresponded to, a typically thread corresponds to one piece of buffer area.
Certainly, equally can be that corresponding buffer area utilizes the side of being identically numbered after each thread number being got in S101 Formula is numbered, such as " thread 1 " correspondence " buffer area one ".
S103:The details of each each I/O operation of thread are preserved into the corresponding buffer area;
After dividing buffer area, the details of I/O operation in per thread are preserved into the corresponding buffer area of the thread i.e. It can.
S104:Corresponding binary file is written into details described in the buffer area.
Because the buffer area in memory should not carry out prolonged data preservation, it is therefore desirable to be written into corresponding two into In file processed.It is understood that binary file is the readable form of computer, therefore suitable tool open can be used Binary file.
A kind of naming method of binary file is provided herein --- storage volume title _ thread number _ timestamp is come with this Some thread is distinguished in the test to some storage volume sometime started, filename is unique.It is, of course, also possible to there is other Naming method, as long as it names what can be uniquely determined to show the key messages such as thread, time.
In program operation process, it can be continuously generated binary file described above, using as detailed in test process Thin information.Preferably, in this application, a thread may be implemented and correspond to a buffering area, a buffering area corresponds to a binary system text Part.It is understood that can also disk be resident locally the binary file after name.
S105:The binary file is decoded to obtain the details.
Here decoding refers to for binary file being converted into readable form, herein for the specific behaviour of transfer process Make and concrete form is not construed as limiting, as long as can be directly for related personnel's use.Such as change into text file.It converts Cheng Hou can also utilize display screen to show details.
The embodiment of the present application provides a kind of stream data recording method for program test, can pass through above method reality Now to the data record of the I/O operation of each thread in program, all details of I/O operation are shown in the form of readable It debugs and uses for tester, help is provided for the analysis and positioning problems of data flow.
A kind of data flow record system for program test provided by the embodiments of the present application is introduced below, hereafter The data flow record system of description can correspond reference with above-described stream data recording method.
Referring to Fig. 2, Fig. 2 records system structure by a kind of data flow for program test that the embodiment of the present application provides Schematic diagram, the system may include:
Acquisition module 100, for obtaining number of threads and number when described program operation;
Division module 200, for being that each thread divides corresponding buffer area in memory according to the number;
Preserving module 300, for preserving the details of each each I/O operation of thread to the corresponding caching Qu Zhong;
Writing module 400, for corresponding binary file to be written in details described in the buffer area.
Decoder module 500, for decoding the binary file to obtain the details.
Based on above-described embodiment, as preferred embodiment, the system can also include:
Setup module, for flag bit to be arranged before described program is run;
Judgment module judges whether flag bit when for program operation;
Jump module jumps to the acquisition module for if there are flag bits.
Based on above-described embodiment, as preferred embodiment, the system can also include:
Module is named, for being named for the binary file and being resident locally disk.
Based on above-described embodiment, as preferred embodiment, the system can also include:
Memory module, for the details to be saved as to readable text file.
Present invention also provides a kind of readable storage medium storing program for executing, have computer program thereon, which is performed When the step of above-described embodiment is provided may be implemented.The storage medium may include:USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD Etc. the various media that can store program code.
Each embodiment is described by the way of progressive in specification, the highlights of each of the examples are with other realities Apply the difference of example, just to refer each other for identical similar portion between each embodiment.For embodiment provide system and Speech, since it is corresponding with the method that embodiment provides, so description is fairly simple, related place is referring to method part illustration .
Specific examples are used herein to illustrate the principle and implementation manner of the present application, and above example is said It is bright to be merely used to help understand the present processes and its core concept.It should be pointed out that for the ordinary skill of the art For personnel, under the premise of not departing from the application principle, can also to the application, some improvement and modification can also be carried out, these improvement It is also fallen into the application scope of the claims with modification.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only that A little elements, but also include other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.

Claims (10)

1. a kind of stream data recording method for program test, which is characterized in that including:
Obtain the number of threads and number when described program operation;
It is that each thread divides corresponding buffer area in memory according to the number;
The details of each each I/O operation of thread are preserved into the corresponding buffer area;
Corresponding binary file is written into details described in the buffer area;
The binary file is decoded to obtain the details.
2. stream data recording method according to claim 1, which is characterized in that obtain the thread when described program operation Before number and number, further include:
Flag bit is set before described program is run;
When program is run, flag bit is judged whether;
If so, starting to obtain the number of threads and number when described program operation.
3. stream data recording method according to claim 2, which is characterized in that by details described in the buffer area It is written after corresponding binary file, further includes:
It is named for the binary file and is resident locally disk.
4. stream data recording method according to claim 3, which is characterized in that decoding the binary file to obtain Further include after the details:
The details are saved as to readable text file.
5. according to claim 1-4 any one of them stream data recording methods, which is characterized in that the details are specially The timestamp of the I/O operation, data rate, data type, delay, as a result, and the implementor name of storage volume currently tested Title, the addresses LBA, file handle.
6. a kind of data flow for program test records system, which is characterized in that including:
Acquisition module, for obtaining number of threads and number when described program operation;
Division module, for being that each thread divides corresponding buffer area in memory according to the number;
Preserving module, for preserving the details of each each I/O operation of thread into the corresponding buffer area;
Writing module, for corresponding binary file to be written in details described in the buffer area;
Decoder module, for decoding the binary file to obtain the details.
7. data flow according to claim 6 records system, which is characterized in that further include:
Setup module, for flag bit to be arranged before described program is run;
Judgment module judges whether flag bit when for program operation;
Jump module jumps to the acquisition module for if there are flag bits.
8. data flow according to claim 7 records system, which is characterized in that further include:
Module is named, for being named for the binary file and being resident locally disk.
9. data flow according to claim 8 records system, which is characterized in that further include:
Memory module, for the details to be saved as to readable text file.
10. a kind of readable storage medium storing program for executing, is stored thereon with program, which is characterized in that described program is performed realization such as right It is required that 1-5 any one of them stream data recording methods.
CN201810002249.4A 2018-01-02 2018-01-02 A kind of stream data recording method and data flow for program test records system Pending CN108563503A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810002249.4A CN108563503A (en) 2018-01-02 2018-01-02 A kind of stream data recording method and data flow for program test records system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810002249.4A CN108563503A (en) 2018-01-02 2018-01-02 A kind of stream data recording method and data flow for program test records system

Publications (1)

Publication Number Publication Date
CN108563503A true CN108563503A (en) 2018-09-21

Family

ID=63530478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810002249.4A Pending CN108563503A (en) 2018-01-02 2018-01-02 A kind of stream data recording method and data flow for program test records system

Country Status (1)

Country Link
CN (1) CN108563503A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111190777A (en) * 2019-12-20 2020-05-22 曙光信息产业(北京)有限公司 Disk I/O performance test method and device
CN112732586A (en) * 2021-01-20 2021-04-30 山东云海国创云计算装备产业创新中心有限公司 Chip debugging method, system, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488565A (en) * 2013-09-13 2014-01-01 北京航空航天大学 Test data collecting method for distributed real-time test system
CN103577310A (en) * 2012-07-20 2014-02-12 腾讯科技(深圳)有限公司 Method and device for recording software debugging logs
CN104794059A (en) * 2015-05-08 2015-07-22 北京理工大学 Defect positioning method and device based on function calling records
US20150248465A1 (en) * 2012-11-19 2015-09-03 Tencent Technology (Shenzhen) Company Limited Method and apparatus for processing history operation records of electronic terminal, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577310A (en) * 2012-07-20 2014-02-12 腾讯科技(深圳)有限公司 Method and device for recording software debugging logs
US20150248465A1 (en) * 2012-11-19 2015-09-03 Tencent Technology (Shenzhen) Company Limited Method and apparatus for processing history operation records of electronic terminal, and storage medium
CN103488565A (en) * 2013-09-13 2014-01-01 北京航空航天大学 Test data collecting method for distributed real-time test system
CN104794059A (en) * 2015-05-08 2015-07-22 北京理工大学 Defect positioning method and device based on function calling records

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111190777A (en) * 2019-12-20 2020-05-22 曙光信息产业(北京)有限公司 Disk I/O performance test method and device
CN111190777B (en) * 2019-12-20 2023-12-08 曙光信息产业(北京)有限公司 Disk I/O performance test method and device
CN112732586A (en) * 2021-01-20 2021-04-30 山东云海国创云计算装备产业创新中心有限公司 Chip debugging method, system, equipment and computer readable storage medium
CN112732586B (en) * 2021-01-20 2024-06-07 山东云海国创云计算装备产业创新中心有限公司 Chip debugging method, system, device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109542342B (en) Metadata management and data reconstruction method, equipment and storage medium
US8331053B2 (en) Systems and methods for adjacent track interference (ATI) risk management
CN1734624B (en) System and method for optical media information storage life tracking
CN103578568A (en) Method and apparatus for testing performances of solid state disks
CN109542701B (en) Method and device for testing performance of magnetic disk
CN109683825B (en) Storage system online data compression method, device and equipment
CN104504105A (en) Storage method of real-time database
CN104504116A (en) Storage method of real-time database
CN102280125A (en) Method for restoring lost data in abnormal shutdown and hard-disk recorder
CN104461384B (en) A kind of method for writing data and storage device
CN108563503A (en) A kind of stream data recording method and data flow for program test records system
WO2015103933A1 (en) Method and apparatus for data access
CN106648977A (en) Recovery method and device of Android system file
CN105207832A (en) Server stress testing method and device
CN102737681B (en) Performance testing method and device of stream media player
CN114090379A (en) Server bus fault positioning method and device, electronic equipment and storage medium
CN112579382A (en) NVMe solid state disk bad block analysis method, device, terminal and storage medium
JP2013528823A5 (en)
JP2013528823A (en) Audio data storage method and apparatus
CN108959497A (en) distributed file system log processing method, device, equipment and storage medium
JP2005339262A5 (en)
CN107430546A (en) A kind of file updating method and storage device
CN106875977A (en) A kind of solid state hard disc adjustment method and device
US20120159257A1 (en) Control computer and report management method using the same
CN102063365B (en) Method and device for recording operation information of single plate

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180921

RJ01 Rejection of invention patent application after publication