Thread tracking system, method and device, electronic equipment, chip and storage medium

By setting up a comparison module and a central controller in the processor core, the thread status is monitored and tracked in hardware, the problems of large load and poor timeliness caused by frequent interactions between software and hardware during thread tracing in the existing technology are solved, and efficient thread tracking and Improved timeliness.

CN118981404AActive Publication Date: 2024-11-19BEIJING X RING TECHNOLOGY CO LTD

Patent Information

Application Number
CN202410986557.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-19
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

When implementing thread tracking in the prior art, software and hardware frequently interact, resulting in large system load overhead and poor timeliness, making it difficult to meet the fine time granularity requirements of 1ms or less.

Method used

By setting up a comparison module and a central controller in the processor core, connecting each comparison module and a central controller using a data bus, monitoring and tracking the status information of the target thread in hardware, and determining its operating path between multiple processor cores , reduce software and hardware interaction.

Benefits of technology

It realizes accurate thread tracking, reduces system load overhead, improves timeliness, and meets the fine time granularity requirements of 1ms and below.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981404A_ABST
    Figure CN118981404A_ABST
Patent Text Reader

Abstract

The invention relates to a thread tracking system, method and device, electronic equipment, a chip and a storage medium, the thread tracking system comprises a central controller, a plurality of comparison modules and a data bus; wherein the comparison modules are arranged in the corresponding processor cores, and the comparison modules are used for monitoring state information of threads running on the processor cores; the data bus is used for connecting each comparison module and the central controller so as to send each piece of state information to the central controller; and the central controller is used for receiving the state information output by each comparison module, and determining a running path of the target thread among the plurality of processor cores according to the state information in the plurality of clock cycles so as to track the target thread. The thread tracking system determines the running path of the target thread in a hardware mode, so that accurate tracking of the target thread is achieved, frequent interaction between software and hardware is not needed, the load overhead of the system is reduced, and the timeliness of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of integrated circuit technology, and in particular to a thread tracking system, method, device, electronic device, chip, and storage medium. Background Art

[0002] In order to achieve a good thread load response envelope, improve user performance experience and optimize energy efficiency, the time granularity of frequency modulation decisions on electronic devices such as mobile terminals (such as smartphones and tablets) and PCs (Personal Computers) is gradually being refined to 1ms or even lower. Under this trend, how to better track the target thread?

[0003] In the related art, the thread running status is tracked by software and then reported to the hardware. However, this solution will cause frequent interactions between software and hardware, increase system load overhead, and have poor timeliness. Summary of the invention

[0004] The present disclosure provides a thread tracking system, a thread tracking method and an electronic device. The thread tracking system determines the running path of a target thread by hardware, thereby realizing accurate tracking of the target thread, which eliminates the need for frequent interaction between software and hardware, reduces the system load overhead and improves the system timeliness. The technical solution of the present disclosure is as follows:

[0005] The first embodiment of the present disclosure provides a thread tracking system, including: a central controller, a plurality of comparison modules and a data bus; wherein:

[0006] Each of the comparison modules is arranged in a corresponding processor core, and is used for monitoring the status information of threads running on each of the processor cores;

[0007] The data bus is used to connect each of the comparison modules and the central controller to send the status information output by each of the comparison modules to the central controller;

[0008] The central controller is used to receive the state information output from each comparison module, and determine the running path of the target thread between the multiple processor cores according to the multiple state information, so as to track the target thread.

[0009] In one embodiment of the present disclosure, the comparison module includes: a core thread register, a target thread register, a data bus interface and a comparator; wherein,

[0010] The core thread register is used to store the actual identifier of the thread running on the current processor core;

[0011] The target thread register is used to receive configuration information sent from the central controller through the data bus interface; wherein the configuration information includes a target identifier of the target thread to be tracked;

[0012] The comparator is used for outputting the state information according to the actual identifier and the target identifier.

[0013] In one embodiment of the present disclosure, when the comparator is used to output the state information according to the actual identifier and the target identifier, the comparator includes:

[0014] In response to the actual identifier and the target identifier matching, the state information output by the comparator indicates that the target thread is in a running state on the current processor core;

