Methods and apparatus for measuring performance of a multi-thread processor

Disclosed are methods and apparatus for measuring performance of a multi-thread processor. The method and apparatus determine loading of a multi-thread processor through execution of an idle task in individual threads of the multi-thread processor during predetermined time periods. The idle task is configured to loop and run when no other task is running on the threads. Loop executions of the idle task on each thread are counted over each of the predetermined time periods. From these counts, loading of each of the threads of the multi-thread processor may then be determined. The loading may be used to develop a processor profile that may then be displayed in real-time.

BACKGROUND

Field

The present disclosure relates generally to methods and apparatus for measuring performance of a multi-thread processor, and more specifically to methods and apparatus for loading measuring and performance profiling of multi-thread processors in devices such as wireless devices on a per thread basis and for various uses and data rates.

Background

In devices such as wireless devices, profiling the performance of a processor that the wireless communication is running on is important. The profiling and measurement of processor performance can provide insight for design optimization, as well as provide a convenient tool for design debugging. The result of such profiling can be used for resource management in a device utilizing the processor, such as a wireless device in one example. Such resource management can be dynamic and flexible if the profiling is performed in a real-time manner. One example is a communication flow control based processor loading that is measured based on performance profiling.

As the wireless technology evolves, many sophisticated mobile features and high data rates are required to be implemented in a wireless devices or handheld devices. The processor technology of the wireless devices, consequently, evolves too. For example, for 2G cellular technologies such as GSM/GPRS, a typical processor is based on single thread architecture, while for 3G/4G cellular technologies such as HSPA+/LTE/EV-DO, processors have evolved to be multi-thread based.

No scheme or apparatus available in the known art, however, measures multi-thread processor CPU loading under various use cases and data rates. Furthermore, there is no known tool or instrument available to probe the multi-thread processor CPU usage, per each thread, when a packet data session is ongoing in a device, such as a wireless device. Moreover, there is no known tool or instrument available to probe the multi-thread processor “all-wait” (i.e. all processor threads are idle) status when a packet data session is ongoing in a wireless device. Accordingly, a need exists for determining loading of a multi-thread processor and profiling performance of the processor using the determined loading.

SUMMARY

In an aspect, a method for determining loading of a multi-thread processor is disclosed. The method includes executing at least one idle task in at least one thread of the multi-thread processor during at least one predetermined time period. The idle task is configured to loop and run when no other task is running on the at least one thread. At least one count of loop executions of the at least one idle task over the at least one predetermined time period is determined. Finally, the method includes determining loading of at least the at least one thread of the multi-thread processor based on the at least one count of the number of loop executions.

In another aspect, an apparatus for determining the loading of a multi-thread processor is disclosed. The apparatus includes at least one processor configured to execute at least one idle task in at least one thread of the multi-thread processor during at least one predetermined time period, wherein the idle task is configured to loop and run when no other task is running on the at least one thread. The processor is also configured to determine at least one count of loop executions of the at least one idle task over the at least one predetermined time period. Finally, the processor is configured to determine loading of at least the at least one thread of the multi-thread processor based on the at least one count of the number of loop executions.

According to still another aspect, an apparatus for determining loading of a multi-thread processor is disclosed. The apparatus includes means for executing at least one idle task in at least one thread of the multi-thread processor during at least one predetermined time period, wherein the idle task is configured to loop and run when no other task is running on the at least one thread. Means for determining at least one count of loop executions of the at least one idle task over the at least one predetermined time period are further included. Also, the apparatus includes means for determining loading of at least the at least one thread of the multi-thread processor based on the at least one count of the number of loop executions.

According to still one more aspect, a computer program product comprising computer-readable medium is disclosed. The medium comprises code for causing a computer to generate a performance profile of a multi-thread processor wherein the code includes code for causing a computer to execute at least one idle task in at least one thread of the multi-thread processor during at least one predetermined time period. The idle task is configured to loop and run when no other task is running on the at least one thread. Further included is code for causing a computer to determine at least one count of loop executions of the at least one idle task over the at least one predetermined time period, and code for causing a computer to determine loading of at least the at least one thread of the multi-thread processor based on the at least one count of the number of loop executions.

