Task unit cpu use rate measurement system
Abstract
[Task] Allow the middleware operating system to measure CPU usage for each task.
Solution.Task management unit 314 that controls middleware operating system management tasks, CPU usage information storage unit 315 that records information about tasks from task management unit 314, and time acquisition unit 317 that acquires time from the hardware timer. The CPU usage time is calculated from the CPU acquisition time and CPU release time from the time acquisition unit 137, the CPU usage time is detected at regular time interval waiting times, and the task is based on the detected change in CPU usage time and sampling interval. It is composed of a CPU usage rate calculation unit 317 that calculates a unit CPU usage rate.
Term
Term ended
Projected expiry passed 28 August 2016, 10.1 years ago.
- Priority and filed
- Published
- Projected expiry
- Today
3 claims: 1 independent, 2 dependent
- 1【特許請求の範囲】 【請求項1】(a)ミドルウェアオペレーティングシステム管理のタスクを制御するタスク管理手段と、(b)前記タスク管理手段によりタスクに関する情報が記録されるCPU使用情報記憶手段と、(c)ハードウェアタイマより時刻を取得する時刻取得手段と、(d)前記時刻取得手段からのCPU取得時刻とCPU解放時間とからCPU使用時間を求め、CPU使用時間を一定時間隔待ち時間ごとに検出し、検出されたCPU使用時間の変化量とサンプリング間隔とからタスク単位CPU使用率を算出するCPU使用率算出手段と、を有することを特徴とするタスク単位CPU使用率測定システム。
- 2【請求項2】 タスクに関する固有情報として、タスク名と、CPU取得時刻と、CPU解放時刻と、CPU取得時刻およびCPU解放時刻の差分から算出されるCPU使用時間とを保持するCPU情報記憶手段を有することを特徴とする請求項1記載のタスク単位CPU使用率測定システム。
- 3【請求項3】 前記CPU使用率算出手段が、タスク単位の前記CPU使用時間の変化量の前記一定時間間隔待ち時間に対する割合をタスク単位CPU使用率として算出することを特徴とする請求項1記載のタスク単位CPU使用率測定システム。
Independent claims3
79 paragraphs in 1 section, as filed
Description: TECHNICAL FIELD [Detailed description of the invention]
【0001】
[Technical field to which the invention belongs]
The present invention relates to a task-based CPU usage measurement system for middleware operating system management, and more particularly to a task-based CPU usage measurement system for middleware operating system management that enables measurement of CPU usage for each task.
【0002】
[Conventional technology]
The execution of application programs in a computer system is controlled by the operating system (hereinafter referred to as the OS).
【0003】
The computer system targeted by the present invention has a function of simultaneously operating a program using an API realized by another architecture in addition to the application interface (hereinafter referred to as API) provided by the kernel OS. ing. This function is realized by installing a middleware OS on the kernel OS. In the conventional technology for measuring the CPU usage rate per program in the above computer system, for example, as in the method described in "Japanese Patent Laid-Open No. 6-75782", the OS is responsible for measuring the CPU resource usage rate for each application program. Processing.
【0004】
As a measurement technique, the CPU usage rate is calculated for each program by taking the ratio of the time from the program generation to the deletion and the time when the CPU is actually used.
【0005】
[Problems to be Solved by the Invention]
The first problem of the above-mentioned conventional technology is that the CPU usage rate of the program running on the middleware OS cannot be grasped by the kernel OS. The reason is that the middleware OS is one application program when viewed from the kernel OS, and the information of the program managed independently by the middleware OS is closed in the middleware OS management.
【0006】
The second problem is that the function of the middleware OS itself does not acquire information on the time when calculating the CPU usage time. The reason is that the time information output by the hardware timer can be acquired as a function of the kernel OS, but the output value of the hardware timer cannot be acquired directly from the middleware OS.
【0007】
An object of the present invention is to enable system performance analysis by calculating the CPU usage rate for each task in a middleware OS management program.
【0008】
[Means for solving problems]
The first task-based CPU usage measurement system of the present invention includes (a) a task management means for controlling a task of middleware operating system management, and (b) CPU usage information in which information about the task is recorded by the task management means. The CPU usage time is calculated from the storage means, (c) the time acquisition means for acquiring the time from the hardware timer, and (d) the CPU acquisition time and the CPU release time from the time acquisition means, and the CPU usage time is set to a fixed time. It is provided with a CPU usage rate calculation means that detects each interval waiting time and calculates the CPU usage rate for each task from the detected change amount of CPU usage time and sampling interval.
【0009】
The second task-based CPU usage rate measuring system of the present invention is the first task-based CPU usage rate measuring system, and includes the task name, CPU acquisition time, CPU release time, and CPU as unique information about the task. It is provided with a CPU information storage means that holds the CPU usage time calculated from the difference between the acquisition time and the CPU release time.
【0010】
The third task unit CPU usage rate measurement system of the present invention is the first task unit CPU usage rate measurement system, and sets the ratio of the amount of change in the CPU usage time in the task unit to the fixed time interval waiting time as a task. The CPU usage rate calculation means for calculating as a unit CPU usage rate is provided.
【0011】
BEST MODE FOR CARRYING OUT THE INVENTION
Next, an embodiment of the present invention will be described with reference to FIGS. 1 and 2. FIG. 2 is a block diagram showing a system to which the task-based CPU usage measurement system of the present invention is applied. Figure 1 is a block diagram of the task-based CPU usage measurement system built in the middleware OS thread of Figure 2. Referring to FIG. 2, the task-based CPU usage measurement system of the present invention controls software with kernel OS1. Kernel OS1 manages programs in units called processes, and process A2, which is directly controlled by kernel OS1, and process B3, which is controlled via middleware OS thread 31, are mixed in this system. Process A2 is composed of multiple threads, and control information is referenced by kernel OS1. On the other hand, process B3 collects several application threads to form the concept of task 32, and this task 32 is controlled by middleware OS thread 31 which exists as another thread in process B3. In addition, the middleware OS thread 31 has an interface with the external storage device 8.
【0012】
Also, referring to FIG. 1, the middleware OS thread 31 acquires the time to acquire the output value of the hardware timer by the task management unit 314 that controls the application thread group as the task 32 and one function provided by the kernel OS1. As information about the control unit 317 and the task, the task name, the CPU acquisition time when the CPU started to be used, the CPU release time when the task temporarily released the CPU for I / O of peripheral devices, and the CPU acquisition time. The CPU usage information storage unit 315 that holds the CPU usage time calculated from the difference between the CPU release time and the CPU release time, and the above CPU usage time that stores the cumulative value since the task was generated are set in advance at a preset time interval. It is equipped with a CPU usage rate calculation unit 316 that refers to each, takes the difference between the previous CPU usage time and the current CPU usage time referenced immediately before, calculates the ratio to the reference interval time, and calculates the CPU usage rate. .. In addition, the calculated CPU rate and task name are stored in the external storage device 8.
【0013】
Next, the operation of the embodiment of the present name will be described with reference to FIGS. 3 to 5. FIG. 3 is a flowchart of processing of the task management unit showing the embodiment of the present invention. When a task running on the middleware OS thread 31 is executed, the task management unit 314 in the middleware OS thread 31 operates, generates task information in the CPU usage information storage unit 315, and starts the task (Fig. 3). 401). Next, the task start time is acquired from the time acquisition control unit 317 (402 in FIG. 3), and recorded as the CPU acquisition time in the CPU usage information storage unit 315 of the corresponding task (403 in FIG. 3).
【0014】
When an interrupt from the task switch, that is, the middleware OS thread 31 occurs (404 in Fig. 3), the CPU release time is acquired from the time acquisition control unit 317 (405 in Fig. 3) and recorded in the CPU usage information storage unit 315. (406 in Figure 3). Subsequently, the CPU acquisition time and the CPU release time are acquired from the CPU usage information storage unit 315, the difference is calculated as the CPU usage time (407 in FIG. 3), and recorded in the CPU usage information storage unit 315 (FIG. 3). 408). After waiting for rescheduling from the middleware OS thread 31 (409 in Fig. 3), the CPU acquisition time is acquired from the time acquisition control unit 317 (410 in Fig. 3), and the CPU acquisition time recording process (403 in Fig. 3). Loop back to.
【0015】
When a task termination, that is, a request to end a task is made (411 in FIG. 3), the task information is released from the CPU usage information storage unit 315 to end the task (412 in FIG. 3).
【0016】
If the above two cases do not occur (411 in Fig. 3), the processing of the task itself continues to be executed.
【0017】
FIG. 4 is a flowchart showing the processing of the CPU usage rate calculation unit 316 of FIG. The process of the CPU usage rate calculation unit 316 acquires the name of the task to be measured (601 in FIG. 4), and searches the CPU usage information storage unit 315 for information corresponding to the task. If there is no information for the corresponding task, the process ends abnormally (602 in Fig. 4). When the information of the corresponding task is found, the CPU usage time is read, the previous CPU usage time is set in the CPU usage rate calculation unit 316 (603 in Fig. 4), and the timer waits for a certain period of time (604 in Fig. 4). When the wait is canceled by the timer, the CPU usage time is read from the CPU usage information storage unit 315 and set in the CPU usage rate calculation unit 316 as the current CPU usage time (605 in Fig. 4).
【0018】
Next, the difference between the previous CPU usage time and the current CPU usage time in the CPU usage rate calculation unit 316 is calculated, and the result is divided by the timer wait time to obtain the CPU usage rate (606 in FIG. 4). The obtained CPU usage rate is output to the external storage device 8 together with the task name to store the data.
【0019】
<CPU usage rate calculation formula> is as follows. CPU usage rate [%] = (current CPU usage time-previous CPU usage time) / (timer wait time) x 100 After that, the current CPU usage time is copied to the previous CPU usage time in the CPU usage rate calculation unit (316 in Fig. 1) (607 in Fig. 4), and the timer wait processing of the set interval time (604 in Fig. 4) and later. Continue.
【0020】
FIG. 5 is a flowchart showing the processing of the time acquisition control unit 317 of FIG.
【0021】
When the time acquisition control unit 317 receives a time acquisition request from the task management unit 314, it acquires the output value of the hardware timer using the time acquisition API provided by kernel OS1 (701 in Fig. 5). ), Pass the time information to the task management unit 314 (702 in Fig. 5).
【0022】
Next, examples of the present invention will be described with reference to FIGS. 1 to 5.
【0023】
When the task management unit 314 receives a request to start process B3, it sets "process B" in the task name of the CPU usage information storage unit 315 as the task information of process B3 and starts it (401 in Fig. 3). Next, the start time of process B3 is acquired by the time acquisition control unit 317, and '00:00:00: 000 milliseconds' is set in the area corresponding to process B3 in the CPU information storage unit 315 (403 in Fig. 3). ).
【0024】
When a task switch from middleware OS thread 31 occurs (404 in Fig. 3), the time when the event occurred '00: 00: 00: 500 milliseconds' is acquired as the CPU release time (405 in Fig. 3), and the CPU is acquired. Set the difference between the time and the CPU release time, '500 milliseconds', as the CPU usage time (407 in Figure 3). When rescheduling from the middleware OS thread 31 (409 in Fig. 3), the time is acquired as the CPU acquisition time '00: 00: 01: 500 milliseconds' (410 in Fig. 3). Subsequent processing is continued, but when the CPU usage time is set (407 in Fig. 3), the processing to add to the previous value is provided in order to accumulate the CPU usage time.
【0025】
When the task terminate request is raised (411 in Fig. 3), the task information of process B3 is deleted from the CPU usage information storage unit 315.
【0026】
Next, when the CPU usage rate calculation unit 316 receives a CPU usage rate measurement request for process B3, the task name "process B" of process B3 is acquired (601 in FIG. 4), and the process is processed from the CPU usage information storage unit 315. Read the CPU usage time '2 seconds 000 milliseconds' of B3, set it as the previous CPU usage time (603 in Fig. 4), and wait by the set interval time '10 seconds' interval timer (604 in Fig. 4). When the wait is canceled by the timer, the CPU usage time of process B3 is read from the CPU usage information storage unit 315 and set as the current CPU usage time '5 seconds 000 milliseconds' (605 in Fig. 4).
【0027】
The CPU usage rate calculation unit 316 calculates the difference between the previous CPU usage time of '2 seconds 000 milliseconds' and the current CPU usage time of '5 seconds 000 milliseconds' and the difference '3 seconds 000 milliseconds', and calculates this result as the timer wait interval. Divide the time by '10 seconds 000 milliseconds' to get the CPU usage as follows (606 in Figure 4).
【0028】
CPU usage = ('5 seconds 000 ms'-' 2 seconds 000 ms') / ('10 seconds') x 100 = 30.0 [%] The task name "process B" and its CPU usage rate "30.0%" are stored and saved as analysis data in a file on the external storage device 8. After that, the current CPU usage time '5 seconds 000 milliseconds' is copied to the previous CPU usage time (607 in Fig. 4), and the timer wait processing (604 in Fig. 4) with the set interval time '10 seconds 000 milliseconds' is performed. to continue.
【0029】
[Effect of the invention]
As described above, the first effect of the present invention is that in a computer system equipped with a middleware OS, performance analysis can be performed when an application program is created on the middleware OS and the system is constructed. The reason is that it becomes possible to grasp the execution status of the middleware OS management program that is closed from the kernel OS.
【0030】
The second effect is that performance analysis can be performed even if the kernel OS itself does not have the ability to measure system performance. The reason is that the output value of the hardware timer is collected by using the function of the kernel OS without using the function related to the performance data collection of the kernel OS, and the CPU usage rate is measured.
[Simple explanation of drawings]
[Figure 1]
It is a block diagram which shows the embodiment of this invention.
[Figure 2]
It is a block diagram which shows the system to which the embodiment of FIG. 1 is applied.
[Fig. 3]
It is a flowchart which shows the process of the task management part of FIG.
[Fig. 4]
It is a flowchart which shows the processing process of the CPU usage rate calculation part of FIG.
[Fig. 5]
It is a flowchart which shows the process of the time acquisition control part of FIG.
[Explanation of symbols]
1 kernel OS 2 Process A 3 Process B 8 External storage 31 Middleware OS thread 32 tasks 314 Task Management Department 315 CPU usage information storage 316 CPU usage rate calculation unit 317 Time acquisition control unit
Every citation, both ways
| Document | Relation | Office | Cited during |
|---|---|---|---|
| KR100469406B1 | Cited by | Republic of Korea | Search report |
| KR100613201B1 | Cited by | Republic of Korea | Search report |
| JP2006134170A | Cited by | Japan | Search report |
| US7703095B2 | Cited by | United States of America | Applicant |
| JP2009301079A | Cited by | Japan | Search report |
| KR100613201B1 | Cited by | Republic of Korea | Examiner |
| CN111159038A | Cited by | China | Search report |
2 priority claims, no other members on record
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 22722696 | Japan | A | |
| JP19960227226 | – | – | – |
1 legal event, as the office reported them to INPADOC
Events
| Event | Code | |
|---|---|---|
| Decision of refusalJAPANESE INTERMEDIATE CODE: A02A02 | A02 |
Numbers
- Publication
- 10-69405
- Publication, DOCDB
- H1069405
- Publication, EPODOC
- JPH1069405
- Application
- 8227226
- Application, DOCDB
- 22722696
- Application, EPODOC
- JP19960227226
Titles2
- Japanese
- 【発明の名称】タスク単位CPU使用率測定システム
- English
- INDUSTRIAL APPLICABILITY: Task unit CPU usage rate measurement system
Classification
- IPC, 2
- G06F11 34
- G06F9 46