[0015] In response to the actual identifier and the target identifier not matching, the state information output by the comparator indicates that the target thread is in a non-running state on the current processor core.

[0016] In one embodiment of the present disclosure, the central controller includes: a configuration unit CFG, a clock reset generating unit CRG and a processing unit; wherein,

[0017] The configuration unit CFG includes a configuration register, which is used to interact with the upper-layer software driver interface, receive control instructions from the upper-layer software driver, and configure the clock reset generation unit CRG and the processing unit according to the control instructions;

[0018] The clock reset generating unit CRG is used to provide a clock signal and a reset signal to the processing unit after being configured by the configuration unit CFG;

[0019] The processing unit is used for generating configuration information according to the clock signal and the reset signal provided by the clock reset generating unit CRG after being configured by the configuration unit CFG, and sending the configuration information to the corresponding comparator module through a data bus.

[0020] In one embodiment of the present disclosure, the central controller further includes:

[0021] A plurality of groups of registers are used to store the status information received from the output of each of the comparison modules.

[0022] In one embodiment of the present disclosure, the plurality of groups of registers include:

[0023] A current status register CSR, each bit of which is used to store current status information output by each comparison module in a current clock cycle;

[0024] The previous state register PSR, each bit of the previous state register PSR is used to store the previous state information output by each comparison module in the previous clock cycle.

[0025] In one embodiment of the present disclosure, the plurality of groups of registers further include:

[0026] A currently running core register CCR, each bit of which is used to store the current core number of the processor core on which the target thread is executed in the current clock cycle;

[0027] The previous running core register PCR, each bit of the previous running core register PCR is used to store the previous core number of the processor core where the target thread was executed in the previous clock cycle.

[0028] In one embodiment of the present disclosure, the processing unit is further configured to:

[0029] Determining a processing result according to an operation path of the target thread between the plurality of processor cores;

[0030] The processing result is sent to the configuration unit CFG or the system manager.

[0031] In one embodiment of the present disclosure, the state information includes a timestamp and a core number, and the central controller is used to determine the running path of the target thread between the plurality of processor cores according to the plurality of state information, including:

[0032] sorting the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles;

[0033] Tracking and recording changes of the target thread between different processor cores according to the core number in each state information in the state information sequence;

[0034] According to the tracked change sequence of the target thread between the processor cores, the running path of the target thread is generated and output.

[0035] A second aspect of the present disclosure provides a thread tracking method, which is applied to the above-mentioned thread tracking system and includes:

[0036] Receiving status information outputted from each of the comparison modules;

[0037] According to the plurality of state information, the running path of the target thread between the plurality of processor cores is determined to track the target thread.

[0038] In one embodiment of the present disclosure, the method further includes:

[0039] Determining a processing result according to an operation path of the target thread between the plurality of processor cores;

[0040] The processing result is sent to the configuration unit CFG or the system manager.

[0041] In one embodiment of the present disclosure, the state information includes a timestamp and a core number, and determining the running path of the target thread between the plurality of processor cores according to the plurality of state information includes:

[0042] sorting the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles;

[0043] Tracking and recording changes of the target thread between different processor cores according to the core number in each state information in the state information sequence;

[0044] According to the tracked change sequence of the target thread between the processor cores, the running path of the target thread is generated and output.

[0045] The third aspect of the present disclosure provides a thread tracking device, which is applied to the above-mentioned thread tracking system, including:

[0046] A receiving module, used for receiving the status information outputted by each of the comparison modules;

[0047] The first determination module is used to determine the running path of the target thread between the multiple processor cores according to the multiple state information, so as to track the target thread.

[0048] In one embodiment of the present disclosure, the device further includes:

[0049] A second determination module, configured to determine a processing result according to a running path of the target thread between the plurality of processor cores;

[0050] The sending module is used to send the processing result to the configuration unit CFG or the system manager.

[0051] In one embodiment of the present disclosure, the state information includes a timestamp and a core number, and the first determining module includes:

[0052] A sorting unit, configured to sort the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles;

[0053] A tracking unit, configured to track and record changes of the target thread between different processor cores according to the core number in each state information in the state information sequence;