DETAILED DESCRIPTION

The present disclosure features methods and apparatus that afford measurement and/or profiling of the performance of a multi-thread processor CPU, such as those used in devices for 3G/4G technologies, such as High Speed Packet Access (HSPA), evolved HSPA (HSPA+), Long Term Evolution (LTE), and EV-DO technologies. Additionally, the presently disclosed method and apparatus afford real-time profiling and/or measurement that can be displayed in real-time for use in designing or optimizing multi-thread CPU usage or operation.

The apparatus and methods described herein are applicable to various devices that utilize multi-thread processors. In a particular aspect, the present apparatus and methods may be applied to wireless devices utilizing multi-thread processors to help optimizing the processor operation in the wireless device. It is noted that exemplary wireless communication technologies that such devices may implement include Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA) networks, Frequency Division Multiple Access (FDMA), Orthogonal FDMA (OFDMA), Single-Carrier FDMA (SC-FDMA), High Speed Packet Access (HSPA and HSPA+) technologies, Long Term Evolution (LTE), EV-DO technologies, etc. A CDMA network may implement a radio technology such as Universal Terrestrial Radio Access (UTRA), cdma2000, etc. UTRA includes Wideband-CDMA (W-CDMA) and Low Chip Rate (LCR). cdma2000 covers IS-2000, IS-95 and IS-856 standards. A TDMA network may implement a radio technology such as Global System for Mobile Communications (GSM). An OFDMA network may implement a radio technology such as Ultra Mobile Bandwidth (UMB), Evolved UTRA (E-UTRA), IEEE 802.11, IEEE 802.16 (WiMax), IEEE 802.20, Flash-OFDM, etc. UTRA, E-UTRA, and GSM are part of Universal Mobile Telecommunication System (UMTS). Long Term Evolution (LTE) is an upcoming release of UMTS that uses E-UTRA. UTRA, E-UTRA, GSM, UMTS and LTE are described in documents from an organization named “3rd Generation Partnership Project” (3GPP). cdma2000 is described in documents from an organization named “3rd Generation Partnership Project 2” (3GPP2). These various radio technologies and standards are known in the art.

Also, the term “processor” as used herein may include, but is not limited to, a CPU, ASIC, digital signal processor (DSP), or any other type of processor capable of executing instructions. Additionally, although the present disclosure relates primarily to multi-thread processors, it will be evident to one skilled in art that the present apparatus and methods apply to any processor running processes in parallel, concurrently, etc, or even potentially to multi-tasking. Furthermore, although the present disclosure is discussed in the context of processors used in wireless devices, one skilled in the art will appreciate that the present methods and apparatus may be broadly applied to any multi-thread processor regardless of the application or use.

Referring toFIG. 1, an example of a multiple access wireless communication system in which the present methods and apparatus may be employed is shown. An access point100(AP) (or eNodeB or base station) includes multiple antenna groups, one including104and106, another including108and110, and an additional including112and114. InFIG. 1, only two antennas are shown for each antenna group, however, more or fewer antennas may be utilized for each antenna group. Access terminal116(AT) (or mobile device or user equipment (UE)) is in communication with antennas112and114, where antennas112and114transmit information to access terminal116over a downlink (DL) or forward link120and receive information from access terminal116over an uplink (UL) or reverse link118. Access terminal122is in communication with antennas106and108, where antennas106and108transmit information to access terminal122over forward link126and receive information from access terminal122over reverse link124. In an FDD system, communication links118,120,124and126may use different frequency for communication. For example, DL120may use a different frequency then that used by UL118. In a TDD system, a single frequency is used for both UL118and DL120, with time multiplexing of UL and DL signals.

