CN104077220A - Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel - Google Patents

Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel Download PDF

Info

Publication number
CN104077220A
CN104077220A CN201410256504.XA CN201410256504A CN104077220A CN 104077220 A CN104077220 A CN 104077220A CN 201410256504 A CN201410256504 A CN 201410256504A CN 104077220 A CN104077220 A CN 104077220A
Authority
CN
China
Prior art keywords
sensing point
function
debugging
kernel
operating system
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
CN201410256504.XA
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.)
China Standard Software Co Ltd
Original Assignee
China Standard Software 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 China Standard Software Co Ltd filed Critical China Standard Software Co Ltd
Priority to CN201410256504.XA priority Critical patent/CN104077220A/en
Publication of CN104077220A publication Critical patent/CN104077220A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a method and device for debugging a microprocessor without interlocked piped stages (MIPS) framework operating system kernel. The debugging method comprises the steps of inserting a sensing point at an appointed address of the operating system kernel, associating a sensing point processing function with the sensing point; executing the sensing point processing function when the kernel is executed to the sensing point; utilizing a debugging tool preset by the kernel to hook an MIPS framework processor and collect kernel debugging information; and returning the executed operating system kernel after the execution of the sensing point processing function is finished. According to the technical scheme, the sensing point is placed and the sensing point processing function is executed at the sensing point, the MIPS framework processor is hooked so as to collect the debugging information, the Linux kernel debugging requirements of the MIPS framework processor are met, and the method and device for debugging the MIPS framework operating system kernel are simple to use and high in debugging efficiency.

Description