[0054] A generating unit is used to generate and output a running path of the target thread according to the tracked change sequence of the target thread between the processor cores.

[0055] The fourth aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method as described above.

[0056] A fifth aspect of the present disclosure provides a chip, comprising a processing circuit, wherein the processing circuit is configured to execute the above method.

[0057] The sixth aspect of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above method.

[0058] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0059] Through the embodiments of the present disclosure, the thread tracking system of the present disclosure includes a central controller, multiple comparison modules and a data bus; wherein each comparison module is set in the corresponding processor core, and is used to monitor the state information of the thread running on each processor core; the data bus is used to connect each comparison module and the central controller to send the state information output by each comparison module to the central controller; the central controller is used to receive the state information output from each comparison module, and determine the running path of the target thread between multiple processor cores according to multiple state information, so as to realize the tracking of the target thread. Thus, the thread tracking system determines the running path of the target thread by hardware, so as to realize the accurate tracking of the target thread, so that there is no need for frequent interaction between software and hardware, which reduces the system load overhead and improves the system timeliness.

[0060] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0062] Figure 1 is an application scenario diagram of a thread tracking system according to an embodiment of the present disclosure;

[0063] Figure 2 is an overall block diagram of a thread tracking system according to an embodiment of the present disclosure;

[0064] Figure 3 is a schematic diagram of a central controller according to an embodiment of the present disclosure;

[0065] Figure 4 is a schematic diagram of a state maintenance register according to an embodiment of the present disclosure;

[0066] Figure 5 is a schematic diagram of switching in and out of threads on the same core according to an embodiment of the present disclosure;

[0067] Figure 6 is a schematic diagram of a thread migration core according to an embodiment of the present disclosure;

[0068] Figure 7 is an overall block diagram of hardware multi-threaded tracing according to an embodiment of the present disclosure;

[0069] Figure 8 is a schematic diagram of a central controller during hardware multi-threaded tracking according to an embodiment of the present disclosure;

[0070] Fig. 9 is a flowchart of a thread tracking method according to an embodiment of the present disclosure;

[0071] Fig.10 is a block diagram of a thread tracking device according to an embodiment of the present disclosure;

[0072] Fig.11 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure is shown;

[0073] Fig.12 It is a schematic diagram of the structure of a chip according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0074] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0075] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0076] The thread tracing system and thread tracing method according to the embodiments of the present disclosure will be described below with reference to the accompanying drawings.

[0077] Before introducing the thread tracking system of the present disclosure, the application scenario of the thread tracking system of the present disclosure is first introduced.

[0078] Figure 1 FIG. 1 is an application scenario diagram of a thread tracking system according to an embodiment of the present disclosure. Figure 1 As shown, the thread tracking system of the present disclosure is applied to electronic devices including but not limited to asymmetric multi-core (such as large core, medium core, small core) such as mobile terminal devices or desktop PCs.

[0079] like Figure 1 As shown, threads can be scheduled between multiple cores and on a single core by time slice polling. The system manager needs to perform system-level resource management and supply according to the specific thread running path. The thread tracking system disclosed in the present invention serves the system manager. The system manager tracks the running path of the thread and instructs the system manager to perform accurate statistical sampling on its path to achieve the fine time granularity requirement of 1ms or less.

[0080] Figure 2 FIG. 1 is an overall block diagram of a thread tracking system according to an embodiment of the present disclosure. Figure 2 As shown, the thread tracking system disclosed in the present invention includes: a central controller (Hardware Thread Tracking Central Controller), multiple comparison modules (HTT Remote) and a data bus (Utility Bus).

[0081] It should be noted that each comparison module (HTT Remote) is set in the corresponding processor core (Core), and the number of comparison modules (HTT Remote) is determined by the number of processor cores. For example, the present disclosure is described with 4 processor cores (Core), processor core Core0 is the processor core of processor CPU0, processor core Core1 is the processor core of processor CPU1, processor core Core2 is the processor core of processor CPU2, and processor core Core3 is the processor core of processor CPU3.