Each group of antennas and/or the area in which they are designed to communicate is often referred to as a sector of the access point. In an aspect, antenna groups each are designed to communicate to access terminals in a sector of the areas covered by access point100.

An access point may be a fixed station used for communicating with the terminals and may also be referred to as an access point, a Node B, or some other terminology. An access terminal may also be called an access terminal, user equipment (UE), a wireless communication device, terminal, access terminal or some other terminology.

FIG. 2is a block diagram of an example of a transmitter system210(also known as the access point) and a receiver system250(also known as access terminal) in a MIMO system200that provides spatial diversity multiplexing. At the transmitter system210, traffic data for a number of data streams is provided from a data source212to a transmit (TX) data processor214.

The modulation symbols for all data streams are then provided to a TX MIMO processor220, which may further process the modulation symbols (e.g., for OFDM). TX MIMO processor220then provides NT modulation symbol streams to NT transmitters (TMTR)222athrough222t. In certain aspects, TX MIMO processor220applies beamforming weights to the symbols of the data streams and to the antenna from which the symbol is being transmitted.

Each transmitter222receives and processes a respective symbol stream to provide one or more analog signals, and further conditions (e.g., amplifies, filters, and upconverts) the analog signals to provide a modulated signal suitable for transmission over the MIMO channel. NT modulated signals from transmitters222athrough222tare then transmitted from NT antennas224athrough224t, respectively.

An RX data processor260then receives and processes the NR received symbol streams from NR receivers254based on a particular receiver processing technique to provide NT “detected” symbol streams. The RX data processor260then demodulates, deinterleaves, and decodes each detected symbol stream to recover the traffic data for the data stream. The processing by RX data processor260is complementary to that performed by TX MIMO processor220and TX data processor214at transmitter system210.

At transmitter system210, the modulated signals from receiver system250are received by antennas224, conditioned by receivers222, demodulated by a demodulator240, and processed by a RX data processor242to extract the reserve link or UL message transmitted by the receiver system250. Processor230then determines which pre-coding matrix to use for determining the beamforming weights then processes the extracted message.

It is noted that the present disclosure affords apparatus and methods for profiling a processor such as processors230or270in wireless devices210and250, but also could be applied to any multi-thread processor in any number of various apparatus, whether wireless devices or not.

As one example of an implementation,FIG. 3illustrates a block diagram of a multi-thread processor profiling arrangement. As illustrated, a device300, which could be configured as either an integrated or chipset (e.g., a Mobile Station Modem™ (MSM™)) or considered more broadly as an entire device, may include a processor302, which is a multi-thread processor. Along with processor302is a memory304, which may be integral to the packaging of processor302or separate therefrom (or even separate from device300). Additionally, other logic306may be included within device300(or external thereto) for providing additional profile or performance data such as determining CPU cycles where all threads of the processor302are idle, which will be discussed further below. Alternatively, the functions performed by logic306, could be performed by the processor302. Further, a display interface308may be included to display real-time profiling data.

FIG. 4is block diagram illustrating an apparatus operation for determining loading of a multi-thread processor. This illustration shows a system400, which is a representation of a multi-thread processing system operable in a device such as a wireless device, as merely one example. The system400executes operations including multi-threads based on some underlying operating system (OS)402. The operating system and attendant software may be configured to execute an idle task on one or more of the threads in the multi-thread processing system. The idle task that is configured to be executed when no other task is being executed in a thread and may be an infinite loop or some other repeating operation. In an aspect, the idle task is simply a loop that performs nothing but a loop operation whose repetitions may be counted.