Adjustment method and the device of MIPS framework operating system nucleus
Technical field
The present invention relates to operating system field, particularly a kind of adjustment method and device of MIPS framework operating system nucleus.
Background technology
It is difficult that a factor of kernel development difficulty is exactly kernel debugging, and therefore kernel debugging is a technical bottleneck of operating system nucleus exploitation.Existing linux system kernel debugging method comprises GDB, KGDP, KDUMP etc., just can debug mostly need to in these kernel tune means the specific patch of renucleation (Patch) in linux system, and this debud mode is equivalent in operating system debugging self, therefore can only support very simple debug function, for example, check kernel data structure, print field data etc.
Most widely used a kind of linux system kernel debugging scheme is system call printk function, printk is the function to control desk output display moving in kernel, because (SuSE) Linux OS and driver operate in kernel spacing, application program operates in user's space, can not use simply pointer to transmit data between the two, therefore utilize printk function to realize the process of kernel debugging as follows:
In system kernel space, printk is written to information in the printk_buf that 1K is large; Before being initialised, terminal and control desk more all information is all buffered in simple ring buffer (buffer circle); Until after terminal and control desk be initialised, cache information is exported selectively according to debugging level difference.
In user's space, user's space access and control kernel log have two interface: klogd and dmesg.Type information is obtained in the syslog system call that klogd and dmesg call kernel by the klogctl function interface of glibc.Klogd obtains by kernel printk information by reading proc file system from ring buffer (buffer circle).Final two interfaces have all called do_syslog function, realize access to log_buf and the amendment of correlated variables.
Have the program that is specifically designed to register system daily record at user's space, what early stage most of embedded system was used is klogd+syslogd combination, and the version of great majority distribution now has all been used rsyslogd or syslogd-ng.
Adopt above method to debug and must rebuild and use new kernel to start, debugging efficiency be lower.
Summary of the invention
In view of the above problems, the present invention has been proposed to a kind of adjustment method of debugging apparatus and corresponding MIPS framework operating system nucleus of the MIPS framework operating system nucleus that overcomes the problems referred to above or address the above problem is at least in part provided.
Object of the present invention is that the linux kernel adjustment method that is applicable to MIPS architecture processor will be provided.
Of the present invention enter object be to improve the debugging efficiency of linux kernel debugging.
According to one aspect of the present invention, provide a kind of adjustment method of MIPS framework operating system nucleus.The assigned address that the method is included in operating system nucleus inserts sensing point, will be associated with sensing point and sensing point processing function; In the time that kernel is carried out to sensing point, carry out sensing point and process function; Hook MIPS architecture processor and collect kernel Debugging message by the preset debugging acid of kernel; After sensing point processing function is finished, return to executive operating system kernel.
Alternatively, before inserting sensing point, the assigned address of operating system nucleus also comprises: in the process of compiling kernel, open the option that enables of debugging acid, and debugging acid is carried out to initialization.
Alternatively, debugging acid being carried out to initialization comprises: the code that can not be detected in marking operation internal system; Registration event notification chain function, the abnormity notifying issuing to receive MIPS architecture processor.
Alternatively, inserting sensing point at the assigned address of operating system nucleus comprises: obtain assigned address; Backup is detected instruction, and use break-poing instruction is replaced and is detected instruction.
Alternatively, carrying out sensing point processing function comprises: carry out break-poing instruction, trigger breakpoint abnormal; Process function by event notice chain function call first; The instruction that is detected of backup is carried out in single step; After being detected instruction and being finished, process function by event notice chain function call second.
Alternatively, the kprobe debugging acid that debugging acid is (SuSE) Linux OS; The first processing function is pre_handler function, and the second processing function is post_handler function.
A kind of debugging apparatus of MIPS framework operating system nucleus is also provided according to another object of the present invention.The debugging apparatus of this MIPS framework operating system nucleus comprises: sensing point Registering modules, insert sensing point for the assigned address at operating system nucleus, and sensing point and sensing point are processed to function associated; Function execution module, when carry out to sensing point at kernel, carries out sensing point and processes function; Debugging module, for being hooked MIPS architecture processor and collected kernel Debugging message by the preset debugging acid of kernel; Return to module, after being finished at sensing point processing function, return to executive operating system kernel.
Alternatively, said apparatus also comprises: initialization module, for opening the option that enables of debugging acid in the process of compiling kernel, and debugging acid is carried out to initialization, wherein debugging acid is carried out to initialization and comprise: the code that can not be detected in marking operation internal system; Registration event notification chain function, the abnormity notifying issuing to receive MIPS architecture processor.
Alternatively, sensing point Registering modules also for: obtain assigned address; Backup is detected instruction, and use break-poing instruction is replaced and is detected instruction.
Alternatively, debugging module also for: carry out break-poing instruction, trigger breakpoint abnormal; Process function by event notice chain function call first; The instruction that is detected of backup is carried out in single step; After being detected instruction and being finished, process function by event notice chain function call second.
The adjustment method of MIPS framework operating system nucleus of the present invention is by inserting sensing point and carrying out sensing point at sensing point and process function, hook up MIPS architecture processor to collect Debugging message, meet the linux kernel commissioning requirements of MIPS architecture processor, use simply, debugging efficiency is high.
Further, adjustment method of the present invention has realized kprobe debugging acid in MIPS framework, not revising on the basis of existing code, follows the tracks of neatly the execution of kernel function, has greatly improved dirigibility and the debugging efficiency of debugging.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to better understand technological means of the present invention, and can be implemented according to the content of instructions, and for above and other objects of the present invention, feature and advantage can be become apparent, below especially exemplified by the specific embodiment of the present invention.
According to the detailed description to the specific embodiment of the invention by reference to the accompanying drawings below, those skilled in the art will understand above-mentioned and other objects, advantage and feature of the present invention more.
Brief description of the drawings
By reading below detailed description of the preferred embodiment, various other advantage and benefits will become cheer and bright for those of ordinary skill in the art.Accompanying drawing is only for the object of preferred implementation is shown, and do not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 is the schematic diagram of the debugging apparatus of MIPS framework operating system nucleus according to an embodiment of the invention;
Fig. 2 is the schematic diagram of the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention;
Fig. 3 is the architectural framework figure of kprobe instrument in the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention;
Fig. 4 is the flowchart of kprobe instrument in the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention; And
Fig. 5 is that in the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention, kprobe loads and unloading process flow diagram.
Embodiment
Fig. 1 is the schematic diagram of the debugging apparatus of MIPS framework operating system nucleus according to an embodiment of the invention, this debugging apparatus can comprise in general manner: sensing point Registering modules 110, function execution module 120, debugging module 130, return to module 140, initialization module 150, the function that the debugging apparatus 100 of the present embodiment can be realized according to it, option and installment is with upper module flexibly, in some optional embodiment, can be configured to all modules simultaneously.
Without microprocessor (the Microprocessor without interlocked piped stages of inner interlocked pipelining-stage, be called for short MIPS), a kind of comparatively popular reduced instruction set computer (Reduced Instruction Set Computing, be called for short RISC) processor, it utilizes software way to avoid the data relevant issues in streamline as far as possible.System architecture and the design concept of MIPS are more advanced, develop very ripe.In design concept, MIPS emphasizes that software-hardware synergism improves performance, simplifies hardware design simultaneously.The processor towards high-performance computer and server of the Godson series of China is also based on MIPS framework at present, under the environment that information security attention degree is improved gradually, the importance of MIPS processor also improves gradually, at present, the processor of MIPS framework has powerful instruction set, extensibility from 32 to 64, is extensively used in many electronic products, the network equipment, personal entertainment device and commercial apparatus.
But, the processor of MIPS framework and other several processor structures (for example i386, x86_64, ppc64, ia64, sparc64) between, there are a lot of differences, and incompatible, therefore cannot directly use the linux kernel development technique of above framework, in the prior art, in the time that linux system makes a mistake, just collection system Debugging message dynamically of the processor of MIPS framework.
In the debugging apparatus of the MIPS of the present embodiment framework operating system nucleus, sensing point Registering modules 110 inserts sensing point for the assigned address at operating system nucleus, sensing point is processed to function associated with sensing point.Function execution module 120 when carry out to sensing point at kernel, is carried out sensing point and is processed function.Debugging module 130 is for being hooked MIPS architecture processor and collected kernel Debugging message by the preset debugging acid of kernel.Return to module 140 for after being finished at sensing point processing function, return to executive operating system kernel.
Utilize the debugging apparatus 100 of above structure by inserting sensing point and carrying out sensing point at sensing point and process function, to hook up MIPS architecture processor to collect Debugging message.
In addition, before the preset debugging acid of use kernel, need to open this debugging acid, in this case, initialization module 150 is for opening the option that enables of debugging acid in the process of compiling kernel, and debugging acid is carried out to initialization, wherein debugging acid is carried out to initialization and comprise: the code that can not be detected in marking operation internal system; Registration event notification chain function, the abnormity notifying issuing to receive MIPS architecture processor.
Sensing point Registering modules 110 can be by obtaining assigned address, and backup is detected instruction, and will replace the function that is detected instruction and completes insertion sensing point by break-poing instruction.
The optional workflow of one of debugging module 130 is: carry out break-poing instruction, trigger breakpoint abnormal; Process function by event notice chain function call first; The instruction that is detected of backup is carried out in single step; After being detected instruction and being finished, process function by event notice chain function call second.
Above debugging acid can be the kprobe debugging acid of (SuSE) Linux OS; The first processing function is pre_handler function, and the second processing function is post_handler function.Kprobe debugging acid is an instrument of dynamically collecting debugging and performance information, uses this instrument can follow the tracks of any function or the instruction being performed and some asynchronous events.The debugging apparatus of the present embodiment has been realized the use of kprobe under MIPS framework, its groundwork mechanism is: user specifies a sensing point, and a user-defined processing functional relationships is linked to this sensing point, in the time that kernel is carried out this sensing point, corresponding correlation function is performed, and then continues to carry out normal code path.
The present invention also provides a kind of adjustment method of MIPS framework operating system nucleus, this adjustment method can be realized by the debugging apparatus of the MIPS framework operating system nucleus in above embodiment, a kind of linux kernel adjustment method easy to use of the MIPS of meeting framework is provided, Fig. 2 is the schematic diagram of the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention, and this adjustment method comprises:
Step S202, inserts sensing point at the assigned address of operating system nucleus, sensing point is processed to function associated with sensing point;
Step S204, in the time that kernel is carried out to sensing point, carries out sensing point and processes function;
Step S206, is hooked MIPS architecture processor and is collected kernel Debugging message by the preset debugging acid of kernel;
Step S208, after sensing point processing function is finished, returns to executive operating system kernel.
Before step S202, can also in the process of compiling kernel, open the option that enables of debugging acid, and debugging acid is carried out to initialization.Thereby ensure the normal work of debugging acid.Debugging acid is carried out to initialization to be comprised: the code that can not be detected in marking operation internal system; Registration event notification chain function, the abnormity notifying issuing to receive MIPS architecture processor.
The optional flow process of one that step S204 carries out sensing point processing function is: carry out break-poing instruction, trigger breakpoint abnormal; Process function by event notice chain function call first; The instruction that is detected of backup is carried out in single step; After being detected instruction and being finished, process function by event notice chain function call second.
The debugging acid using in the adjustment method of the present embodiment can be the kprobe debugging acid of (SuSE) Linux OS; The first processing function is pre_handler function, and the second processing function is post_handler function.
Fig. 3 is the architectural framework figure of kprobe instrument in the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention.As scheme kprobe framework and include architecture relevant layers, architecture irrelative layer and kernel module.In architecture relevant layers, kprobe utilizes the exception handler of processor to insert exceptional instructions built in sensing point place, thereby makes kernel enter abnormality processing, and utilizes single-step debug technology to carry out debugged instruction.Architecture irrelative layer is surveyed and is managed kprobe, mainly manages the registration and unregistration of kprobe module.Kernel module, user provides a kprobe abnormality processing function in kernel module, and the manager of articulated system structure-irrelevant layer completes the registration of kprobe.
Kprobe has realized the sensing point of three types: kprobes, jprobes and kretprobes.Kprobes is the sensing point that can be inserted into any location of instruction of kernel, and jprobes can only be inserted into the entrance of a kernel function, and kretprobes is just performed in the time that the kernel function of specifying is returned.The program of the general kprobe of use realizes makes a kernel module, and the initialization function of module is responsible for sensing point is installed, and exits function and unloads the sensing point that those are mounted.Kprobe provides interface function to install or unload sensing point.
Taking the sensing point of kprobes type as example, the instruction of the position being detected is replaced with break-poing instruction by kprobe, after being performed, break-poing instruction can notify kprobes by the notifier_call_chain mechanism of event notice chain function, the kprobes pre_handler function interface that first invoke user is specified.After carrying out pre_handler interface, can single step carry out original instruction, if user has also specified post_handler function interface, can call end process after post_handler function interface.
Fig. 4 is the flowchart of kprobe instrument in the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention.The adjustment method of the MIPS framework operating system nucleus of embodiments of the invention can be applied in the process that MIPS processor debugs the kernel of Linux2.6 and above version, for example, on up-to-date Loongson server or acceptance of the bid kylin advanced server operating system basis, realize.The adjustment method of the present embodiment is used kprobe kernel debugging technique, is not revising on the basis of existing kernel code, can following flow process carry out:
First enable kprobe, namely CONFIG_KPROBES being set when kernel is y, with the registration that completes kprobe module with enable.When kernel is default, do not enable kprobe, therefore need it to carry out enable operation, in order to enable kprobe, must in the time of compiling kernel, CONFIG_KPROBES be set is y, is chosen in " kprobes " in " Instrumentation Support ".Dynamically to load and unload kprobe module in order realizing, also to need to arrange " Loadable module support " and " Module unloading " and be set to y.Further, expect the address that is detected function at needs, also need to guarantee that it is also y that CONFIG_KALLSYMS or CONFIG_KALLSYMS_ALL arrange.
Then, a given address in the kernel of operation, write break point instruction in this given address, inserts a sensing point, carries out debugging work;
Finally, kprobe module hook is lived processor and is collected kernel Debugging message.
A processing functional relationships can be set in above step and be linked to this sensing point, this processing function is defined by the user.In the time that kernel is carried out this sensing point, the processing function that this sensing point is associated is performed, and has replaced original sensing point code by this processing function, after processing function is finished, continues to carry out normal code path.
In the initialization procedure of kprobes module, having marked which code can not be detected, which code belongs to the key code that kprobe realizes, and also mainly comprises a notice chain function of registration in initialized process, receives the abnormity notifying coming under MIPS architecture processor.
Registration kprobe module, comprise particularly and obtain sensing point address, preserve in the situation of original instruction and distribute a new address to this sensing point, and the order code of sensing point is revised as to BRK_KPROBE_BP, comprise that in addition the architecture irrelative layer of kprobe module is to a series of management work of kprobe module.
In above process of collecting kernel Debugging message, can in the situation that existing pre_handler function, judgement live processor by kprobe module hook, obtain sensing point address, distribute a new address and preserve original instruction, and the instruction code of this sensing point is revised as to BRK_KPROBE_BP.
After having registered, the execution flow process of kprobe is as follows: in the time that kprobe carries out sensing point, trigger abnormal, this belongs to the operation Break point abnormality processing of kernel thread extremely, in the time carrying out to this address, will inevitably trigger the treatment scheme do_bp of BRK_KPROBE, in treatment scheme, trigger the notice chain function of kprobe registration, according to the notice chain function triggering, finally can select to enter first of user's registration and process function pre_handler, carry out the detection information that user inserted before sensing point, now can under the effect of Thread control, activate the notice chain function of registration.Preserve corresponding address and register, internally nuclear properties arranges and is adjusted into single-step debug pattern, for the execution of post_handler function is prepared.Program starts to carry out the instruction a little that is detected of preserving.
Can continue to trigger do_bp abnormality processing flow process owing to having opened single-step debug pattern, having executed to be detected after an instruction, and again trigger the notice chain function of kprobe registration.
According to the notice chain triggering, can select to enter second of user's registration and process function post_handler, carry out the detection information that user inserts after sensing point.
In the end, in a step, the processing that single step is abnormal, removes single step mark, recovers the register being saved and finally returns, and program continues normal execution, next enters normal code implementation period.In addition, can also revise by kprobe module the value of register value and global data structures.
The above flow process of the present embodiment is tested in acceptance of the bid kylin advanced server operating system build17 version, its mainboard be loongson3A-780E single channel mainboard in the time of compiling kprobe, kernel development bag and header file bag need to be first installed.
For above test result, use the scheme of the present embodiment can realize following effect: the kernel that (1) is used this method to realize based on more than Godson platform Linux2.6 version is developed expeditiously and debugs; (2) realize the search function of overall sensing point details, made user have one comprehensively to understand to the debugging mode of current kprobe; (3) for the sensing point of kprobe provides inner core timer, user can define the effective time of sensing point, makes kernel debugging more flexible; (4) utilization/proc file system derives control documents to each sensing point, realize the function that sensing point opens and closes, user can open in needs, timing or close certain sensing point and can obtain the information of current sensing point, effectively each sensing point managed; (5) utilize array of function pointer to realize the function of single sensing point multiprocessing means, can not select in the same time applicable debugging method, greatly improved dirigibility and the debugging efficiency of debugging.
Fig. 5 is that in the adjustment method of MIPS framework operating system nucleus according to an embodiment of the invention, kprobe loads and unloading process flow diagram, in this flow process, first opens the operating system of MIPS framework, compiles the kprobe in the present embodiment in this operating system; Then insert the kprobe generating; By in type information observing system/var/log/message in the detection information of new input; Debugging finishes, unloading kprobe.
For completing this process, kprobe to operation kernel in the write break point instruction of given address, insert a sensing point.When installing when a kprobes sensing point, first kprobe can back up the instruction being detected, carry out to be detected instruction time first can to trigger breakpoint abnormal, kprobes hooks (hook in) MIPS processor and collects Debugging message.
Kprobe can single step carry out the instruction being detected, and is completed by the single step abnormality processing of kernel thread.The sensing point inserting can have multiple, and the position of its insertion can be arranged in processor, register or global data message structure, and in the situation that not restarting or rebuilding kernel, this process can be carried out again and again.
Kprobe has interface, and this interface can be made a forcible entry into any kernel routine, and collects any information from interrupt handler interference-free, has facilitated it is expanded.The sensing point that kprobe is each type provides registration and unloading function, as register_kprobe, register_jprobe, register_kretprobe, sensing point, the sensing point of jprobes type and the sensing point of kretprobes of a kprobes type of corresponding registration respectively, has a unloading function unregister_*probe accordingly for each registration function.
In the time that kprobes sensing point is installed, first kprobe backs up the instruction being detected, and then replaces by break-poing instruction first or the several byte that are detected instruction.In the time that CPU carries out sensing point, to carry out trap operation because of running interruption instruction, that will cause preserving the register of processor, call corresponding trap and process function, and trap processes all notice chain functions of will the call corresponding notifier_call_chain registration of function, kprobe realizes surveying and processes by be associated with the processing function of sensing point to notifier_call_chain registration corresponding to trap just.In the time that the notice chain of kprobe registration is performed, first it carry out the pre_handler function that is associated with sensing point, and the register of a corresponding kprobe structure and preservation is as the parameter of this function, then, the backup that is detected instruction is carried out in kprobe single step, finally, kprobe carries out post_handler.After all these operations, immediately following normally being carried out at the instruction stream being detected after instruction.
Jprobe sensing point is being detected realizing of function entrance by registration kprobes, can enable seamless access be detected the parameter of function.Jprobe process function should be detected function and have same prototype, and this processing function must call the function jprobe_return () that kprobe provides at function end.In the time carrying out this sensing point, the some parts of kprobe back-up processing device register and stack, then modify instruction register points to jprobe and processes function, in the time carrying out this jprobe processing function, what register and stack contents and execution were real is detected function striking resemblances, therefore it is without any need for just energy access function parameter of special processing, carry out when last at this processing function, it calls jprobe_return (), that causes register and stack to return to the state while carrying out sensing point, and being therefore detected function can normally be moved.It is noted that the parameter that is detected function may transmit by stack, also may pass through register transfer, but jprobe, for either way working, because it had both backed up stack, has backed up again register, certainly, prerequisite be jprobe process function prototype must be with to be detected function just the same.
Kretprobe can realize with kprobes, when calling register_kretprobe (), user carries out Kretprobe sensing point when registration, kprobe has set up a sensing point at the entrance that is detected function, in the time carrying out sensing point, kprobe has preserved and has been detected the return address of function and replaces the address that return address is a springboard function (trampoline), kprobe in the time of initialization, defined this springboard function and for this springboard function registration a kprobe, in the time being detected function and carrying out its link order, control is delivered to this springboard function, therefore the chartered processing function corresponding to springboard function of kprobe will be performed, and this processing function can invoke user be associated with the processing function on this kretprobe, after being disposed, order register is set and points to the function return address of having backed up, thereby original function returns and is normally carried out.
The adjustment method of the MIPS framework operating system nucleus of the present embodiment is by inserting sensing point and carrying out sensing point at sensing point and process function, hook up MIPS architecture processor to collect Debugging message, meet the linux kernel commissioning requirements of MIPS architecture processor, use simply, debugging efficiency is high.
Further, adjustment method of the present invention has realized kprobe debugging acid in MIPS framework, not revising on the basis of existing code, follows the tracks of flexibly the execution of kernel function.In the instructions that provided herein, a large amount of details are described.But, can understand, embodiments of the invention can be put into practice in the situation that there is no these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature instead of further feature included in other embodiment, the combination of the feature of different embodiment means within scope of the present invention and forms different embodiment.For example, in claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
So far, those skilled in the art will recognize that, illustrate and described of the present invention multiple exemplary embodiment although detailed herein, but, without departing from the spirit and scope of the present invention, still can directly determine or derive many other modification or the amendment that meet the principle of the invention according to content disclosed by the invention.Therefore, scope of the present invention should be understood and regard as and cover all these other modification or amendments.