[0082] Among them, the comparison module (HTT Remote) is used to monitor the status information of the threads running on each processor core (Core). The data bus (Utility Bus) is used to connect each comparison module (HTT Remote) and the central controller (HardwareThread Tracking Central Controller) to send the status information output by each comparison module (HTT Remote) to the central controller (Hardware Thread Tracking Central Controller). The central controller (Hardware Thread Tracking Central Controller) is used to receive the status information sent from each comparison module (HTTRemote), and determine the running path of the target thread between multiple processor cores based on multiple status information to achieve tracking of the target thread.

[0083] like Figure 2 As shown, the comparison module (HTT Remote) disclosed in the present invention includes: a core thread register TID Core, a target thread register TID Target, a data bus interface and a comparator. Among them, the core thread register TID Core is used to store the actual identifier of the thread running on the current processor core. For example, the core thread register TID Core is responsible for sampling the system registers inside the processor core, and the system registers are configured when the thread is switched in or out. The target thread register TID Target is used to receive configuration information sent from the central controller (Hardware Thread Tracking Central Controller) through the data bus interface; wherein, the configuration information contains the target identifier of the target thread to be tracked. The comparator is used to output status information based on the actual identifier and the target identifier.

[0084] Among them, when the actual identifier and the target identifier match, the status information output by the comparator indicates that the target thread is in a running state on the current processor core, which can be represented by 1; when the actual identifier and the target identifier do not match, the status information output by the comparator indicates that the target thread is in a non-running state on the current processor core, which can be represented by 0.

[0085] like Figure 3 As shown, the central controller (Hardware Thread Tracking Central Controller) disclosed in the present invention includes: a configuration unit CFG, a clock reset generating unit CRG and a processing unit; wherein the configuration unit CFG includes a configuration register, the configuration register is used to interact with the upper-level software driver interface, receive the control instruction of the upper-level software driver, and configure the clock reset generating unit CRG and the processing unit according to the control instruction; the clock reset generating unit CRG is used to provide a clock signal and a reset signal to the processing unit after the configuration unit CFG is configured; the processing unit is used to generate configuration information according to the clock signal and the reset signal provided by the clock reset generating unit CRG after the configuration unit CFG is configured, and send the configuration information to the corresponding comparator module (HTT Remote) through the data bus.

[0086] The working principle of the central controller (Hardware Thread Tracking Central Controller) is as follows: After the processing unit is initialized by the configuration unit CFG and the target thread register TID Target is configured, the processing unit starts to be enabled to work. The target thread register TID Target is configured to each comparison module (HTT Remote) by the processing unit via the data bus (UtilityBus). After the processing unit initializes each comparison module (HTT Remote), each comparison module (HTT Remote) starts to work normally, and each comparator result is returned to the processing unit for unified processing by the processing unit, such as generating the running path between multiple processor cores of the target thread, and then the running path determines the processing result. The processing result processed by the processing unit has two paths. One is to return the processing result to the configuration unit CFG, and then it is read by the system software through the system bus; the other is to send the processing result directly to other hardware modules through the module hardware interface into the system manager to realize the rapid supply of on-chip information.

[0087] In one embodiment of the present disclosure, the central controller (Hardware Thread Tracking Central Controller) further includes: a plurality of groups of registers, and the plurality of groups of registers are used to store the state information received from the output of each comparison module (HTTRemote).

[0088] like Figure 4 As shown, multiple groups of registers include: a current status register CSR (Current Status Register) and a previous status register PSR (Previous Status Register). Among them, each bit of the current status register CSR is used to store the current status information output by each comparison module (HTT Remote) in the current clock cycle. Each bit of the previous status register PSR is used to store the previous status information output by each comparison module (HTT Remote) in the previous clock cycle.

[0089] Continue to refer Figure 4 , multiple groups of registers, including: a current core register CCR (Current Core Register) and a previous core register PCR (Previous Core Register). Among them, each bit of the current core register CCR is used to store the current core number of the processor core where the target thread is executed in the current clock cycle. Each bit of the previous core register PCR is used to store the previous core number of the processor core where the target thread is executed in the previous clock cycle.