In an aspect, the system400may include a register404or equivalent device (or function in the case of software or firmware) used to store count of the loops of the idle task run in respective one or more of the threads. The register404includes separate count storage for each thread as illustrated by reference number406pointing out one of the count storages in register404. Register404stores counts for each idle task run in each of an N number of threads (T1through TN) over a predetermined time period (e.g., a T number of milliseconds (ms)). In an aspect, the register404includes a loop count of the executed idle task for each of the N number of independent threads. A vector, which is shown figuratively by vector408, with N elements each having a loop count of idle task executions is then formed for each duration of the predetermined period (T ms). The vector is output via a communicative coupling410to a processing device, such as a computer and memory412, to collate and process the count data for display to a user.

A vector408of [T1, T2, T3, . . . TN] of the N number of idle task count for each of N threads vectors is output every T ms such that a vector array of a number of T ms sampling periods may be formed. Accordingly, every T ms predetermined time period, the number of vectors is increased by one. The maximum number of the sleep vectors is a predetermined number M. After M*T ms, all idle task count vectors form an array with the size of M*N. The array is updated after M*T ms.

FIG. 5illustrates an exemplary array500of idle task count vectors for accumulating counts for idle tasks run on multiple threads of a multi-thread processor. For example, if the number of threads N=6, and the predetermined sampling period T=10 ms, and the number of total sampling periods M=1024, the sleeping array looks like a 1024*6 (i.e. M*N) array500as shown. It is noted that the example ofFIG. 5is merely illustrative, and that the values of M, N, and T may be set to any desired number.

FIG. 6illustrates a method600for multi-thread processor profiling that may be utilized to profile performance of a multi-thread processor (e.g., processor302). Method600includes first executing at least one idle task in at least one thread of the multi-thread processor during at least one predetermined time period, the idle task configured to loop and run when no other task is running on the at least one thread as shown in block602. In a specific aspect, the processes of block602may include implementing a looping idle task in each independent thread of the multi-thread processor (e.g.,302) whenever the respective thread is idle (i.e. no other function or task is being executed on that thread).

Method600further includes determining at least one count of loop executions of the at least one idle task over the at least one predetermined time period as indicated by block604. As discussed before, counting may be effected by a register404or similar unit or function. In a further aspect, the processes of executing the idle tasks and counting in block602are executed for an M number of predetermined time periods to form an M*N vector array as discussed previously. Thus, blocks602and604may include idle task execution and counting of the loop executions for multiple N vectors for N number of threads over M predetermined time periods to obtain the M*N array.

It will be also appreciated by those skilled in the art that the processes of blocks602and604are illustrated time sequentially inFIG. 6, the processes may be carried out simultaneously or repeatedly where a register is advancing the counts after the execution of each idle task loop until the end of the predetermined time period. After the time period expires, the register is reset to zero for counting loops of the idle task in the next predetermined time period and so forth until a count array of M time periods is derived.

After the process of block604is completed, such as after at least one predetermined time period, the loop count(s) may be used to determine a loading of the one or more independent threads of the multi-thread processor based on the count as illustrated by block606. In an example, the count of the idle task loops provides a timing of how often a particular thread is idle since the idle task is configured to run only when no other tasks are being executed in the thread. Accordingly, if a maximum sleep count is known for a given thread over a given predetermined time period, then the loading for that time period can be determined based on the ratio of the idle task loop count during normal processor operation to the baseline maximum sleep count. This loading over multiple predetermined time periods (e.g., M time periods as discussed before) may be used to derive at least one aspect of a performance profile to know how much one or more threads in a multi-thread processor are loaded.

In one particular example of how to determine the loading in block606(although not explicitly illustrated inFIG. 6), the one or more threads of the multi-thread processor may be forced to be in the idle operation. The idle task may then be run in each thread of the multi-thread processor for at least the predetermined period of time and the number of loop executions of the idle task counted. In another particular example, the idle tasks may be run for a total of M predetermined time periods in order to gain enough counts to fill the M*N array discussed previously. The processor (or another processor apart from the multi-thread processor) may then find the maximum idle task count logged in the M*N array during the M periods where only the idle tasks have been run (termed herein as the maximum sleep scalar value or “MAX_SLEEP_SCALER”). In effect, this value represents 100% CPU idle condition or sleep of any given thread.