Claims (10)

1. an adjustment method for MIPS framework operating system nucleus, is characterized in that comprising:
Assigned address at operating system nucleus inserts sensing point, described sensing point and sensing point is processed to function associated;
In the time that described kernel is carried out to described sensing point, carry out described sensing point and process function;
Hook MIPS architecture processor and collect kernel Debugging message by the preset debugging acid of described kernel;
After described sensing point processing function is finished, returns and carry out described operating system nucleus.
2. method according to claim 1, is characterized in that, before the assigned address of operating system nucleus inserts sensing point, also comprises:
In the process of the described kernel of compiling, open the option that enables of described debugging acid, and described debugging acid is carried out to initialization.
3. method according to claim 2, is characterized in that, described debugging acid is carried out to initialization and comprise:
The code that can not be detected in operating system inside described in mark;
Registration event notification chain function, the abnormity notifying issuing to receive described MIPS architecture processor.
4. according to the method in any one of claims 1 to 3, it is characterized in that, insert sensing point at the assigned address of operating system nucleus and comprise:
Obtain described assigned address;
Backup is detected instruction, and is detected instruction described in use break-poing instruction is replaced.
5. method according to claim 4, is characterized in that, carries out described sensing point processing function and comprises:
Carry out described break-poing instruction, trigger breakpoint abnormal;
Process function by described event notice chain function call first;
Described in single step execution backup, be detected instruction;
Described be detected instruction and be finished after, process function by described event notice chain function call second.
6. method according to claim 5, is characterized in that,
Described debugging acid is the kprobe debugging acid of (SuSE) Linux OS;
Described the first processing function is pre_handler function, and described the second processing function is post_handler function.
7. a debugging apparatus for MIPS framework operating system nucleus, is characterized in that comprising:
Sensing point Registering modules, inserts sensing point for the assigned address at operating system nucleus, described sensing point and sensing point is processed to function associated;
Function execution module, when carrying out to described sensing point at described kernel, carries out described sensing point and processes function;
Debugging module, for being hooked MIPS architecture processor and collected kernel Debugging message by the preset debugging acid of described kernel;
Return to module, after being finished at described sensing point processing function, returning and carry out described operating system nucleus.
8. device according to claim 7, is characterized in that, also comprises:
Initialization module, for opening the option that enables of described debugging acid in the process of the described kernel of compiling, and carries out initialization to described debugging acid, wherein
Described debugging acid is carried out to initialization to be comprised: the code that can not be detected in operating system inside described in mark; Registration event notification chain function, the abnormity notifying issuing to receive described MIPS architecture processor.
9. according to the device described in claim 7 or 8, it is characterized in that,
Sensing point Registering modules also for: obtain described assigned address; Backup is detected instruction, and is detected instruction described in use break-poing instruction is replaced.
10. device according to claim 9, is characterized in that, described debugging module also for:
Carry out described break-poing instruction, trigger breakpoint abnormal;
Process function by described event notice chain function call first;
Described in single step execution backup, be detected instruction;
Described be detected instruction and be finished after, process function by described event notice chain function call second.
CN201410256504.XA 2014-06-10 2014-06-10 Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel Pending CN104077220A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410256504.XA CN104077220A (en) 2014-06-10 2014-06-10 Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410256504.XA CN104077220A (en) 2014-06-10 2014-06-10 Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel

Publications (1)

Publication Number Publication Date
CN104077220A true CN104077220A (en) 2014-10-01

Family

ID=51598488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410256504.XA Pending CN104077220A (en) 2014-06-10 2014-06-10 Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel

Country Status (1)

Country Link
CN (1) CN104077220A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106169049A (en) * 2016-07-12 2016-11-30 北京金山安全软件有限公司 Method and device for processing thread registration and electronic equipment
CN106228062A (en) * 2016-07-12 2016-12-14 北京金山安全软件有限公司 Method and device for processing process registration and electronic equipment
CN108229155A (en) * 2017-12-27 2018-06-29 山东华软金盾软件股份有限公司 A kind of linux system user's operation behavior auditing method
CN109558325A (en) * 2018-12-03 2019-04-02 浪潮电子信息产业股份有限公司 A kind of delay statistics method, apparatus and computer readable storage medium
CN111782476A (en) * 2020-06-30 2020-10-16 Oppo广东移动通信有限公司 Temperature control method, temperature control device, storage medium and electronic equipment
CN113568796A (en) * 2021-08-04 2021-10-29 上海肇观电子科技有限公司 Module testing method and device
CN113821439A (en) * 2021-09-23 2021-12-21 成都欧珀通信科技有限公司 Method, device, storage medium and terminal for registering function to probe point
WO2021253855A1 (en) * 2020-06-19 2021-12-23 浪潮电子信息产业股份有限公司 Information recording method, apparatus, and device, and readable storage medium
CN116795726A (en) * 2023-08-25 2023-09-22 麒麟软件有限公司 Method for online debugging Linux kernel

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214132A (en) * 2011-05-16 2011-10-12 曙光信息产业股份有限公司 Method and device for debugging Loongson central processing unit (CPU), south bridge chip and north bridge chip
CN102301344A (en) * 2011-07-06 2011-12-28 华为技术有限公司 Method for debugging kernel of operating system and virtual debugging service module
CN102722438A (en) * 2012-06-01 2012-10-10 北京神州绿盟信息安全科技股份有限公司 Kernel debugging method and equipment
CN103761175A (en) * 2013-11-25 2014-04-30 中国科学院计算技术研究所 System and method for monitoring program execution paths under Linux system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214132A (en) * 2011-05-16 2011-10-12 曙光信息产业股份有限公司 Method and device for debugging Loongson central processing unit (CPU), south bridge chip and north bridge chip
CN102301344A (en) * 2011-07-06 2011-12-28 华为技术有限公司 Method for debugging kernel of operating system and virtual debugging service module
CN102722438A (en) * 2012-06-01 2012-10-10 北京神州绿盟信息安全科技股份有限公司 Kernel debugging method and equipment
CN103761175A (en) * 2013-11-25 2014-04-30 中国科学院计算技术研究所 System and method for monitoring program execution paths under Linux system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
J. SUN: "The Study of Data Collecting Based on Kprobe", 《COMPUTATIONAL INTELLIGENCE AND DESIGN (ISCID), 2011 FOURTH INTERNATIONAL SYMPOSIUM》 *
SZBRYAN: "linux内核kprobe文档", 《HTTP:\\BLOG.CHINAUNIX.NETUID-29004880-ID-4038702.HTML》 *
李清干;邵作之: "Linux内核调试工具Kprobe机制的研究", 《中国电力教育》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106228062A (en) * 2016-07-12 2016-12-14 北京金山安全软件有限公司 Method and device for processing process registration and electronic equipment
CN106169049B (en) * 2016-07-12 2019-04-09 珠海豹趣科技有限公司 A kind of method, apparatus and electronic equipment of the registration of processing thread
CN106228062B (en) * 2016-07-12 2019-04-26 珠海豹趣科技有限公司 A kind of method, apparatus and electronic equipment for the treatment of progress registration
CN106169049A (en) * 2016-07-12 2016-11-30 北京金山安全软件有限公司 Method and device for processing thread registration and electronic equipment
CN108229155A (en) * 2017-12-27 2018-06-29 山东华软金盾软件股份有限公司 A kind of linux system user's operation behavior auditing method
CN108229155B (en) * 2017-12-27 2021-05-14 山东华软金盾软件股份有限公司 Linux system user operation behavior auditing method
CN109558325A (en) * 2018-12-03 2019-04-02 浪潮电子信息产业股份有限公司 A kind of delay statistics method, apparatus and computer readable storage medium
WO2021253855A1 (en) * 2020-06-19 2021-12-23 浪潮电子信息产业股份有限公司 Information recording method, apparatus, and device, and readable storage medium
CN111782476A (en) * 2020-06-30 2020-10-16 Oppo广东移动通信有限公司 Temperature control method, temperature control device, storage medium and electronic equipment
CN113568796A (en) * 2021-08-04 2021-10-29 上海肇观电子科技有限公司 Module testing method and device
CN113821439A (en) * 2021-09-23 2021-12-21 成都欧珀通信科技有限公司 Method, device, storage medium and terminal for registering function to probe point
CN116795726A (en) * 2023-08-25 2023-09-22 麒麟软件有限公司 Method for online debugging Linux kernel
CN116795726B (en) * 2023-08-25 2023-11-28 麒麟软件有限公司 Method for online debugging Linux kernel