[0090] In an embodiment of the present disclosure, the state information includes a timestamp and a core number. The central controller (Hardware Thread Tracking Central Controller) is used to determine the running path of the target thread between multiple processor cores based on multiple state information, including: sorting the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles; tracking and recording the changes of the target thread between different processor cores according to the core number in each state information in the state information sequence; generating and outputting the running path of the target thread according to the tracked change sequence of the target thread between the processor cores.

[0091] The present disclosure constructs state event information of generated threads through these state maintenance registers, tracks the running track of target threads, and provides control basis for the on-chip system manager.

[0092] The following is the specific information output from the hardware thread trace design:

[0093] Two states: Running state and No-Running state;

[0094] Two events: thread entry and thread exit;

[0095] Two pieces of information: whether to relocate the core and where to relocate.

[0096] Figure 5 It illustrates the situation where a thread actively or passively gives up its time slice on the same processor core. The same bit of the previous status register PSR and the current status register CSR changes from 0->1 or 1->0. From the hardware level, an abnormal entry and exit event occurs. After triggering these two abnormal events, the hardware must make corresponding processing to ensure that the statistical information of runtime and performance counters is accurate.

[0097] Figure 6 and Figure 5 The difference is that the thread is moved from the processor core core2 to the processor core core1. The exception events triggered and the processing actions are the same. In addition, we also know which processor core it is moved from.

[0098] Through the circuit design disclosed in the present invention, two states, two events, and two pieces of information of the target thread can be obtained. Through these key information, the hardware system manager can perform corresponding management and control without going through the trajectory and state of the software system or thread operation. This greatly reduces the load of the software system and greatly improves timeliness and accuracy.

[0099] It should be noted that if Figure 7 and Figure 8 As shown, the thread tracking system of the present disclosure is not limited to tracking the running of a single thread, but can also implement multi-thread running tracking by expanding the processor unit in the central controller and expanding the number of comparison modules HTT Remote.

[0100] The disclosed solution can realize hardware-level thread tracking. The key task threads in the system are marked and resource supply is optimized when they are running, which can effectively improve the energy efficiency of the entire system. Each target thread represents a task feature. Under various task features, the system, such as bus, DDR, etc., has different frequency combinations as the optimal system resource supply mode, and the processor core itself also has a suitable operating frequency. To identify the task features, it is necessary to statistically sample the characteristic signals in the processor core where the thread is running, and then identify them based on specific algorithm processing. When the system is actually running, the situation is more complicated, which is reflected in time slice polling scheduling and thread core migration. These will occur frequently, affecting our statistical sampling of the characteristic signals of the target thread. If it is completely tracked and processed by software, there are the following disadvantages: (1) timeliness cannot be guaranteed, resulting in statistical errors; (2) frequent interaction between software and hardware brings heavy software system overhead. The implementation of this solution can solve the above problems, realize accurate thread tracking, depict a panoramic view of the thread running status and path, and cooperate with the hardware-assisted system manager to achieve greater energy efficiency benefits and performance response.

[0101] In summary, through the embodiments of the present disclosure, the thread tracking system of the present disclosure includes a central controller, multiple comparison modules and a data bus; wherein each comparison module is set in the corresponding processor core, and is used to monitor the state information of the thread running on each processor core; the data bus is used to connect each comparison module and the central controller to send the state information output by each comparison module to the central controller; the central controller is used to receive the state information output by each comparison module, and determine the running path of the target thread between multiple processor cores according to multiple state information, so as to realize the tracking of the target thread. Therefore, the thread tracking system determines the running path of the target thread by hardware, so as to realize the accurate tracking of the target thread, which does not require frequent interaction between software and hardware, reduces the system load overhead, and improves the system timeliness.

[0102] Fig. 9 The figure is a flowchart of a thread tracking method according to an embodiment of the present disclosure.

[0103] It should be noted that the thread tracking method disclosed in the present invention is applied to the above-mentioned thread tracking system, and the execution subject is a central controller (Hardware Thread Tracking Central Controller).

[0104] like Fig. 9 As shown, the thread tracking method disclosed in the present invention includes:

[0105] S1, receiving status information output from each comparison module.