The count values for each thread in each N vector may then be divided by the MAX_SLEEP_SCALER value to derive an idle task or sleep profile, which is a percentage of idle tasks over a maximum idle task condition that represents loading of the particular threads. Alternatively, when the M*N array is determined, the total count of a particular thread over the M periods may be summed and divided by the MAX_SLEEP_SCALAR, which has be multiplied by M to obtain a loading for the particular thread. In any case, the determined loading may then be displayed in units of percentage, or any other suitable number (e.g., simply the fraction of the idle task or sleep count divided by the MAX_SLEEP_SCALAR) as indicated by the process in block608. In a multi-thread processor, each idle task or sleep profile may be displayed per thread.

It is noted that the after the execution of all processes in method600, the method600will continuously repeat to continue generation of profiling data over time. In one example, the predetermined time period may be 10 ms, with a total number of M periods equal to 25. Thus, the accumulation of data used for determining the sleep profile is performed each 250 ms (i.e., blocks602through606), displayed (block608), and then repeated and displayed every subsequent 250 ms period.

FIG. 7illustrates another exemplary method700of determining another performance profile for a multi-thread processor. As shown, method700includes determining a number of multi-thread processor cycles of the processor having all threads idle over a predetermined sampling period (e.g., Y ms) as shown in block702. It is noted that the term processor cycle denotes a CPU cycle of a processing unit. Further, the determination of which cycles have all threads idle may be implemented by a logic, such as logic306shown inFIG. 3, where an indication is output when all threads are idle. In an aspect, it is noted that this determination may rely upon the characteristic of multi-thread processor where the thread clock is idle when thread is not executing a task. Thus, the logic may be configured such that when all thread clocks are idle, the logic outputs a logic state indicating all threads are idle. In one example, the process of block702includes obtaining the number of multi-thread processor cycles that “all threads are waiting (idle)”, termed herein as an “All_Wait_Cycle,”

Further, method700includes determining a total number of multi-thread processor cycles occurring during the predetermined sampling period (e.g., Y ms) as shown in block704. In an aspect, this total number of cycles occurring in the sampling period may be referred to as the “Total_Cycle.”

Also, method700includes deriving a performance profile of the multi-thread processor based on a ratio of the determined number of multi-thread processor cycles of the processor having all threads idle to the determined total number of multi-thread processor cycle as shown in block706. This ratio, termed herein as the “all-wait ratio” or “all-wait percentage,” is therefore derived with the quotient All_Wait_Cycle/Total_Cycle.

Similar to method600, method700also includes the further process of causing display of the all-wait percentage information. It is noted that in an aspect methods600and700are useful together to obtain a more complete performance profiling record data set of a multi-thread processor by determining a loading profile of how much each thread is utilized as well as determining a profile concerning how frequently all threads are idle or waiting. Additionally, the disclosed apparatus and methods may generate and submit the profiling record data set every Y ms to a display function (e.g., function implemented by the processor (302)) to display profile information via a display interface (e.g.,308). The profiling record data set may consists of the idle count array (such as shown inFIG. 4) and the MAX_SLEEP_SCALER discussed above. The profiling record data set may also include the all-wait percentage during the sampling period Y ms. It is noted that in an aspect the predetermined sampling period Y ms may be equal to the total of M predetermined time periods in the count array. As an example of a profiling record data set that may be generated, Table 1 below gives a particular example of at least 3 items with Y=250 ms, N=6 (6 threads) with each predetermined time period equal to 10 ms, and M=25 (i.e., a total array time of 25×10 ms=250 ms).

As shown, the three items included are the MAX_SLEEP_SCALER for a 205 ms totaling sampling of M=25 predetermined time periods, the raw count data of the M*N array for the M=25 by 10 ms length predetermined time periods (i.e., 250 ms total period), and the All-waits percentage during the same length period of 250 ms. In this example, the display function discussed above may derive the idle count in units of percentage (%), i.e. dividing each individual sleep count with MAX_SLEEP_SCALER, and display the sleep profiling per thread. Nonetheless, in an alternative this percentage calculation may be performed by the multi-thread processor under scrutiny and sent as another field in the data set.