Similar Documents

Publication Publication Date Title
CN104077220A (en) Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel
CN105745626B (en) Diagnosis production application based on process snapshot
Long et al. Automatic runtime error repair and containment via recovery shepherding
US7950001B2 (en) Method and apparatus for instrumentation in a multiprocessing environment
US9727436B2 (en) Adding a profiling agent to a virtual machine to permit performance and memory consumption analysis within unit tests
US8370816B2 (en) Device, method and computer program product for evaluating a debugger script
CN102422261B (en) Exception raised notification
US9135082B1 (en) Techniques and systems for data race detection
US8806447B2 (en) Step-type operation processing during debugging by machine instruction stepping concurrent with setting breakpoints
US20150006961A1 (en) Capturing trace information using annotated trace output
EP3568767B1 (en) Efficient breakpoint detection via caches
CN104380264A (en) Run-time instrumentation reporting
US8799716B2 (en) Heap dump occurrence detection
CN105740112A (en) Method for automatically detecting hardware information in Linux when boot is carried out
CN107168773A (en) Positioning problems and the processing method and processing device of application recovery after a kind of JVM collapses
US10740166B2 (en) Thread based dynamic data collection
CN115373997A (en) Board card firmware abnormity monitoring and core data exporting method of multi-core SoC
CN107885650A (en) A kind of program debugging method and system
US11030075B2 (en) Efficient register breakpoints
CN112740187A (en) Method and system for debugging program
Dovgalyuk et al. Don't panic: reverse debugging of kernel drivers
Imtiaz et al. Automatic platform-independent monitoring and ranking of hardware resource utilization
CN109726115A (en) It is a kind of based on Intel processor tracking anti-debug automatically bypass method
Yim et al. Pluggable watchdog: Transparent failure detection for MPI programs
KR102462864B1 (en) Apparatus and method for dynamic binary instrumentation using multi-core

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20141001