[0106] S2, determining the running path of the target thread between the multiple processor cores according to the multiple state information, so as to track the target thread.

[0107] In one embodiment of the present disclosure, the method further includes:

[0108] Determine a processing result according to an operation path of the target thread among the multiple processor cores;

[0109] The processing result is sent to the configuration unit CFG or the system manager.

[0110] In one embodiment of the present disclosure, before receiving the status information outputted by each comparison module, the method further includes:

[0111] In response to receiving a control instruction driven by an upper-level software, the clock reset generating unit CRG and the processing unit are configured according to the control instruction; wherein the clock reset generating unit CRG is used to provide a clock signal and a reset signal to the processing unit after the configured unit CFG is configured; after the configured unit CFG is configured, the processing unit generates configuration information according to the clock signal and the reset signal provided by the clock reset generating unit CRG, and sends the configuration information to the corresponding comparator module through the data bus.

[0112] In one embodiment of the present disclosure, the state information includes a timestamp and a core number. According to the multiple state information, the running path of the target thread between the multiple processor cores is determined to track the target thread, including:

[0113] sorting the received status information according to the timestamp in the status information to obtain a status information sequence of multiple consecutive clock cycles;

[0114] Track and record the change of the target thread between different processor cores according to the core number in each state information in the state information sequence;

[0115] According to the traced change sequence of the target thread between processor cores, the running path of the target thread is generated and output.

[0116] It should be noted that the details not disclosed in the thread tracking method of the embodiment of the present disclosure may be referred to in accordance with the details disclosed in the thread tracking system of the embodiment of the present disclosure, and will not be described in detail here.

[0117] The thread tracking method of the disclosed embodiment first receives the status information outputted by each comparison module, and determines the running path of the target thread between multiple processor cores according to the multiple status information, so as to realize the tracking of the target thread. The method realizes the accurate tracking of the target thread, thus eliminating the need for frequent interaction between software and hardware, reducing the system load overhead, and improving the system timeliness.

[0118] Fig.10 FIG. 1 is a block diagram of a thread tracking device according to an embodiment of the present disclosure. Fig.10 As shown, the thread tracking device 100 of the present disclosure includes:

[0119] The receiving module 101 is used to receive the status information outputted by each comparing module.

[0120] The first determination module 102 is used to determine the running path of the target thread between multiple processor cores according to multiple state information, so as to track the target thread.

[0121] In one embodiment of the present disclosure, the above-mentioned device further includes:

[0122] A second determination module, used to determine a processing result according to a running path of a target thread among multiple processor cores;

[0123] The sending module is used to send the processing result to the configuration unit CFG or the system manager.

[0124] In one embodiment of the present disclosure, the state information includes a timestamp and a core number, and the first determination module includes:

[0125] A sorting unit, used to sort the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles;

[0126] a tracking unit, for tracking and recording changes of a target thread between different processor cores according to a core number in each state information in the state information sequence;

[0127] The generation unit is used to generate and output the running path of the target thread according to the traced change sequence of the target thread between the processor cores.

[0128] It should be noted that the details not disclosed in the thread tracking device of the embodiment of the present disclosure may be referred to in accordance with the details disclosed in the thread tracking system of the embodiment of the present disclosure, and will not be described in detail here.

[0129] The thread tracking device disclosed in the present invention receives the state information outputted by each comparison module through the receiving module, and determines the running path of the target thread between multiple processor cores according to the multiple state information through the first determination module, so as to realize the tracking of the target thread. Thus, the device realizes the accurate tracking of the target thread, which does not require frequent interaction between software and hardware, reduces the system load overhead, and improves the system timeliness.

[0130] In order to implement the above embodiments, the present disclosure also proposes an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method provided by the above embodiments.

[0131] Fig.11 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Fig.11 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure. The electronic device may be, for example, an electronic device or a terminal.

[0132] like Fig.11 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that connects various system components (including the memory 28 and the processing unit 16).

[0133] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

[0134] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0135] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.11 Not shown, often called a "hard drive").

[0136] although Fig.11 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (hereinafter referred to as: CD-ROM), a digital versatile disc read only memory (hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0137] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0138] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable the human body to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0139] The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing the methods mentioned in the above embodiments.

