GB2548398A - Tracing processing activity - Google Patents

Tracing processing activity Download PDF

Info

Publication number
GB2548398A
GB2548398A GB1604606.2A GB201604606A GB2548398A GB 2548398 A GB2548398 A GB 2548398A GB 201604606 A GB201604606 A GB 201604606A GB 2548398 A GB2548398 A GB 2548398A
Authority
GB
United Kingdom
Prior art keywords
trace data
trace
data
processing
items
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
Application number
GB1604606.2A
Other versions
GB201604606D0 (en
GB2548398B (en
Inventor
grant Alasdair
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.)
ARM Ltd
Original Assignee
ARM Ltd
Advanced Risc Machines 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 ARM Ltd, Advanced Risc Machines Ltd filed Critical ARM Ltd
Priority to GB1604606.2A priority Critical patent/GB2548398B/en
Publication of GB201604606D0 publication Critical patent/GB201604606D0/en
Priority to CN201780016743.XA priority patent/CN108885577A/en
Priority to PCT/GB2017/050750 priority patent/WO2017158377A1/en
Priority to KR1020187029294A priority patent/KR102346253B1/en
Priority to US16/083,640 priority patent/US10909020B2/en
Publication of GB2548398A publication Critical patent/GB2548398A/en
Application granted granted Critical
Publication of GB2548398B publication Critical patent/GB2548398B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/348Circuit details, i.e. tracer hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3024Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3072Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
    • G06F11/3082Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting the data filtering being achieved by aggregating or compressing the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks

Abstract

Data processing circuitry 20 comprises a processing element 40 configured to perform processing activities, a trace data store 64 and trace circuitry (e.g. an embedded trace macrocell, ETM 60) to generate items of trace data indicative of processing activities of the processing element and to store the items of trace data in the trace data store. The trace circuitry comprises detection circuitry 62 to detect a condition relating to an outcome (e.g. completion within a threshold period) of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition. The discarding of the stored items can be done by setting a position indicator, which indicates the next available storage position to write data, to indicate a position where a datum to be discarded is stored. The detection circuitry may be configured to discard all items of stored data by setting the indicator to the first position. The

Description

TRACING PROCESSING ACTIVITY
BACKGROUND
This disclosure relates to tracing processing activity.
There are a number of occasions where it is desirable to keep track of the processing activities being performed by a processing element such as a central processing unit (CPU). For example, such information is useful during the development of data processing apparatus. An example of a tool that may be used to assist in such a process is a tracing tool.
Tracing the activity of a processing element whereby a trace stream is generated that includes data representing the step-by-step activity within the system is therefore a highly useful tool in system development. Such tracing tools use a variety of means for tracing the program flow including embedded trace macrocelis (ETM, a trademark of ARM Limited, Cambridge) which are present on the chip whose processing is being monitored, in some instances the trace data is acquired and stored with a timestamp. Examples of these processes include ETM trace, statistical profiling and embedded logic analysis.
These tracing tools can be used to reconstruct the state of a machine at a certain point during execution of the instruction stream. They are relevant to detecting or diagnosing problems or other abnormal machine behaviour during execution of the instruction stream.
SUMMARY
In an example arrangement there is provided data processing circuitry comprising a processing element configured to perform processing activities; a trace data store; and trace circuitry to generate items of trace data indicative of processing activities of the processing element and to store the items of trace data in the trace data store; the trace circuitry comprising detection circuitry to detect a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
In another example arrangement there is provided trace apparatus comprising; trace circuitry to generate items of trace data indicative of processing activities of a processing element and to store the items of trace data in a trace data store; the trace circuitry comprising detection circuitry to detect a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
In another example arrangement there is provided data processing circuitry comprising processing means for performing processing activities; means for storing trace data; and trace means for generating items of trace data indicative of processing activities of the processing means and for storing the items of trace data in the storing means; the trace means comprising detecting means for detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the storing means and for seiectively discarding at ieast some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition. in another example arrangement there is provided trace apparatus comprising: trace means for generating items of trace data indicative of processing activities of the processing means and for storing the items of trace data in the storing means; the trace means comprising detecting means for detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the storing means and for selectively discarding at ieast some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition. in another example arrangement there is provided a method comprising: generating items of trace data indicative of processing activities of a processing element; storing the items of trace data in a trace data store; detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store; and selectively discarding at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
Further respective aspects and features of the present technology are defined by the appended claims.
BRIEF DESCRIPTION OF THE DRAWINGS
The present technique will be described further, by way of example only, with reference to embodiments thereof as iilusiraied in the accompanying drawings, in which:
Figure 1 schematically illustrates a data processing apparatus;
Figure 2 schematically illustrates a framing operation;
Figure 3 schematically illustrates a trace data buffer;
Figure 4 schematically illustrates a circular trace data buffer;
Figure 5 is a schematic flowchart illustrating a data processing method;
Figures 6 and 7 schematically illustrate respective examples of selected steps of Figure 5;
Figure 8 schematically illustrates example steps relating to execution of interrupt handling;
Figure 9 schematically illustrates the storing and discarding of stored trace data;
Figures 10 and 11 schematically illustrate circular buffer techniques relating to trace data;
Figures 12 and 13 provide schematic examples of other data processing apparatus; and
Figure 14 schematically illustrates example steps relating to execution of a data transfer operation.
DESCRIPTION OF EMBODIMENTS
Before discussing the embodiments with reference to the accompanying figures, the following description of embodiments is provided.
An example embodiment provides data processing circuitry comprising; a processing element configured to perform processing activities; a trace data store; and trace circuitry to generate items of trace data indicative of processing activities of the processing element and to store the items of trace data in the trace data store; the trace circuitry comprising detection circuitry to detect a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
The present techniques recognise that in a system in which trace data is collected and stored, the volume of data involved can be very large. This can lead to issues with the storage space occupied by the data and the processing needed to retrieve and handle the data. The techniques also recognise that sometimes it is not known, until after the trace data has been acquired and stored, whether the trace data is useful. Here, the term “useful” could (for example) indicate that the trace data is relevant to a fault or abnormal operating condition. In these circumstances, the present disclosure provides an arrangement in which the trace data in respect of a given processing activity is stored but then the question of whether or not to subsequently discard the trace data relating to the given processing activity is predicated or dependent upon detection of a condition relating to an outcome of the given processing activity. For example if the given processing activity completes its operation successfully and/or in a timely manner, at least some of the trace data relating to that given processing activity may be discarded. If the detection indicates that the given processing activity has not completed its operation successfully and/or in a timely manner, the trace data can be retained (not discarded), in this way, in examples, trace data can be recorded in case a processing activity operates abnormally, but retained only if a subsequent detection indicates such abnormal behaviour.
Embodiments of the disclosure can therefore provide for the storage of trace data which is relevant to processing activities which have an outcome meeting one or more certain conditions, but the discarding of other trace data. These measures can alleviate the problems discussed above.
In examples, the trace data store is a buffer having an associated order of data item storage and an indicator to indicate a next available storage position, in the order of data item storage; and the detection circuitry is configured to discard stored items of trace data relating to the given processing activity by setting the indicator to indicate, as a next available storage position, a storage position in the trace data store at which an item of trace data relating to the given processing activity is stored. So, for example, stored trace data can be discarded by moving the indicator (for example, a write pointer) back to a position within the stored trace data. VWiile this might not immediately overwrite the discarded trace data, it means that the discarded trace data will be overwritten by trace data stored next.
It is possible to retain some of the trace data relating to a processing activity for which a “discard” outcome has been detected. For example, a first or header portion of the trace data could be retained, for example in order to indicate to later analysis that the given processing activity completed successfully such that no further trace data was retained. To achieve this, the indicator or write pointer could be returned (as part of the discarding process) to a position within the stored trace data for the given activity, other than a first position (in the order of data item storage). However, in other examples, the detection circuitry is configured to discard all of the stored items of trace data relating to the given processing activity by setting the indicator to indicate, as a next available storage position, a first storage position in the order of data item storage at which an item of trace data relating to the given processing activity is stored. in examples, the detection circuitry is configured to store, in response to initiation of a processing activity, a current state of the indicator. This can allow the indicator to be returned to that stored state (ready for storage of trace data for a next processing activity) in response to the detection circuitry discarding the stored trace data for the given processing activity, in some examples, the detection circuitry is configured to discard all the stored items of data trace relating to the given processing activity by setting the indicator to indicate, as a next available storage position, the indicator value stored in response to initiation of the given processing activity.
The trace data store may be a circular buffer in which, when the indicator reaches a limit position in the order of data item storage, the indicator is adjusted so that a next available storage position is a preceding position in the order of data item storage. In some examples, the limit position is a last storage position in the trace data store so that trace data relating to a processing activity can occupy space up to the end of the buffer before the circular buffer wraps around to the preceding position. In other examples, however, the limit position is no more than a limit number of storage positions, in the order of data item storage, from a first storage position at which an item of trace data relating to the given processing activity is stored, in these examples, the amount of buffer space which can be occupied by trace data relating to an individual processing activity is capped at the limit number of storage positions. This can avoid the buffer being excessively filled by trace data relating to an individual processing activity.
In terms of the wrap around operation of such a circular buffer, in some examples the preceding position (which the indicator returns to in response to reaching the limit position) can be the start of the buffer in the order of data item storage. However, in other examples, the preceding position (which the indicator returns to in response to reaching the limit position) is a first available storage position after, in the order of data item storage, stored items of trace data which were not discarded by the detection circuitry. In this way, previously stored and not-discarded trace data is retained while still allowing operation as a circular buffer, in examples, the circular buffer simply gets smaller as more and more trace data is retained (not discarded).
Various conditions relating to the outcome of the given data processing operation may be detected. In examples, the detection circuitry is configured to detect, as a condition, a period since initiation of the given processing activity. For example, the detection circuitry may be configured to discard stored items of trace data relating to the given processing activity when the period since initiation of the given processing activity is less than a threshold period when the given processing activity reaches a predetermined stage. Here, a processing activity which takes longer than the threshold period has its trace data not discarded, whereas a processing activity which takes less than the threshold period has its trace data discarded, in this way, for example by setting the threshold period at (or just above) a normal processing time for the given processing activity, processing activities which are abnormally slow can have their trace data retained, for example so that a cause of the slow operation can be investigated. The “period” could be expressed in terms of time, processing dock cycles or another measure. The predetermined stage may be completion of the given processing activity. An example of such a processing activity to which this arrangement is suited is the handling of a processor interrupt.
In other examples, the detection circuitry is configured to discard stored items of trace data relating to the given processing activity in response to a detection of successful completion of the given processing activity. This provides for the retention of trace data in respect of processing activities which did not successfully complete.
In some examples, the processing element is configured to execute program instructions; and the processing activities relate to the execution of groups of program instructions. However, the techniques for generating and storing trace data do not necessarily apply only to the execution of data processing instructions. In some other examples, the processing element comprises logic circuitry to execute logical operations; and the processing activities relate to the execution of one or more logical operations. In some other examples, the processing element comprises circuitry to transfer data from a source to a destination; and the processing activities relate to data transfer operations.
Another example embodiment provides trace apparatus comprising; trace circuitry to generate items of trace data indicative of processing activities of a processing element and to store the items of trace data in a trace data store; the trace circuitry comprising detection circuitry to detect a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
Another example embodiment provides data processing circuitry comprising: processing means for performing processing activities; means for storing trace data; and trace means for generating items of trace data indicative of processing activities of the processing means and for storing the items of trace data in the storing means; the trace means comprising detecting means for detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the storing means and for selectively discarding at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
Another example embodiment provides trace apparatus comprising: trace means for generating items of trace data indicative of processing activities of the processing means and for storing the items of trace data in the storing means; the trace means comprising detecting means for detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the storing means and for selectively discarding at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
Another example embodiment provides a method comprising; generating items of trace data indicative of processing activities of a processing element; storing the items of trace data in a trace data store; detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store; and selectively discarding at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
Referring now to the drawings, Figure 1 schematically illustrates a data processing apparatus or circuitry 10 comprising a processor 20 connected to a memory 30. The arrangement of Figure 1 (or at least the processor 20) may be implemented as a single integrated circuit or a part of a single integrated circuit.
The processor 20 comprises a processing element (such as a central processing unit or CPU) 30 which can access the memory 30 (for example, by way of a cache memory, not shown) and a trace apparatus 50 in the form of an embedded trace macroceli (ETM) 60 and framing circuitry 70. Optionally, trace circuitry 42 can be provided within the processing element 40, cooperating with the trace apparatus 50 to carry out the functions of the trace apparatus. The trace apparatus is configured to generate and store Items of trace data indicative of processing activities of the processing element.
The processing element 40 executes a stream of instructions, as an example of a processing element configured to perform processing activities.
The trace apparatus comprises trace circuitry to generate items of trace data indicative of processing activities of a processing element and to store the items of trace data in a trace data store. For example the trace data may indicate the nature or identity of instructions executed by the processing element, data values acted upon and/or generated by the execution of those instructions, the state of one or more processor registers, the state and progress of data transfers and the like. These items of trace data are generated in response to the activities of the processing element, or in other words contemporaneously with the processing activities.
Although the ETM 60 could comprise its own storage for trace data, in the present example the memory 30 acts as the trace data store, items of trace data generated by the ETM 60 may be in the form of individual bytes or words and are collated by the framing circuitry 70 into groups or frames of, for example, 16 bytes before being written out to the memory 30. Therefore, the memory 30 provides an example of a trace data store.
Using techniques that will be described in more detail below, the trace circuitry comprises detection circuitry 62 to detect a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
Optionally, a trace data analyser 80 can access the stored trace data in the memory 30, for example as a post-process applied after the processing activities for which the trace data is generated and stored, to analyse the stored trace data.
Figure 2 schematically illustrates a framing operation. As mentioned above, in examples the framing circuitry assembles groups, frames or packets of a particular number of bytes or words, for example 16 bytes of trace data. As each item of trace data is generated by the ETM 60, it is added to a buffer 72 (such as a 16 byte buffer, or in other examples a buffer equal in size to 15 bytes + the maximum possible size in bytes of an item of trace data). When the buffer reaches an occupancy of at least 16 bytes, a 16 byte frame or packet is written by the framing circuitry 70 to the memory 30 and the buffer starts to refill again.
Referring to Figure 2, an upper row schematically shows three bytes 74 of trace data already assembled in the buffer 72. A middle row schematically represents a later situation at which 16 bytes of trace data have assembled in the buffer 72, in response to which the framing circuitry outputs a 16 byte packet or frame 76 to the memory 30. An area of the memory 30 can be reserved or otherwise allocated for use as the trace data store.
It vv'ill be appreciated that other packet or frame sizes could be used.
Figure 3 schematically illustrates a trace data store implemented as a region or area 300 of the memory 30. The trace data store is referred to as a buffer because of the way that - in normal operation - trace data items are written to the trace data buffer by the trace circuitry 50 and are read from the trace data buffer by the analyser 80.
As described above, data items are written to the trace data store in frames by the framing circuitry 70. They are written in a frame-by-frame order corresponding to an order of data item storage. But considering the combination of the trace data store provided by the memory 30 and the buffer 72, the two in cooperation provide a data-item-by-data-item order of data item storage, in that the trace data store in the memory 30 provides a frame-by-frame writing order and a “next frame to be written” position or pointer, and the buffer 72 provides a byte-by-byte writing order and a “next byte to be written” pointer 78. The combination of these two pointers can provide an implementation of an indicator or write pointer indicating a next data item position in the data item storage order.
The combination of the two buffers provides an example of a trace data store arranged as a buffer having an associated order of data item storage (as shown schematically by an arrow 310) and an indicator or write pointer 320 to indicate a next available storage position, in the order of data item storage. Using these techniques, a newly generated trace data item will be stored at a next position in the buffer 72 until a frame is complete, at which point the frame will be written at a next frame position in the memory 30. Therefore, the fact that the buffer 72 is used provides convenience in that the number of accesses to the memory 30 is reduced, but in other respects the buffer 72 and the trace data store 300 in the memory 30 cooperate together to provide the function of a byte-by-byte buffer having a writing order and a write pointer or indicator to indicate a next writing position.
In examples, and using techniques to be described further below, the detection circuitry is configured to discard stored items of trace data relating to the given processing activity by setting the indicator 320 to indicate, as a next available storage position, a storage position in the trace data store at which an item of trace data relating to the given processing activity is stored. In this way. although trace data to be discarded is not necessarily deleted from the trace data store, the write pointer is set so that it will be overwritten as the nextgenerated trace data is written to the trace data store.
Figure 4 schematically illustrates a circular trace data buffer in which, when the indicator or write pointer 320 reaches a limit position in the order of data item storage, the indicator is adjusted so that a next avaiiabie storage position is a preceding position in the order of data item storage. For example, the limit position may be a last storage position 330 in the trace data store and the preceding position may be a first storage position in the trace data store (both with respect to the order of data item storage), in this way, when the trace data store becomes full, writing returns to a preceding position in the trace data store, overwriting earlier-stored trace data. in either example (Figure 3 or Figure 4), the framing circuitry 30 or another part of the trace circuitry 50 can be arranged to respond to the indicator or write pointer reaching the last position 330 by issuing a message or command to the analyser 80 to retrieve the stored trace data from the trace data store.
Figure 5 is a schematic flowchart illustrating a data processing method.
At a step 500, the processing element 40 performs processing activities, for example a particular current (or “given”) processing activity. A step 510 involves the circuitry 50 generating items of trace data indicative of processing activities of the processing element and storing the items of trace data in a trace data store (the buffer 72 and the memory area 300, cooperating together as discussed above).
In examples, the steps 500, 510 operate so that trace data is not continuously stored but rather the storage of trace data for a processing activity starts in response to initiation of that processing activity. So, the processing activity can, in examples, be considered as a task or item of work to be done, which has a start and (at least under normal circumstances) an end. The start of the processing activity provides a trigger to start the saving of trace data. Example processing activities include handling a processor interrupt. Here, the interrupt can act both as the initiation of the processing activity and the trigger event (to trigger the saving of trace data). Or, the detection, by the ETM 60 of the element 40 handling an interrupt (or an interrupt of a particular type) can form the trigger event. So, although the generation of trace data might be a continuous process or might start in response to the trigger, the saving of the trace data is, in examples, initiated by the trigger event which can be the start of the particular processing activity. The ETM 60 may maintain a schedule or list of types of processing activities which, when initiated, trigger the saving of trace data. The processing activities can themselves trigger the saving of trace data, or a detection by the ETM 60 of the start of that processing activity can trigger the saving of trace data. A step 520 involves detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store. Examples of such a detection will be discussed below. A step 530 involves selectively discarding 540 (or not discarding 550) at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
Figures 6 and 7 schematicaiiy iilustrate respective exampies of selected steps of Figure 5. in each case, example versions (520’, 520”) of the step 520 are illustrated, and in each case example versions (530’, 530”) of the step 530 are illustrated. in Figure 6, the detection circuitry is configured as the step 520’ to detect, as a condition, a period since initiation of the given processing activity. For example, this can be performed by detecting 521 a start time (in units of time, or clock cycles for example. Also the start time could be defined at each instance of the step 521 as “zero”, with elapsed time then counting upwards from there). A step 522 involves detecting a current or end time. For example, the current time could be detected and (as discussed below) if it is beyond a threshold period since the start time, abnormal behaviour (and a reason not to discard the saved trace data) could be detected. This could be performed whether or not the processing activity has finished. As an alternative, the time at the end or completion of the processing activity, or at a predetermined stage within the processing activity, is detected and the period since the start time detected. Again, if this exceeds a threshold period, abnormal behaviour (and a reason not to discard the saved trace data) could be detected as a result. At the step 530’, if either type of detection leads to the conclusion that the activity has taken longer than the threshold period (whether or not the activity has completed), then the saved trace data are not discarded. Otherwise, if the activity has completed and took less than the threshold time, the saved trace data are discarded. This provides an example of the detection circuitry discarding stored items of trace data relating to the given processing activity when the period since initiation of the given processing activity is less than a threshold period when the given processing activity reaches a predetermined stage.
Figure 7 relates to a detection of whether the activity has completed. The step 520” is provided by steps 523 and 524. At the step 523, the start of an activity is detected (though this might be implicit in the whole process, given that trace data in Figure 5 is generated and stored for a processing activity, which is to say, an activity which has started). Activity completion is detected at the step 524. At the step 530” a detection of successful completion indicates that the stored trace data should be discarded; a lack of successful completion indicates that the trace data should not be discarded. This provides an example of the detection circuitry discarding stored items of trace data relating to the given processing activity in response to a detection of successful completion of the given processing activity. Therefore, in examples, the predetermined stage is completion of the given processing activity.
As a pariicuiar example of Figure 6, the steps 521’, 522’ take the place of the steps 521, 522. At the step 521 ’ the time at which a processor interrupt is initiated is detected. At the step 522’, the time period to completion of handling the interrupt is detected. A time to completion which is longer than a threshold period indicates that the trace data relating to the handling of that interrupt should not be discarded.
Figure 9 schematically illustrates the storing and discarding of stored trace data. Alongside four process steps 900...930 in Figure 9, respective schematic representations of occupancy of the trace data store are indicated.
In Figure 9, the steps 900, 910 correspond to at least a part of the functionality of the step 510 of Figure 5. At the step 900, the current state of the indicator or write pointer (WP) 940 is stored, providing an example of the detection circuitry being configured to store, in response to initiation of a processing activity, a current state of the indicator. For example, a store 64 can be used to store the WP value. Note that, as discussed above, the WP can be provided as a composite of a byte pointer 78 relating to the buffer 72 and a frame pointer relating to the memory 30. These are shown as a single byte-specific pointer 940 in Figure 9, with a stored current value being drawn in a broken line box 950.
Then, at the step 910, the trace data is stored, starting at the initial WP position, in the data item storage order 310. Stored trace data relating to the current processing activity is shown schematically by a shaded box 960. The WP is then at the next data item position after the stored trace data 960. A step 920 corresponds to the step 550 of Figure 5. To retain (not discard) the stored trace data corresponding to an activity, the stored WP value 950 Is deleted and the WP remains at its latest position. A step 930 corresponds to the step 540 of Figure 5. To discard the stored trace data, the WP 940 is overwritten by the stored WP value 950. This can leave the recently stored trace data 960 still in the trace data store, but at a position relative to the WP 940 such that it will be overwritten by the next stored trace data. The step 930 provides an example of the detection circuitry being configured to discard ail of the stored items of trace data relating to the given processing activity by setting the indicator to indicate, as a next available storage position, a first storage position in the order of data item storage at which an item of trace data relating to the given processing activity is stored. More specifically, the step 930 provides an example of the detection circuitry being configured to discard ail the stored items of data trace relating to the given processing activity by setting the indicator to indicate, as a next available storage position, the indicator value stored in response to initiation of the given processing activity. in aiternative arrangements it may be that not all of the trace data stored in respect of a given processing activity is in fact discarded. For example, the trace data may have a format which inciudes an initiai data item or header indicating the nature of the processing activity (such as “the trace data which follows relates to the handling of an interrupt of type X”), which is then followed - in the storage order - by trace data relating to the handling of that interrupt In the event that the trace data Is discarded, it is of course a possibility to discard all of the trace data including the initial or header portion. In other examples, however, it could be useful to retain the initiai or header portion but discard the remaining trace data. This can indicate to the analyser 80 that an interrupt of type X was (for example) successfully and/or timely handled, because the presence of the initiai or header portion with no corresponding following trace data implies or indicates that the subsequent trace data was discarded because the outcome of the condition detection indicated to do so. Overall, this can provide an indication to the analyser 80 of the number or volume of successfully and/or timely handled occurrences amongst the “abnormal” occurrences for which trace data was retained, in terms of possible implementations, the storage of the WP 940 as the stored value 950 (the step 900 in Figure 9} could be arranged to take place after the writing of the initial or header portion of the trace data, which then allows the remainder of the process of Figure 9 to proceed as described above. Alternatively, the writing back of the VVP at the step 930 could in fact write back “stored WP + 1” (or more generally, “stored WP + size of header portion”).
Figures 10 and 11 schematically illustrate example circular buffer techniques relating to trace data. These are variants on the circular buffer described with reference to Figure 4 above.
In both of Figures 10 and 11, the “preceding position” to which the circular buffer wraps round is in fact a position corresponding to the first data item position 1030 (in the order 310) after the last-stored non-discarded trace data item for a preceding processing activity. So, the buffer is a circular one which effectively decreases in size as each non-discarded set of processing activity trace data is stored and retained. Therefore, in these examples, preceding position is a first available storage position after, in the order of data item storage, stored items of trace data which were not discarded by the detection circuitry.
In Figure 10, the “limit position” at which the buffer wraps around is not defined as the last position in the entire trace data store (in the order 310) but is set to be no more than a limit number of storage positions 1040 from the position 1030. So, as trace data 1010 is stored and reaches a data item position corresponding to the limit number (or the end of the buffer, if sooner), the buffer wraps back to the position 1030. This limits the amount of buffer occupancy taken up by trace data relating to any individual processing activity. Therefore, in this example, the limit position is no more than a limit number of storage positions, in the order of data item storage, from a first storage position at which an item of trace data relating to the given processing activity is stored.
In an alternative arrangement shown in Figure 11, the limit position is the end of the buffer (the last storage position 330 in the order 310).
As discussed, in the example of Figure 1, the processing element is configured to execute program instructions; and the processing activities relate to the execution of groups of program instructions. However, the present techniques are applicable to other examples, and Figures 12 and 13 provide schematic examples of other data processing apparatus. Parts already described with reference to Figure 1 are not shown again. The respective arrangements of Figures 12 and 13 may be implemented as a single integrated circuit ora part of a single integrated circuit.
In the example of Figure 12, the processing element comprises logic circuitry 1200 to execute logical operations; the ETM is replaced by logic analyser circuitry (for example, an on-chip logic analyser) 1210 with an associated memory (not shown) and the processing activities relate to the execution of one or more logical operations.
In the example of Figure 13, the processing element comprises communication circuitry1300 to transfer data (via a data link shown schematically as 1320) from a source to a destination (one of which may be the circuitry 1300, or both may be other nodes, not shown), and the processing activities relate to data transfer operations. The ETM is replaced by a trace generator 1310 with an associated memory.
Figure 14 schematically illustrates example steps relating to execution of a data transfer operation in the example of Figure 13. Steps 521”, 522” replace the steps 521, 522 in Figure 6. At the step 521 ” the time at which a data transfer such a bus transfer is initiated is detected. At the step 522”, the time period to completion of handling the data transfer is detected. A time to completion which is longer than a threshold period indicates that the trace data relating to the handling of that interrupt should not be discarded.
In the present application, the words “configured to...” are used to mean that an element of an apparatus has a configuration able to carry out the defined operation. In this context, a “configuration” means an arrangement or manner of interconnection of hardware or software. For example, the apparatus may have dedicated hardware which provides the defined operation, or a processor or other processing device (such as the processing element 12) may be programmed to perform the function. “Configured to” does not imply that the apparatus element needs to be changed in any way in order to provide the defined operation.
Although illustrative embodiments of the present techniques have been described in detail herein with reference to the accompanying drawings, it is to be understood that the present techniques are not limited to those precise embodiments, and that various changes, additions and modifications can be effected therein by one skilled in the art without departing from the scope and spirit of the techniques as defined by the appended claims. For example, various combinations of the features of the dependent daims could be made vvith the features of the independent daims without departing from the scope of the present techniques.

Claims (20)

1. Data processing circuitry comprising; a processing element configured to perform processing activities; a trace data store; and trace circuitry to generate items of trace data indicative of processing activities of the processing element and to store the items of trace data in the trace data store; the trace circuitry comprising detection circuitry to detect a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
2. Data processing circuitry according to claim 1, in which; the trace data store is a buffer having an associated order of data item storage and an indicator to indicate a next available storage position, in the order of data item storage; and the detection circuitry is configured to discard stored items of trace data relating to the given processing activity by setting the indicator to indicate, as a next available storage position, a storage position in the trace data store at which an item of trace data relating to the given processing activity is stored.
3. Data processing circuitry according to claim 2, in which; the detection circuitry is configured to discard all of the stored items of trace data relating to the given processing activity by setting the indicator to indicate, as a next available storage position, a first storage position in the order of data item storage at which an item of trace data relating to the given processing activity is stored.
4. Data processing circuitry according to claim 2 or claim 3, in which the detection circuitry is configured to store, in response to initiation of a processing activity, a current state of the indicator.
5. Data processing circuitry according to claim 4, in which the detection circuitry is configured to discard all the stored items of data trace relating to the given processing activity by setting the indicator to indicate, as a next available storage position, the indicator value stored in response to initiation of the given processing activity.
6. Data processing circuitry according to any one of claims 2 to 5, in which the trace data store is a circular buffer in which, when the indicator reaches a limit position in the order of data item storage, the indicator is adjusted so that a next available storage position is a preceding position in the order of data item storage.
7. Data processing circuitry according to claim 6, in which the limit position is a last storage position in the trace data store.
8. Data processing circuitry according to claim 6, in which the limit position is no more than a limit number of storage positions, in the order of data item storage, from a first storage position at which an item of trace data relating to the given processing activity is stored,
9. Data processing circuitry according to any one of claims 6 to 8, in which the preceding position is a first available storage position after, in the order of data item storage, stored items of trace data which were not discarded by the detection circuitry.
10. Data processing circuitry according to any one of the preceding daims, in which the detection circuitry is configured to detect, as a condition, a period since initiation of the given processing activity.
11. Data processing circuitry according to claim 10, in which the detection circuitry is configured to discard stored items of trace data relating to the given processing activity when the period since initiation of the given processing activity is less than a threshold period when the given processing activity reaches a predetermined stage.
12. Data processing circuitry according to claim 11, in which the predetermined stage is completion of the given processing activity.
13. Data processing circuitry according to any one of the preceding claims, in which the detection circuitry is configured to discard stored items of trace data relating to the given processing activity in response to a detection of successful completion of the given processing activity.
14. Data processing circuitry according to any one of the preceding claims, in which; the processing element is configured to execute program instructions; and the processing activities relate to the execution of groups of program instructions.
15. Data processing circuitry according to any one of claims 1 to 13, in which; the processing element comprises logic circuitry to execute logica! operations; and the processing activities relate to the execution of one or more logical operations.
16. Data processing circuitry according to any one of claims 1 to 13, in which: the processing element comprises circuitry to transfer data from a source to a destination; and the processing activities relate to data transfer operations.
17. Trace apparatus comprising; trace circuitry to generate items of trace data indicative of processing activities of a processing element and to store the items of trace data in a trace data store; the trace circuitry comprising detection circuitry to detect a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store and to selectively discard at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
18. Data processing circuitry comprising; processing means for performing processing activities; means for storing trace data; and trace means for generating items of trace data indicative of processing activities of the processing means and for storing the items of trace data in the storing means; the trace means comprising detecting means for detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the storing means and for selectively discarding at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
19. Trace apparatus comprising: trace means for generating items of trace data indicative of processing activities of the processing means and for storing the items of trace data in the storing means; the trace means comprising detecting means for detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the storing means and for selectively discarding at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
20. A method comprising: generating items of trace data indicative of processing activities of a processing element; storing the items of trace data in a trace data store; detecting a condition relating to an outcome of a given processing activity for which items of trace data have been stored in the trace data store; and selectively discarding at least some of the stored items of trace data relating to the given processing activity in dependence upon the detected condition.
GB1604606.2A 2016-03-18 2016-03-18 Tracing processing activity Active GB2548398B (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
GB1604606.2A GB2548398B (en) 2016-03-18 2016-03-18 Tracing processing activity
CN201780016743.XA CN108885577A (en) 2016-03-18 2017-03-17 Track processing activity
PCT/GB2017/050750 WO2017158377A1 (en) 2016-03-18 2017-03-17 Tracing processing activity
KR1020187029294A KR102346253B1 (en) 2016-03-18 2017-03-17 Track processing activity
US16/083,640 US10909020B2 (en) 2016-03-18 2017-03-17 Tracing processing activity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GB1604606.2A GB2548398B (en) 2016-03-18 2016-03-18 Tracing processing activity

Publications (3)

Publication Number Publication Date
GB201604606D0 GB201604606D0 (en) 2016-05-04
GB2548398A true GB2548398A (en) 2017-09-20
GB2548398B GB2548398B (en) 2019-12-11

Family

ID=55968518

Family Applications (1)

Application Number Title Priority Date Filing Date
GB1604606.2A Active GB2548398B (en) 2016-03-18 2016-03-18 Tracing processing activity

Country Status (5)

Country Link
US (1) US10909020B2 (en)
KR (1) KR102346253B1 (en)
CN (1) CN108885577A (en)
GB (1) GB2548398B (en)
WO (1) WO2017158377A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2548398B (en) * 2016-03-18 2019-12-11 Advanced Risc Mach Ltd Tracing processing activity

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120246518A1 (en) * 2011-03-24 2012-09-27 International Business Machines Corporation Operating a computer system

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7058928B2 (en) * 1999-12-23 2006-06-06 Identify Software Ltd. System and method for conditional tracing of computer programs
US7870431B2 (en) * 2002-10-18 2011-01-11 Computer Associates Think, Inc. Transaction tracer
CN100571201C (en) * 2004-03-11 2009-12-16 松下电器产业株式会社 Control station device, base station apparatus, terminal installation, packet communication system and block communication method
CN100484037C (en) * 2007-03-14 2009-04-29 华为技术有限公司 Device tracking system, device and method
GB2473850A (en) * 2009-09-25 2011-03-30 St Microelectronics Cache configured to operate in cache or trace modes
EP2553582A1 (en) * 2010-03-26 2013-02-06 Software Diagnostics Technology GmbH A method for automatically generating a trace data set for a software system, a computer system, and a computer program product
JP5529686B2 (en) * 2010-09-03 2014-06-25 萩原電気株式会社 Computer apparatus abnormality inspection method and computer apparatus using the same
JP5500272B2 (en) * 2011-02-09 2014-05-21 富士通株式会社 Relay device, relay history recording method, and data processing device
US8943369B2 (en) * 2011-02-21 2015-01-27 Texas Instruments Incorporated Prioritizing stall/reason data into priority information stream over PC/data trace
US8776029B2 (en) * 2011-03-23 2014-07-08 Zerodee, Inc. System and method of software execution path identification
JP5756059B2 (en) * 2012-06-29 2015-07-29 日本電信電話株式会社 Communication system and abnormality detection method
US9069896B2 (en) * 2012-08-29 2015-06-30 Freescale Semiconductor, Inc. Data processor device for handling a watchpoint and method thereof
JP6428005B2 (en) * 2014-07-10 2018-11-28 富士通株式会社 Information processing apparatus, information processing method, and information processing program
US20170187587A1 (en) * 2015-12-26 2017-06-29 David Keppel Technologies for inline network traffic performance tracing
GB2548398B (en) * 2016-03-18 2019-12-11 Advanced Risc Mach Ltd Tracing processing activity

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120246518A1 (en) * 2011-03-24 2012-09-27 International Business Machines Corporation Operating a computer system

Also Published As

Publication number Publication date
US20190065335A1 (en) 2019-02-28
GB201604606D0 (en) 2016-05-04
US10909020B2 (en) 2021-02-02
KR102346253B1 (en) 2022-01-03
WO2017158377A1 (en) 2017-09-21
CN108885577A (en) 2018-11-23
KR20180122409A (en) 2018-11-12
GB2548398B (en) 2019-12-11

Similar Documents

Publication Publication Date Title
JP4225851B2 (en) Trace element generation system for data processor
US6901581B1 (en) Method for software debugging via simulated re-execution of a computer program
US8370687B2 (en) Mechanism for storing and extracting trace information using internal memory in micro controllers
US7886195B2 (en) Apparatus, system, and method of efficiently utilizing hardware resources for a software test
JP4987182B2 (en) Computer system
US20070220361A1 (en) Method and apparatus for guaranteeing memory bandwidth for trace data
CN102521098B (en) Processing method and processing device for monitoring dead halt of CPU (Central Processing Unit)
TWI416316B (en) Techniques for generating a trace stream for a data processing apparatus
US10162324B2 (en) Method for manipulating a control program of a control device
US10909020B2 (en) Tracing processing activity
EP0869434A2 (en) Method for outputting trace information of a microprocessor
CN103218219A (en) Compact function trace
JPH10333939A (en) Microprocessor
US8484517B2 (en) High compression program flow trace
JP2003508864A (en) Thread-oriented debugging
US7051237B2 (en) Program-controlled unit
CN116126832A (en) Database switching method, switching device, electronic equipment and storage medium
CN111008133B (en) Debugging method and device for coarse-grained data flow architecture execution array
US11734149B2 (en) Trace-data processing device
JPS6383841A (en) Central processing unit of computer capable of program test
CN106444729A (en) Trajectory capture system based on real-time system
CN108958905B (en) Lightweight operating system of embedded multi-core central processing unit
JP4406119B2 (en) In-circuit emulator
EP0243084B1 (en) Computer system having delayed save on procedure calls
JP2007026084A (en) Microprocessor