FIG. 8illustrates a block diagram of another exemplary apparatus800for determining a profile of a multi-thread processor. Apparatus800include various modules or means for effecting various functions, such as those functions described above in connection with methods600and700acting to derive performance profiles of the multi-thread processor. The means or modules of apparatus800may be implemented with hardware, software, firmware, or any combination thereof. Furthermore, the multi-thread processor under scrutiny, another processor, a personal computer, dedicated device, or any combination thereof may implement the various modules or means of apparatus800. Additionally, in one aspect the apparatus800may be implemented at least in part within a wireless communication device.

Apparatus800includes a means for executing at least one idle task in at least one thread of the multi-thread processor (e.g., processor302) during at least one predetermined time period, the idle task configured to loop and run when no other task is running on the at least one thread802. In one example, means802may be implemented by processor302and, in particular, the OS running of the processor (e.g., OS402). Apparatus800further includes a communication means or communicative coupling represented inFIG. 8as coupling804to merely indicate communication between means or passing of information among the various functions.

Apparatus further includes means806for determining at least one count of loop executions of the at least one idle task over the at least one predetermined time period. In one example, means806may also be effected by the multi-thread processor (e.g.,302) in conjunction with a means to increment and store a count of the loops of the idle task, such as a register (e.g., register404discussed previously). The count information accumulated by means806may then be communicated to a means808for determining loading of at least the at least one thread of the multi-thread processor based on the at least one count of the number of loop executions. It is noted that means808may be implemented with the multi-thread processor, another processor, a personal computer or other computer external to the device containing the multi-thread processor. For example, the raw count data from means806may be made part of a data set such as the data set in Table 1, which is in turn sent to an external device for determining the loading.

Furthermore, apparatus800may include a means for displaying performance profile(s)810. Alternatively, means810may be configured as a means for sending the performance profile data set to a display (not shown) that is external to apparatus800. Additionally, the apparatus800may alternatively include a processor812and a memory814that, among other things, may store code executable by a processor (e.g., the multi-thread processor or processor812) and also store performance profile data. Finally, apparatus800may include additional hardware or logic816configured to determine data such as the number of CPU cycles the multi-thread processor is idle or waiting, which is the All_Wait_Cycle discussed previously.

One skilled in the art will appreciate that the above-disclosed apparatus and methods afford a dynamic and real-time manner of processor performance profiling without the need for additional equipment or software. Further, the presently disclosed profiling does not cause performance degradation since the profiling is performed, in part, with “idle” tasks. The present apparatus and methods may be instrumental for debugging and system optimization, including power optimization. Moreover, the methods and apparatus may be utilized for design and development of a system using the CPU as a testing tool, or also could be implemented with the CPU in use, such as in a wireless device, to perform profiling that enables ongoing “on-the-fly” optimization of the CPU and/or attendant system.

In a particular aspect, the presently disclosed methods and apparatus provide a dynamic and real-time manner to measure and profile processor performance for wireless devices, although they are not limited only to such devices. The disclosed methods and apparatus may include design and implementation of the “idle” task, design of the “all-wait percentage” function, deriving the maximum sleep or idle count Scalar, collecting and submitting the profiling record data set, and displaying any or all profiling information in a real-time fashion. In summary, the presently disclosed apparatus and methods provide an innovative way to measure multi-thread processor CPU loading under various use cases and data rates, to probe the multi-thread processor CPU usage, per each thread, and to probe the multi-thread processor “all-wait” (i.e. all processor threads are idle) status, when particular task are being performed, such as a packet data session that is ongoing in a wireless device. It is noted that all these provided features do not require wireless standardization or any additional tools.