[0140] In order to implement the above embodiments, the present disclosure further proposes a chip, including: the chip includes a processing circuit, and the processing circuit is configured to execute the method provided by the above embodiments.

[0141] Fig.12 is a schematic diagram of the structure of the chip proposed in the embodiment of the present disclosure. Fig.12 The structure of the chip 1100 is shown, but is not limited to this.

[0142] The chip 1100 includes a processing circuit 1101 , and the processing circuit 1101 is configured to execute any of the above methods.

[0143] In some embodiments, the chip 1100 further includes one or more interface circuits 1102. Optionally, the interface circuit 1102 is connected to the memory 1103. The interface circuit 1102 can be used to receive signals from the memory 1103 or other devices, and the interface circuit 1102 can be used to send signals to the memory 1103 or other devices. For example, the interface circuit 1102 can read instructions stored in the memory 1103 and send the instructions to the processing circuit 1101.

[0144] In some embodiments, the interface circuit 1102 performs at least one of the communication steps such as sending and / or receiving in the above method, and the processing circuit 1101 performs other steps.

[0145] In some embodiments, terms such as interface circuit, interface, transceiver pin, and transceiver may be used interchangeably.

[0146] In some embodiments, the chip 1100 further includes one or more memories 1103 for storing instructions. Alternatively, all or part of the memory 1103 may be outside the chip 1100.

[0147] In order to implement the above embodiments, the present disclosure further proposes a non-transitory computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method proposed in the above embodiments of the present disclosure is implemented.

[0148] In order to implement the above embodiments, the present disclosure further proposes a computer program product. When instructions in the computer program product are executed by a processor, the method proposed in the above embodiments of the present disclosure is executed.

[0149] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this disclosure shall comply with the relevant laws and regulations and shall not violate public order and good morals.

[0150] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.

[0151] The present disclosure anticipates providing implementation schemes for users to selectively block the use or access of personal information data. That is, the present disclosure anticipates providing hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, risks can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.

[0152] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0153] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0154] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present disclosure belong.

[0155] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0156] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0157] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0158] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0159] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.

Claims

1. A thread tracking system, It is characterized in that include: A central controller, a plurality of comparison modules and a data bus; wherein, Each of the comparison modules is arranged in a corresponding processor core, and is used for monitoring the status information of threads running on each of the processor cores; The data bus is used to connect each of the comparison modules and the central controller to send the status information output by each of the comparison modules to the central controller; The central controller is used to receive the state information output from each comparison module, and determine the running path of the target thread between the multiple processor cores according to the multiple state information, so as to track the target thread.

2. The thread tracking system according to claim 1, It is characterized in that The comparison module includes: a core thread register, a target thread register, a data bus interface and a comparator; wherein, The core thread register is used to store the actual identifier of the thread running on the current processor core; The target thread register is used to receive configuration information sent from the central controller through the data bus interface; wherein the configuration information includes a target identifier of the target thread to be tracked; The comparator is used for outputting the state information according to the actual identifier and the target identifier.

3. The thread tracking system according to claim 2, It is characterized in that When the comparator is used to output the state information according to the actual identifier and the target identifier, it includes: In response to the actual identifier and the target identifier matching, the state information output by the comparator indicates that the target thread is in a running state on the current processor core; In response to the actual identifier and the target identifier not matching, the state information output by the comparator indicates that the target thread is in a non-running state on the current processor core.

4. The thread tracking system according to claim 1, It is characterized in that The central controller includes: a configuration unit CFG, a clock reset generating unit CRG and a processing unit; wherein, The configuration unit CFG includes a configuration register, which is used to interact with an upper-layer software driver interface, receive control instructions from the upper-layer software driver, and configure the clock reset generation unit CRG and the processing unit according to the control instructions; The clock reset generating unit CRG is used to provide a clock signal and a reset signal to the processing unit after being configured by the configuration unit CFG; The processing unit is used for generating configuration information according to the clock signal and the reset signal provided by the clock reset generating unit CRG after being configured by the configuration unit CFG, and sending the configuration information to the corresponding comparator module through a data bus.

5. The thread tracking system according to claim 4, It is characterized in that The central controller further comprises: A plurality of groups of registers are used to store the status information received from the output of each of the comparison modules.

6. The thread tracking system according to claim 5, It is characterized in that The multiple groups of registers include: A current status register CSR, each bit of which is used to store current status information output by each comparison module in a current clock cycle; The previous state register PSR, each bit of the previous state register PSR is used to store the previous state information output by each comparison module in the previous clock cycle.

7. The thread tracking system according to claim 6, It is characterized in that The plurality of groups of registers further include: A currently running core register CCR, each bit of which is used to store the current core number of the processor core on which the target thread is executed in the current clock cycle; The previous running core register PCR, each bit of the previous running core register PCR is used to store the previous core number of the processor core where the target thread was executed in the previous clock cycle.

8. The thread tracking system according to claim 4, It is characterized in that The processing unit is also used for: Determining a processing result according to an operation path of the target thread between the plurality of processor cores; The processing result is sent to the configuration unit CFG or the system manager.

9. The thread tracking system according to claim 1, It is characterized in that The state information includes a timestamp and a core number, and the central controller is used to determine the running path of the target thread between the plurality of processor cores according to the plurality of state information, including: sorting the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles; Tracking and recording changes of the target thread between different processor cores according to the core number in each state information in the state information sequence; According to the tracked change sequence of the target thread between the processor cores, the running path of the target thread is generated and output.

10. A thread tracking method, It is characterized in that The method is applied to a thread tracking system according to any one of claims 1 to 9, comprising: Receiving status information output from each comparison module; According to the plurality of state information, the running path of the target thread between the plurality of processor cores is determined to track the target thread.

11. The thread tracking method according to claim 10, It is characterized in that The method further comprises: Determining a processing result according to an operation path of the target thread between the plurality of processor cores; The processing result is sent to the configuration unit CFG or the system manager.

12. The thread tracking method according to claim 10, It is characterized in that The state information includes a timestamp and a core number, and determining the running path of the target thread between the plurality of processor cores according to the plurality of state information includes: sorting the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles; Tracking and recording changes of the target thread between different processor cores according to the core number in each state information in the state information sequence; According to the tracked change sequence of the target thread between the processor cores, the running path of the target thread is generated and output.

13. A thread tracking device, It is characterized in that The device is applied to a thread tracking system according to any one of claims 1 to 9, comprising: A receiving module, used for receiving the status information outputted by each of the comparison modules; The first determination module is used to determine the running path of the target thread between the multiple processor cores according to the multiple state information, so as to track the target thread.

14. The device according to claim 13, It is characterized in that The device also includes: A second determination module, configured to determine a processing result according to a running path of the target thread between the plurality of processor cores; The sending module is used to send the processing result to the configuration unit CFG or the system manager.

15. The device according to claim 13, It is characterized in that The state information includes a timestamp and a core number, and the first determining module includes: A sorting unit, configured to sort the received state information according to the timestamp in the state information to obtain a state information sequence of multiple consecutive clock cycles; A tracking unit, configured to track and record changes of the target thread between different processor cores according to the core number in each state information in the state information sequence; A generating unit is used to generate and output a running path of the target thread according to the tracked change sequence of the target thread between the processor cores.

16. An electronic device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 10 to 12.

17. A chip, It is characterized in that The chip comprises a processing circuit configured to perform the method of any one of claims 10-12.

18. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 10 to 12 when executed by a processor.

Citation Information

Patent Citations

  • Multi-core processor system, synchronisation control system, synchronisation control device, information generation method, and information generation programme

    CN103080921A

  • Hardware counters to track utilization in a multithreading computer system

    CN106104487A

  • Thread state monitoring in a system having a multi-threaded, self-scheduling processor

    CN112106030A

  • Apparatus and method for adaptively scheduling work on heterogeneous processing resources

    CN113050991A

  • Control device, control method and related equipment

    CN117170957A

Cited By

  • Time sequence detection circuit, chip, electronic equipment and time sequence detection method

    CN119961106A