Movatterモバイル変換


[0]ホーム

URL:


KR20120064553A - Method for measuring real-time performance in linux-based embedded system and the system - Google Patents

Method for measuring real-time performance in linux-based embedded system and the system
Download PDF

Info

Publication number
KR20120064553A
KR20120064553AKR1020100125832AKR20100125832AKR20120064553AKR 20120064553 AKR20120064553 AKR 20120064553AKR 1020100125832 AKR1020100125832 AKR 1020100125832AKR 20100125832 AKR20100125832 AKR 20100125832AKR 20120064553 AKR20120064553 AKR 20120064553A
Authority
KR
South Korea
Prior art keywords
time
interrupt
real
task
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
KR1020100125832A
Other languages
Korean (ko)
Inventor
정영준
Original Assignee
한국전자통신연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국전자통신연구원filedCritical한국전자통신연구원
Priority to KR1020100125832ApriorityCriticalpatent/KR20120064553A/en
Publication of KR20120064553ApublicationCriticalpatent/KR20120064553A/en
Withdrawnlegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromKorean

본 발명은 리눅스 기반 임베디드 시스템에서 실시간 성능 측정 방법 및 그 시스템을 개시한다. 상기 리눅스 기반 임베디드 시스템은 커널 모드 상에서 동작하도록 구성되며 주기적인 인터럽트를 발생시키는 RTC(Real Time Clock)와, 커널 모드 상에서 동작하도록 구성되며, 상기 RTC로부터 인터럽트를 수신하고, 상기 인터럽트가 수신된 시점에서의 시스템 카운터값을 인터럽트 발생 시점값으로 기록하고 인터럽트에 대응한 태스크를 웨이크업하는 인터럽트 핸들러와, 커널 모드 상에서 동작하도록 구성되며, 상기 인터럽트에 대응한 태스크가 웨이크업되면, 가장 높은 우선순위를 가진 태스크가 우선적으로 실행되도록 스케줄링을 수행하고 상기 태스크를 실행하기 위한 태스크 실행 신호를 발생시키는 스케줄러와, 유저 모드 상에서 동작하도록 구성되며, 상기 인터럽트 핸들러로부터 상기 인터럽트 발생 시점값을 수신하며, 상기 스케줄러로부터 상기 태스크 실행 신호를 수신할 때 상기 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값으로서 기록하고 상기 태스크 시작 시점값으로부터 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 실시간 성능 측정 장치를 포함한다.The present invention discloses a method and system for real-time performance measurement in a Linux-based embedded system. The Linux-based embedded system is configured to operate in kernel mode and generates a real time clock (RTC) that generates periodic interrupts, and is configured to operate in kernel mode, receives an interrupt from the RTC, and at the time the interrupt is received, An interrupt handler configured to record a system counter value of the interrupt as an interrupt occurrence time value and wake up a task corresponding to the interrupt; and to operate in kernel mode, and when the task corresponding to the interrupt wakes up, A scheduler configured to execute a task to execute preferentially and to generate a task execution signal for executing the task, and to operate in a user mode, receive the interrupt occurrence time value from the interrupt handler, andAnd a real-time performance measurement device that records a system counter value at the received time point as a task start time point value when receiving a task execution signal and calculates a preemption delay time by subtracting an interrupt occurrence time point value from the task start time point value. .

Description

Translated fromKorean
리눅스 기반 임베디드 시스템에서 실시간 성능 측정 방법 및 그 시스템{method for measuring real-time performance in Linux-based embedded system and the system}Method for measuring real-time performance in Linux-based embedded system and the system

본 발명은 리눅스 기반 임베디드 시스템에서 실시간 성능 측정 방법 및 그 시스템 에 관한 것이다.The present invention relates to a real-time performance measurement method and a system in the Linux-based embedded system.

최근 안드로이드와 같은 리눅스 기반 스마트폰의 수요가 폭발하는 것은 물론 IPTV 셋톱박스, MID 및 산업용 기기에 이르기까지 다양한 분야에서 리눅스 기반의 임베디드 시스템의 수요는 급속한 확산일로에 들어서 있다. 이와 같이 확산되고 있는 리눅스 기반의 임베디드 시스템을 이용한 서비스 중 동영상 재생, 통화기능, 인터넷을 통한 제어 등의 여러 가지 서비스에서 실시간 성능이 좋을 것이 요구되고 있는 실정이다.Recently, the demand for Linux-based smartphones such as Android is exploding, and the demand for Linux-based embedded systems is rapidly expanding in various fields such as IPTV set-top boxes, MIDs, and industrial devices. Among the services using the Linux-based embedded system, the real-time performance is required to be good in various services such as video playback, call function, and control through the Internet.

이렇게 리눅스 기반 임베디드 시스템의 실시간 성능이 좋을 것이 요구되는 서비스로 인해 임베디드 시스템용 플랫폼을 위한 실시간 성능을 지원하는 기술들이 요구되고 있다. 따라서, 이러한 실시간 성능을 지원하는 기술을 개발하고 임베디드 시스템에 적용하기 위해 리눅스 기반 임베디드 시스템을 위한 실시간 성능 측정 기법이 요구된다.Due to the services that require good real-time performance of Linux-based embedded systems, technologies that support real-time performance for platforms for embedded systems are required. Therefore, in order to develop a technology supporting the real-time performance and apply it to an embedded system, a real-time performance measurement technique for a Linux-based embedded system is required.

이와 관련하여 현재 주로 사용되고 있는 리눅스 기반 임베디드 시스템용 실시간 성능 측정 기법은 성능을 측정하고자 하는 구간이 다소 불분명하고, 측정 결과가 다소 부정확하며 직관적이지 못해 개발시에 많이 활용되지 못했다.In this regard, the real-time performance measurement technique for Linux-based embedded systems, which is mainly used, has not been widely used in development because the interval to measure performance is somewhat unclear, the measurement results are inaccurate and not intuitive.

따라서, 본 발명은 상술한 종래의 문제점을 해결하고 새로운 방법을 제안하기 위한 것으로서, 본 발명의 목적은 실시간 성능 측정 구간을 명확하게 하고, 실시간 성능을 정밀하게 측정할 수 있는, 리눅스 기반 임베디드 시스템에서 실시간 성능 측정 방법 및 그 시스템을 제공한다.Accordingly, the present invention is to solve the above-mentioned problems and to propose a new method, and an object of the present invention is to clarify a real-time performance measurement interval, and to accurately measure real-time performance in a Linux-based embedded system. It provides a real-time performance measurement method and system.

상기 목적을 달성하기 위한 본 발명의 일 측면에 따라, 리눅스 기반 임베디드 시스템은 커널 모드 상에서 동작하도록 구성되며 주기적인 인터럽트를 발생시키는 RTC(Real Time Clock)와, 커널 모드 상에서 동작하도록 구성되며, 상기 RTC로부터 인터럽트를 수신하고, 상기 인터럽트가 수신된 시점에서의 시스템 카운터값을 인터럽트 발생 시점값으로 기록하고 인터럽트에 대응한 태스크를 웨이크업하는 인터럽트 핸들러와, 커널 모드 상에서 동작하도록 구성되며, 상기 인터럽트에 대응한 태스크가 웨이크업되면, 가장 높은 우선순위를 가진 태스크가 우선적으로 실행되도록 스케줄링을 수행하고 상기 태스크를 실행하기 위한 태스크 실행 신호를 발생시키는 스케줄러와, 유저 모드 상에서 동작하도록 구성되며, 상기 인터럽트 핸들러로부터 상기 인터럽트 발생 시점값을 수신하며, 상기 스케줄러로부터 상기 태스크 실행 신호를 수신할 때 상기 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값으로서 기록하고 상기 태스크 시작 시점값으로부터 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 실시간 성능 측정 장치를 포함한다.According to an aspect of the present invention for achieving the above object, a Linux-based embedded system is configured to operate in kernel mode and generates a real time clock (RTC) that generates periodic interrupts, and is configured to operate in kernel mode, the RTC An interrupt handler configured to receive an interrupt from the interrupt, write a system counter value at the time the interrupt is received as an interrupt occurrence value, and wake up a task corresponding to the interrupt; When a task wakes up, it is configured to operate in user mode, with a scheduler that performs scheduling so that the task with the highest priority executes preferentially and generates a task execution signal for executing the task, from the interrupt handler The interrupt foot Receives a starting point value, when receiving the task execution signal from the scheduler, records the system counter value at the received starting point as a task starting starting point value and subtracts an interrupt occurrence starting point value from the task starting starting point value It includes a real-time performance measurement device to calculate the.

본 발명의 다른 측면에 따라, 리눅스 기반 임베디드 시스템에서 실시간 성능을 측정하는 방법은, 커널 모드 상에서 동작하도록 구성된 RTC(Real Time Clock)에 의해 주기적인 인터럽트를 발생시키는 단계와, 커널 모드 상에서 동작하도록 구성된 인터럽트 핸들러에 의해, 상기 RTC로부터 인터럽트를 수신하고, 상기 인터럽트가 수신된 시점에서의 시스템 카운터값을 인터럽트 발생 시점값으로 기록하는 단계와, 상기 인터럽트 핸들러에 의해 상기 인터럽트에 대응한 태스크를 웨이크업하는 단계와, 커널 모드 상에서 동작하도록 구성된 스케줄러에 의해, 상기 인터럽트에 대응한 태스크가 웨이크업되면, 가장 높은 우선순위를 가진 태스크가 우선적으로 실행되도록 스케줄링을 수행하는 단계와, 상기 스케줄러에 의해 상기 태스크를 실행하기 위한 태스크 실행 신호를 발생시키는 단계와, 유저 모드 상에서 동작하도록 구성된 실시간 성능 측정 장치에 의해, 상기 인터럽트 핸들러로부터 상기 인터럽트 발생 시점값을 수신하는 단계와, 상기 실시간 성능 측정 장치에 의해 상기 스케줄러로부터 상기 태스크 실행 신호를 수신할 때 상기 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값으로서 기록하는 단계와, 상기 실시간 성능 측정 장치에 의해 상기 태스크 시작 시점값으로부터 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 단계를 포함한다.According to another aspect of the present invention, a method for measuring real-time performance in a Linux-based embedded system includes generating a periodic interrupt by a Real Time Clock (RTC) configured to operate in kernel mode, and configured to operate in kernel mode. Receiving an interrupt from the RTC by an interrupt handler, recording a system counter value at the time the interrupt is received as an interrupt occurrence time value, and waking up the task corresponding to the interrupt by the interrupt handler; And scheduling by the scheduler configured to operate in kernel mode so that, when the task corresponding to the interrupt wakes up, the task having the highest priority is preferentially executed; A task to run it Generating a signal, receiving, by the real time performance measuring device configured to operate in a user mode, the interrupt occurrence time value from the interrupt handler, and receiving the task execution signal from the scheduler by the real time performance measuring device. Calculating a preemption delay time by subtracting an interrupt occurrence time point value from the task start time point value by the real time performance measuring apparatus by recording a system counter value at the received time point as a task start time point when receiving; It includes.

본 발명의 또 다른 측면에 따라, 실시간 성능 측정 장치에서 실시간 성능을 측정하는 방법은 상기 실시간 성능 측정 장치에 의해 상기 커널 모드 상에서 동작하도록 구성된 RTC(Real Time Clock)가 주기적으로 인터럽트를 발생시키도록 설정하는 단계와, 커널 모드 상에서 동작하도록 구성된 인터럽트 핸들러로부터 인터럽트 발생 시점값을 수신하는 단계와, 커널 모드 상에서 동작하도록 구성된 스케줄러로부터 상기 인터럽트에 대응한 태스크를 실행하기 위한 태스크 실행 신호를 수신하는 단계와. 상기 스케줄러로부터 상기 태스크 실행 신호를 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값으로서 기록하는 단계와, 상기 태스크 시작 시점값으로부터 상기 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 단계를 포함한다.According to another aspect of the present invention, a method for measuring real-time performance in a real-time performance measuring device is set such that a real time clock (RTC) configured to operate in the kernel mode by the real-time performance measuring device periodically generates an interrupt. Receiving an interrupt occurrence time value from an interrupt handler configured to operate in kernel mode, and receiving a task execution signal for executing a task corresponding to the interrupt from a scheduler configured to operate in kernel mode; Recording a system counter value at the time point of receiving the task execution signal from the scheduler as a task start time point value, and calculating a preemption delay time by subtracting the interrupt occurrence time point value from the task start time point value; do.

본 발명에 따르면 기존의 리눅스 기반 임베디드 시스템의 실시간 성능 측정보다 명확한 실시간 성능 측정 구간에 해당하는 지연시간을 하드웨어 시스템 카운터를 이용하여 정밀하게 측정할 수 있으며, 기존의 다양한 방법보다 훨씬 사용자 직관적인 선점 지연시간의 결과값을 얻을 수 있는 장점이 있다.According to the present invention, a delay time corresponding to a clear real-time performance measurement interval can be precisely measured using a hardware system counter than a real-time performance measurement of a conventional Linux-based embedded system, and is more user intuitive than the conventional methods. The advantage is that you get the result of time.

또한, 본 발명에 따른 리눅스 기반 임베디드 시스템에서 실시간 성능을 측정하는 장치 및 방법은 임베디드 시스템용 리눅스의 실시간 성능을 개선하기 위한 성능 측정 도구로 활용될 수 있다.In addition, the apparatus and method for measuring real-time performance in the Linux-based embedded system according to the present invention can be utilized as a performance measurement tool for improving the real-time performance of Linux for embedded systems.

도 1은 본 발명에 따른 실시간 성능 측정 장치를 포함하는 리눅스 기반 임베디드 시스템을 모시적으로 도시한 도면이다.
도 2는 본 발명에 따른 실시간 성능 측정 구간을 나타낸 도면이다.
도 3은 본 발명의 일 실시예에 따른 선점 지연시간을 측정하는 프로세스를 나타낸 도면이다.
도 4는 본 발명의 일 실시예에 따른 실시간 성능 측정 장치의 블록 구성도를 나타낸 도면이다.
도 5는 본 발명의 일 실시예에 따른 실시간 성능 측정 방법을 나타낸 플로우차트이다.
1 is a diagram schematically showing a Linux-based embedded system including a real-time performance measurement apparatus according to the present invention.
2 is a diagram showing a real-time performance measurement interval according to the present invention.
3 is a diagram illustrating a process of measuring a preemption delay time according to an embodiment of the present invention.
4 is a block diagram of a real-time performance measurement apparatus according to an embodiment of the present invention.
5 is a flowchart illustrating a real-time performance measurement method according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.As the invention allows for various changes and numerous embodiments, particular embodiments will be illustrated in the drawings and described in detail in the written description. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.The terms first, second, A, B, etc. may be used to describe various elements, but the elements should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as a second component, and similarly, the second component may also be referred to as a first component. And / or < / RTI > includes any combination of a plurality of related listed items or any of a plurality of related listed items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is referred to as being "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that other components may be present in between. Should be. On the other hand, when an element is referred to as being "directly connected" or "directly connected" to another element, it should be understood that there are no other elements in between.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "comprise" or "have" are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, and one or more other features. It is to be understood that the present invention does not exclude the possibility of the presence or the addition of numbers, steps, operations, components, components, or a combination thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in the commonly used dictionaries should be construed as having meanings consistent with the meanings in the context of the related art and shall not be construed in ideal or excessively formal meanings unless expressly defined in this application. Do not.

이하, 본 발명에 따른 실시예들을 첨부된 도면을 참조하여 상세하게 설명한다.
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명에 따른 실시간 성능 측정 장치를 포함하는 리눅스 기반 임베디드 시스템을 모시적으로 도시한 도면이다.1 is a diagram schematically showing a Linux-based embedded system including a real-time performance measurement apparatus according to the present invention.

본 발명에서 실시간 성능 측정의 의미는 어떤 이벤트(본 명세서에서는 RTC 인터럽트)로부터 어느 정도의 지연시간 이내에 그 이벤트에 해당하는 태스크를 구동시켜줄 수 있는지를 측정하는 것이다.In the present invention, the meaning of the real-time performance measurement is to measure which event (RTC interrupt in this specification) can drive a task corresponding to the event within a certain delay time.

일반적으로, 태스크 선점 지연시간(Preemption Latency)는 하드웨어 인터럽트가 발생하여 현재 수행되고 있는 태스크보다 높은 우선순위를 가지는 태스크가 수행되어야 할 경우에 인터럽트가 발생한 시점부터 해당 인터럽트에 의해 높은 우선순위를 가지는 태스크가 실행하기 시작할 때까지의 시간을 의미한다.In general, task preemption delay is a task having a high priority by an interrupt when a interrupt occurs when a task having a higher priority than a task currently being performed due to a hardware interrupt occurs. Means the time until it starts to run.

그러나, 이러한 태스크 선점 지연시간을 측정하는 기법에 대한 기술은 현재 명시적으로 규정되어 있지 않다. 또한, 태스크 선점 지연시간은 하드웨어 인터럽트가 발생한 시점부터 측정되어야 하는데, 이 시점을 어떻게 규정하는 지에 대해서도 종래 기술에서는 규정하지 않고 있다.However, a technique for measuring such task preemption delay is not currently explicitly defined. In addition, the task preemption delay time should be measured from the time when the hardware interrupt occurs, and the prior art does not define how to specify this time point.

본 발명에 따른 실시간 성능 측정 장치(100)는 인터럽트가 발생한 시점부터 태스크가 수행되는 시점을 명확히 규정함으로써 성능 측정을 용이하게 한다.Theapparatus 100 for real-time performance measurement according to the present invention facilitates performance measurement by clearly defining a time point at which a task is performed from a time point at which an interrupt occurs.

이를 위해, 본 발명에 따른 실시간 성능 측정 장치(100)는 도 1에 도시된 바와 같이, 리눅스 기반 임베디드 시스템에서 유저 모드 상에서 구현된다.To this end, the real-timeperformance measurement apparatus 100 according to the present invention is implemented in the user mode in the Linux-based embedded system, as shown in FIG.

실시간 성능 측정 장치(100)는 시스템 인터페이스(200)를 통해 커널 모드의 구성요소들(310-330) 중 일부와 통신한다.Theapparatus 100 for real-time performance measurement communicates with some of the components 310-330 in kernel mode via thesystem interface 200.

커널 모드 구성요소들은 인터럽트 핸들러(310), 스케줄러(320), 디바이스 드라이버(330) 등을 포함한다. 디바이스 드라이버(330)는 네트워크 드라이버(332), 디스플레이 드라이버(334), RTC(Real-Time Clock)(336) 등을 포함한다.Kernel mode components include aninterrupt handler 310, ascheduler 320, adevice driver 330, and the like. Thedevice driver 330 includes anetwork driver 332, a display driver 334, a real-time clock (RTC) 336, and the like.

인터럽트 핸들러(310)는 어떤 특정 인터럽트가 발생했을 시 실행될 루틴 혹은 함수를 의미한다. 다시 말해, 인터럽트 핸들러(310)는 인터럽트가 발생하면, 스케줄러(320)에게 발생된 인터럽트에 대응한 태스크의 실행을 요청한다. 이를 위해, 인터럽트 핸들러(310)는 인터럽트가 발생하면 발생된 인터럽트에 대응한 태스크를 스케줄러(320)로 통지한다. 구체적으로 인터럽트 핸들러(310)는 인터럽트에 따라 우선순위가 높은 태스크들을 웨이크업(wake-up)한다. 이 경우, 인터럽트 핸들러(310)는 본 발명에 따라 상기 인터럽트가 수신된 시점에서의 시스템 카운터값을 인터럽트 발생 시점값으로 기록하고, 이 인터럽트 발생 시점값을 실시간 성능 측정 장치(100)로 제공한다.Theinterrupt handler 310 refers to a routine or a function to be executed when a specific interrupt occurs. In other words, when an interrupt occurs, theinterrupt handler 310 requests thescheduler 320 to execute a task corresponding to the generated interrupt. To this end, theinterrupt handler 310 notifies thescheduler 320 of a task corresponding to the generated interrupt when an interrupt occurs. In detail, theinterrupt handler 310 wakes up tasks having a high priority according to an interrupt. In this case, theinterrupt handler 310 records the system counter value at the time when the interrupt is received as an interrupt generation time value and provides the interrupt generation time value to the real-timeperformance measuring apparatus 100 according to the present invention.

스케줄러(320)는 인터럽트 핸들러(310)에 의해 인터럽트에 대응한 태스크가 웨이크업되면, CPU가 수행할 태스크들을 스케줄링한다. 즉, 스케줄러(320)는 웨이크업된 태스크, 즉 가장 높은 우선순위를 가진 태스크가 먼저 또는 우선적으로 실행되도록 스케줄링을 수행한다. 그리고 스케줄러(320)는 스케줄링된 대로 태스크들을 수행되도록 유저 모드에서 해당 태스크를 수행하는 어플리케이션에 통지한다. 즉 스케줄러(320)는 해당 태스크를 실행하기 위한 태스크 실행 신호를 발생시키고 상기 어플리케이션에 제공한다.Thescheduler 320 schedules tasks to be performed by the CPU when the task corresponding to the interrupt is woken up by theinterrupt handler 310. That is, thescheduler 320 performs the scheduling so that the wake-up task, that is, the task having the highest priority, is executed first or priority. Thescheduler 320 notifies the application performing the task in the user mode to perform the tasks as scheduled. That is, thescheduler 320 generates a task execution signal for executing the corresponding task and provides it to the application.

본 발명에 따라, RTC(336)는 실시간 성능 측정 장치(100)에 의해 주기적으로 인터럽트를 발생하도록 구성된다. RTC(336)은 일반적인 임베디드 시스템에 대부분 구비되어 있다.In accordance with the present invention, theRTC 336 is configured to generate an interrupt periodically by the real-timeperformance measurement device 100. The RTC 336 is mostly provided in a general embedded system.

본 발명에 따라, 실시간 성능 측정 장치(100)는 인터럽트 핸들러(310)가 호출되는 시점부터 스케줄러(320)가 인터럽트에 따른 태스크를 수행하도록 해당 어플리케이션에 통지하는 시점 사이의 구간을 성능 측정 구간으로 규정한다. 본 발명에 따른 성능 측정 구간을 도 2를 참조하여 상세히 설명한다.
According to the present invention, theapparatus 100 for real-time performance measurement defines a section between a time point at which theinterrupt handler 310 is called and a time point at which thescheduler 320 notifies a corresponding application to perform a task according to an interrupt as a performance measurement section. do. The performance measurement interval according to the present invention will be described in detail with reference to FIG.

도 2는 본 발명에 따른 실시간 성능 측정 구간을 나타낸 도면이다.2 is a diagram showing a real-time performance measurement interval according to the present invention.

도 2를 참조하면, 선점 지연시간(Preemption Latency)은 하드웨어 인터럽트 지연시간(Hardware Interrupt Latency)(415), 인터럽트 핸들러 구간(Interrupt Handler Duration)(425), 스케줄러 지연시간(Scheduler Latency)(435) 및 스케줄링 지연시간(Scheduling Latency)(445) 및 모드 스위치 지연시간(Mode Switch Latency)(455)을 포함한다.Referring to FIG. 2, the preemption delay time includes a hardware interruptdelay time 415, an interrupthandler duration 425, ascheduler delay time 435, and the like. Scheduling Latency 445 andMode Switch Latency 455.

하드웨어 인터럽트 지연시간(415)는 실제 내/외부 특정 인터럽트가 발생한 시점(410)으로부터 발생된 인터럽트를 위한 인터럽트 핸들러(320)가 호출되는 시점(420)까지의 구간에 대응한다. 인터럽트 핸들러 구간(425)은 발생된 인터럽트를 소프트웨어적으로 처리하는 구간에 대응한다. 다시 말해, 인터럽트 핸들러 구간(425)은 발생된 인터럽트를 위한 서비스 루틴을 수행하는데 소요되는 시간에 대응한다. 즉, 인터럽트 핸들러 구간(425)은 인터럽트 핸들러(420)가 시작하는 시점(420)에서부터 인터럽트 핸들러(430)가 종료하는 시점(430)까지의 시간에 해당한다. 스케줄러 지연시간(435)은 인터럽트 핸들러(310)가 종료된 시점(430)부터 스케줄러(320)가 실행되는 시점(440)까지의 지연시간에 해당한다. 스케줄링 지연시간(445)는 스케줄러(320)에서 실제 스케줄링에 소요되는 시간에 해당한다. 모드 스위치 지연시간(455)은 스케줄링이 완료된 시점(450)에서부터 가장 우선순위가 높은 태스크를 수행시키기 위해 유저 모드 상의 관련 어플리케이션을 호출하는 시점(460)까지의 시간에 해당한다.The hardware interruptdelay time 415 corresponds to the interval from the time point 410 at which the actual internal / external specific interrupt occurs to thetime point 420 at which the interrupthandler 320 for the generated interrupt is called. The interrupthandler section 425 corresponds to a section for processing the generated interrupt in software. In other words, the interrupthandler section 425 corresponds to the time taken to perform a service routine for the generated interrupt. That is, the interrupthandler section 425 corresponds to the time from thetime point 420 at which the interrupthandler 420 starts to thetime point 430 at which the interrupthandler 430 ends. Thescheduler delay time 435 corresponds to a delay time from thetime point 430 when the interrupthandler 310 ends to thetime point 440 when thescheduler 320 is executed. The scheduling delay time 445 corresponds to the time required for the actual scheduling in thescheduler 320. The modeswitch delay time 455 corresponds to a time from atime point 450 when scheduling is completed to a time point 460 when a related application on the user mode is called to perform the highest priority task.

원래는 선점 지연시간은 시점 410에서 시점 460까지의 시간에 대응한다. 즉, 실제로 시간 측정이 되어야 하는 부분은 지점 410에서부터 지점 460까지의 구간이다. 그러나, 현실적으로 또는 기술적으로 별도의 장비를 추가로 구비하지 않으면 하드웨어 인터럽트 지연시간(415)는 측정되기 어렵다.Originally, the preemption delay time corresponds to the time from the time point 410 to the time point 460. In other words, the part to be measured in time is the section from point 410 to point 460. However, the hardware interruptlatency 415 is difficult to measure unless additional equipment is provided, either realistically or technically.

그런데, 이 하드웨어 인터럽트 지연시간(415)는 실제로 하드웨어적으로 소요되는 시간이며 전체 선점 지연시간에서 매우 적게 차지한다. 또한, 하드웨어 인터럽트 지연시간(415)의 구간은 매우 짧아서 그 값을 무시할 수 있다. 따라서, 본 발명에서는 지점 420에서부터 지점 460까지의 걸리는 시간을 측정하고 결과적인 측정값을 선점 지연시간으로 사용한다.However, this hardware interruptdelay time 415 is actually hardware time and takes up very little of the total preemption delay time. In addition, the interval of the hardware interruptdelay time 415 is very short so that the value can be ignored. Therefore, the present invention measures the time taken frompoint 420 to point 460 and uses the resulting measured value as the preemption delay time.

이와 같이, 실시간 성능 측정 장치(100)는 본 발명에 따라 실시간 성능을 측정하기 위해 태스크를 위한 인터럽트가 발생하면, 발생된 인터럽트에 대한 인터럽트 핸들러(310)이 실행하는(run) 시점부터 유저 모드에서 태스크가 실행 시작하는 시점까지의 시간을 측정한다.As described above, when the interrupt for the task is generated to measure the real-time performance according to the present invention, theapparatus 100 for measuring the real-time performance in the user mode starts from the time when the interrupthandler 310 for the generated interrupt is executed. Measure the time until the task starts executing.

이를 위해 실시간 성능 측정 장치(100)는 상기 인터럽트 핸들러(310)로부터 이 인터럽트 발생 시점값을 수신한다. 그리고 실시간 성능 측정 장치(100)는 상기 스케줄러(320)로부터 태스크 실행 신호를 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값로서 기록한다. 이어서, 실시간 성능 측정 장치(100)는 태스크 시작 시점값으로부터 인터럽트 발생 시점값 A를 감산함으로써 선점 지연시간을 계산한다. 이하, 실시간 성능 측정 장치(100)가 선점 지연시간을 측정하는 프로세스를 도 3을 참조하여 설명한다.
To this end, the real-timeperformance measuring apparatus 100 receives the interrupt generation time point value from the interrupthandler 310. Theapparatus 100 for real-time performance measurement records the system counter value at the time when the task execution signal is received from thescheduler 320 as the task start time value. Subsequently, the real-timeperformance measuring apparatus 100 calculates the preemption delay time by subtracting the interrupt occurrence time value A from the task start time value. Hereinafter, a process in which the real-timeperformance measuring apparatus 100 measures the preemption delay time will be described with reference to FIG. 3.

도 3은 본 발명의 일 실시예에 따른 선점 지연시간을 측정하는 프로세스를 나타낸 도면이다.3 is a diagram illustrating a process of measuring a preemption delay time according to an embodiment of the present invention.

도 1 및 도 3을 참조하면, 실시간 성능 측정 장치(100)는 단계 502에서 RTC(336)가 주기적으로 인터럽트를 발생시키도록 설정하고 RTC(336)를 구동한다. 그에 따라 RTC(336)는 단계 504에서 주기적 인터럽트를 발생한다. RTC(336)는 실시간 성능 측정 장치(100)에 의해 한번 설정되면 주기적으로 인터럽트를 발생시킬 수 있다. 여기에서 인터럽트는 반드시 주기적으로 발생될 필요는 없지만, 측정의 편리성을 위해 주기적으로 발생되는 것이 바람직하다. 이렇게 함으로써 미리 설정해둔 값에 따라 즉, 기설정된 주기에 따라 인터럽트 또는 이벤트가 발생될 수 있다. 이 인터럽트 발생 주기는 용이하게 조절될 수 있다. RTC 드라이버(336)은 단계 506에서 인터럽트 핸들러(301)로 발생된 인터럽트를 제공한다.1 and 3, theapparatus 100 for real-time performance measurement sets theRTC 336 to periodically generate an interrupt in step 502 and drives theRTC 336. Accordingly, theRTC 336 generates a periodic interrupt at step 504. TheRTC 336 may periodically generate an interrupt once set by the real-timeperformance measuring apparatus 100. The interrupts do not necessarily need to be generated periodically, but are preferably generated periodically for convenience of measurement. In this way, an interrupt or an event may be generated according to a preset value, that is, according to a predetermined period. This interrupt generation period can be easily adjusted.RTC driver 336 provides the interrupt generated to interrupt handler 301 instep 506.

인터럽트 핸들러(310)는 인터럽트를 수신하면 단계 508에서 인터럽트 발생 시점 A을 기록한다. 구체적으로 인터럽트 핸들러(310)는 인터럽트를 수신한 시점에서의 카운터값을 인터럽트 발생 시점값 A로 기록한다.The interrupthandler 310 records the interrupt occurrence time A instep 508 when receiving the interrupt. In detail, the interrupthandler 310 records the counter value at the time of receiving the interrupt as the interrupt generation time value A.

이 경우, 커널 모드와 유저 모드 양쪽에서 사용가능한 고정밀 시스템 카운터가 사용된다. 당업계에 공지된 바와 같이, 임베디드 시스템은 시스템 클럭을 포함한다. 시스템 클록은 프로세서 내에 존재하며 컴퓨터 시스템 내에서 동작하는 모든 회로와 장치들의 같은 시각에 일을 할 수 있도록. 동기화 하기 위하여 일정한 간격으로 펄스를 발생시키는 장치이다. 시스템 카운터는 이러한 클록 펄스를 카운트함으로써 시스템에 정확한 시간을 제공할 수 있다.In this case, the high precision system counters available in both kernel mode and user mode are used. As is known in the art, embedded systems include a system clock. The system clock resides in the processor so that all the circuits and devices that operate within the computer system can work at the same time. It is a device that generates pulses at regular intervals to synchronize. The system counter can provide accurate time to the system by counting these clock pulses.

따라서, 인터럽트 핸들러(310)는 인터럽트를 수신한 시점에서의 카운터값을 읽어와 인터럽트 발생 시점값 A로 기록한다. 그런 다음, 인터럽트 핸들러(310)는 단계 510에서 스케줄러(320)에서 태스크들 중에 상기 인터럽트에 대응하는 태스크를 웨이크업(wake-up)한다. 이와 동시에, 또는 거의 동시에, 인터럽트 핸들러(310)는 단계 512에서 유저 모드 상의 실시간 성능 측정 장치(100)로 인터럽트 발생 시점값 A를 제공한다. 도 3에서는 인터럽트 핸들러(310)가 인터럽트 발생 시점값 A를 제공하는 것으로 도시되어 있지만, 실제적으로는 실시간 성능 측정 장치(100)가 인터럽트 핸들러(310)에 기록된 인터럽트 발생 시점값 A를 판독한다. 그에 따라 실시간 성능 측정 장치(100)는 인터럽트 발생 시점값 A를 획득할 수 있다.Therefore, the interrupthandler 310 reads the counter value at the time of receiving the interrupt and records it as the interrupt generation time value A. The interrupthandler 310 then wakes up a task corresponding to the interrupt among the tasks at thescheduler 320 at step 510. At the same time, or almost simultaneously, the interrupthandler 310 provides the interrupt occurrence time value A to the real-timeperformance measurement apparatus 100 in the user mode in step 512. In FIG. 3, the interrupthandler 310 is provided to provide an interrupt generation time point A, but in practice, the real-timeperformance measuring apparatus 100 reads the interrupt generation time value A recorded in the interrupthandler 310. Accordingly, the real-timeperformance measuring apparatus 100 may obtain the interrupt generation time point A.

다음으로, 스케줄러(320)는 인터럽트 핸들러(310)에 의해 인터럽트에 대응한 태스크가 웨이크업되면, 단계 514에서 CPU가 수행할 태스크들을 스케줄링한다. 즉, 스케줄러(320)는 웨이크업된 태스크, 즉 가장 높은 우선순위를 가진 태스크들이 먼저 실행되도록 스케줄링을 수행한다. 이어서, 스케줄러(320)는 단계 516에서 태스크 실행 신호를 실시간 성능 측정 장치(100)에 제공한다. 구체적으로, 스케줄러(320)는 스케줄링된 대로 태스크들을 수행되도록 유저 모드에서 해당 태스크를 수행하는 어플리케이션에 대응하는 실시간 성능 측정 장치(100)에 통지한다. 다시 말해 스케줄러(320)는 상기 태스크를 실행하기 위한 태스크 실행 신호를 발생시킨다.Next, when the task corresponding to the interrupt wakes up by the interrupthandler 310, thescheduler 320 schedules tasks to be performed by the CPU in step 514. That is, thescheduler 320 performs the scheduling so that the wake-up task, that is, the task having the highest priority, is executed first. Next, thescheduler 320 provides the task execution signal to the real-timeperformance measurement apparatus 100 in step 516. In detail, thescheduler 320 notifies the real-timeperformance measurement apparatus 100 corresponding to the application performing the task in the user mode to perform the tasks as scheduled. In other words, thescheduler 320 generates a task execution signal for executing the task.

실시간 성능 측정 장치(100)는 스케줄러(320)에 의해 태스크 실행 신호를 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값 B로서 기록한다. 이어서, 실시간 성능 측정 장치(100)는 단계 520에서 태스크 시작 시점값 B로부터 인터럽트 발생 시점값 A를 감산함으로써 선점 지연시간을 계산한다.
Theapparatus 100 for real-time performance measurement records the system counter value at the time when the task execution signal is received by thescheduler 320 as the task start time value B. FIG. Subsequently, the real-timeperformance measuring apparatus 100 calculates the preemption delay time by subtracting the interrupt occurrence time value A from the task start time value B instep 520.

도 3의 프로세스는 한번의 선점 지연시간을 측정하기 위한 것으로서, 본 발명의 일 실시예에 따르면 복수번 선점 지연시간을 측정한 후 그 평균을 구하며, 이에 따라 선점 지연시간의 평균이 실시간 성능 측정값으로 사용된다. 전술한 바와 같이 동작하는 실시간 성능 측정 장치의 구성을 도 4를 참조하여 설명한다.
The process of Figure 3 is to measure one preemption delay time, according to an embodiment of the present invention to measure the average of a plurality of preemption delay time, and accordingly, the average of the preemption delay time is a real-time performance measurement value Used as The configuration of a real-time performance measuring apparatus operating as described above will be described with reference to FIG. 4.

도 4는 본 발명의 일 실시예에 따른 실시간 성능 측정 장치의 블록 구성도를 나타낸 도면이다. 실시간 성능 측정 장치는 하드웨어로 또는 소프트웨어로 구현될 수 있다.4 is a block diagram of a real-time performance measurement apparatus according to an embodiment of the present invention. The real-time performance measuring device may be implemented in hardware or in software.

실시간 성능 측정 장치(100)는 입출력부(110), 전처리부(120), 카운터 판독부(130), 지연시간 계산부(140) 및 통계 처리부(150)를 포함한다.The real-timeperformance measuring apparatus 100 includes an input /output unit 110, a preprocessor 120, acounter reader 130, adelay time calculator 140, and astatistics processor 150.

입출력부(110)는 실시간 성능 측정 장치(100)가 커널 모드 구성요소들에 대해 신호 또는 데이터를 입력 또는 출력하기 위한 것이다.The input /output unit 110 is for the real-timeperformance measuring apparatus 100 to input or output signals or data for kernel mode components.

전처리부(120)는 메모리 잠금(memory lock)을 수행한다. 메모리 잠금(memory lock)은 태스크들이 메모리로부터 하드디스크로 내보내졌다가 다시 가져오지 못하도록 메모리에 대해 태스크를 꺼내거나 가져오는 것을 방지한다. 구체적으로 설명하면, 시스템 내의 메모리의 용량은 무한정이지 않기 때문에 태스크들은 메모리에 있다가 오퍼레이팅 시스템(50)이 판단하기에 내보내야 할 필요성이 있다면 자동적으로 하드디스크로 내보냈다가 필요한 경우에 다시 메모리에 가져와서 실행하게 된다. 계속 메모리에 머무르며 실행하는 태스크와 디스크를 오가며 실행되는 태스크의 성능은 엄청난 성능 차이를 나타낸다. 따라서, 전처리부(120)는 메모리 잠금 기능을 수행하여 동일한 조건으로 실시간 성능을 가장 잘 측정할 수 있도록 한다.The preprocessor 120 performs a memory lock. A memory lock prevents the task from being ejected or imported to memory so that tasks cannot be exported from memory and then fetched back to the hard disk. Specifically, since the amount of memory in the system is not infinite, the tasks are in memory and automatically exported to the hard disk if needed by theoperating system 50, and then back to the memory if necessary. Get it and run it. The performance difference between a task that stays in memory and executes on and off the disk represents a huge performance difference. Thus, the preprocessor 120 performs the memory lock function to best measure real-time performance under the same conditions.

전처리부(120)는 또한, 성능 측정을 위한 태스크에 가장 높은 우선순위를 부여한다. 구체적으로, 실시간 성능 측정을 위한 태스크를 가장 높은 우선순위를 갖도록 하는 것은 실시간 성능 측정을 위한 태스크가 다른 태스크보다 먼저 수행되도록 하기 위함이다. 이는 시스템 내에서 실시간 성능 측정을 위한 태스크보다 더 우선순위가 높은 태스크가 있다면 시스템내의 스케줄러가 실시간 성능 측정을 위한 태스크가 나중에 실행되도록 스케줄링을 하므로 더 낮은 성능을 나타낼 수 있기 때문이다.The preprocessor 120 also gives the highest priority to the task for performance measurement. Specifically, the task for real-time performance measurement has the highest priority so that the task for real-time performance measurement is performed before other tasks. This is because if there is a higher priority task in the system than the task for real-time performance measurement, the scheduler in the system may show lower performance since the task for real-time performance measurement is scheduled for later execution.

또한, 전처리부(120)는 측정 시간 교정(Measurement Time Calibration)을 수행한다. 전술한 바와 같이, 인터럽트 발생 시점값 및 태스크 시작 시점값은 시스템 카운터에 의해 제공되는 카운터값들로부터 획득된다. 따라서, 전처리부(120)는 예컨대, 사용자가 측정 결과를 직관적으로 알아보기 쉽도록 측정 단위를 사용자에 의해 판독 가능한 단위, 예컨대, μsec 단위로 변환한다.In addition, the preprocessor 120 performs a measurement time calibration. As described above, the interrupt occurrence time point value and the task start time point value are obtained from counter values provided by the system counter. Accordingly, the preprocessor 120 converts the measurement unit into a unit readable by the user, for example, μsec, so that the user can intuitively recognize the measurement result.

또한, 전처리부(120)는 주기적 RTC를 시작(open)하고 설정(set)하고 실행(run)한다. 전술한 바와 같이, RTC(336)는 일반적인 임베디드 시스템에 대부분 내장되어 있다. 전처리부(120)는 RTC(336)가 주기적으로, 즉 기설정된 시간 간격으로 인터럽트를 발생시키도록 설정하고, RTC(336)를 실행한다. 이 때, 인터럽트는 반드시 주기적으로 발생될 필요는 없지만 측정의 편리성을 위해 주기적인 RTC이 바람직하다.In addition, the preprocessor 120 opens, sets and runs the periodic RTC. As mentioned above, theRTC 336 is mostly embedded in a typical embedded system. The preprocessor 120 sets theRTC 336 to generate an interrupt periodically, that is, at predetermined time intervals, and executes theRTC 336. At this time, the interrupt does not necessarily need to be generated periodically, but periodic RTC is preferable for convenience of measurement.

카운터 판독부(130)는 태스크 시작 시점이 결정되면 시스템 카운터로부터 카운터값을 판독한다. 구체적으로 카운터 판독부(130)는 스케줄러(320)으로부터 태스크 실행 신호를 수신한 시점에서 시스템 카운터의 카운터값을 판독하여 태스크 시작 시점값 B로서 지연시간 계산부(140)에 출력한다.Thecounter reading unit 130 reads the counter value from the system counter when the task start time is determined. In detail, thecounter reading unit 130 reads the counter value of the system counter at the time when the task execution signal is received from thescheduler 320 and outputs the counter value to the delaytime calculating unit 140 as the task start time value B. FIG.

지연시간 계산부(140)는 인터럽트 핸들러(310)로부터 인터럽트 발생 시점값 A를 수신하고, 카운터 판독부(130)로부터 태스크 시작 시점값 B를 제공받으면 선점 지연시간을 계산한다. 즉, 지연시간 계산부(140)는 태스크 시작 시점값 B로부터 인터럽트 발생 시점값 A를 감산하고 그 결과를 선점 지연시간으로 출력한다.Thedelay time calculator 140 receives the interrupt occurrence time point A from the interrupthandler 310, and calculates the preemption delay time when the task start time point B is provided from thecounter reader 130. In other words, thedelay time calculator 140 subtracts the interrupt occurrence time point A from the task start time point B and outputs the result as a preemption delay time.

통계 처리부(150)는 지연시간 계산부(140)로부터 선점 지연시간들을 제공받아 통계 처리를 수행한다. 통계 처리부(150)는 복수개의 지연시간들을 평균하고 그 평균값을 실시간 성능 측정값으로 출력할 수 있다. 통계 처리부(150)는 상기 선점 지연시간을 계산한 후 이전에 계산된 적어도 하나의 선점 지연시간들과 합산하고 그 평균값을 구하며, 상기 평균값을 실시간 성능 측정값으로 출력한다.
Thestatistical processor 150 receives the preemption delay times from thedelay time calculator 140 and performs statistical processing. Thestatistical processor 150 may average the plurality of delay times and output the average value as a real-time performance measurement value. Thestatistical processing unit 150 calculates the preemption delay time, sums up the at least one preemption delay time previously calculated, calculates an average value thereof, and outputs the average value as a real-time performance measurement value.

도 5는 본 발명의 일 실시예에 따른 실시간 성능 측정 방법을 나타낸 플로우차트이다.5 is a flowchart illustrating a real-time performance measurement method according to an embodiment of the present invention.

도 5를 참조하면, 실시간 성능 측정 장치는 단계 602에서 메모리 잠금을 실행한다. 전술한 바와 같이, 메모리 잠금(memory lock)은 태스크들이 메모리로부터 하드디스크로 내보내졌다가 다시 가져오지 못하도록 메모리에 대해 태스크를 꺼내거나 가져오는 것을 방지한다.Referring to FIG. 5, the real-time performance measuring device performs a memory lock instep 602. As mentioned above, a memory lock prevents the task from being pulled out or pulled against the memory to prevent tasks from being exported from the memory and back to the hard disk.

이어서, 실시간 성능 측정 장치는 단계 604에서 성능 측정을 위한 태스크에 가장 높은 우선순위를 부여하고, 단계 606에서 측정 시간 교정(Measurement Time Calibration)을 수행하는데, 이에 대해서는 전술한 설명을 참조한다.Next, the apparatus for real-time performance measurement gives the highest priority to the task for performance measurement instep 604, and performs measurement time calibration instep 606, which is described above.

이어서, 실시간 성능 측정 장치는 단계 608에서 주기적 RTC를 설정하고 실행한다. 구체적으로 실시간 성능 측정 장치는 RTC가 예컨대, 즉 기설정된 시간 간격으로 인터럽트를 발생되도록 설정하고, RTC를 실행한다.The real-time performance measuring device then sets up and executes the periodic RTC instep 608. Specifically, the real-time performance measuring apparatus sets the RTC to generate an interrupt, for example, at predetermined time intervals, and executes the RTC.

RTC를 실행한 후 실시간 성능 측정 장치는 단계 610에서 인터럽트 핸들러로부터 인터럽트 발생 시점값 A를 수신하는 지를 판단한다. 인터럽트 발생 시점값 A은 시스템 카운터로부터 카운터값이다.After executing the RTC, the real-time performance measuring apparatus determines whether an interrupt generation time point A is received from the interrupt handler instep 610. The interrupt occurrence time value A is a counter value from the system counter.

이어서, 실시간 성능 측정 장치는 단계 612에서 스케줄러로부터 태스크 실행 신호를 수신하는 지를 판단한다. 실시간 성능 측정 장치는 태스크 실행 신호를 스케줄러에서 수신하면 단계 614에서 태스크 시작 시점값 B를 기록한다. 이를 위해, 실시간 성능 측정 장치는 태스크 실행 신호를 수신한 시점에서 시스템 카운터의 카운터값을 태스크 시작 시점값 B로서 판독한다.Inoperation 612, the apparatus for real-time performance measurement determines whether a task execution signal is received from the scheduler. The real-time performance measuring apparatus records the task start time point B in step 614 when the task execution signal is received from the scheduler. To this end, the real-time performance measuring apparatus reads the counter value of the system counter as the task start time point B at the time point when the task execution signal is received.

이어서 실시간 성능 측정 장치는 단계 616에서 태스크 시작 시점값 B로부터 인터럽트 발생 시점값 A를 감산함으로써 선점 지연시간으로 계산한다.The real-time performance measuring apparatus then calculates the preemption delay time by subtracting the interrupt occurrence time value A from the task start time value B in step 616.

실시간 성능 측정 장치는 현재 계산된 선점 지연시간과 이전에 계산된 적어도 하나 이상의 선점 지연 시간들에 대해 통계 처리를 수행한다. 예컨대, 실시간 성능 측정 장치는 복수개의 지연시간들을 평균하고 그 평균값을 실시간 성능 측정값으로 출력할 수 있다.The real-time performance measuring device performs statistical processing on the currently calculated preemption delay time and at least one or more preemption delay times previously calculated. For example, the real-time performance measuring apparatus may average the plurality of delay times and output the average value as the real-time performance measurement.

실시간 성능 측정 장치는 단계 620에서 실시간 성능 측정을 종료하기 위한 종료 신호를 수신하는 지를 판단한다. 통상적으로 종료 신호는 응용 프로그램이 종료되면서 발생되거나 사용자가 키보드를 이용해서 보낼 수 있다.Inoperation 620, the real-time performance measuring apparatus determines whether to receive an end signal for terminating the real-time performance measurement. Typically the exit signal is generated when the application terminates or can be sent by the user using the keyboard.

이와 같은 본 발명에 따르면 기존의 리눅스 기반 임베디드 시스템의 실시간 성능 측정보다 명확한 실시간 성능 측정 구간에 해당하는 지연시간을 하드웨어 시스템 카운터를 이용하여 정밀하게 측정할 수 있으며, 기존의 다양한 방법보다 훨씬 사용자 직관적인 선점 지연시간의 결과값을 얻을 수 있는 장점이 있다.According to the present invention, it is possible to precisely measure the delay time corresponding to the clear real-time performance measurement interval using the hardware system counter than the real-time performance measurement of the existing Linux-based embedded system, and is much more user intuitive than the various methods. There is an advantage that the result of preemption delay time can be obtained.

상기에서는 본 발명의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the present invention as defined by the following claims It can be understood that

100: 실시간 성능 측정 장치200: 시스템 인터페이스
310: 인터럽트 핸들러320: 스케줄러
330: 디바이스 드라이버332: 네트워크 드라이버
334: 디스플레이 드라이버336: RTC(Real-Time Clock)
415: 하드웨어 인터럽트 지연시간425: 인터럽트 핸들러 구간
435: 스케줄러 지연시간445: 스케줄링 지연시간
455: 모드 스위치 지연시간
100: real-time performance measurement device 200: system interface
310: interrupt handler 320: scheduler
330: device driver 332: network driver
334: Display driver 336: Real-Time Clock (RTC)
415: hardware interrupt delay time 425: interrupt handler interval
435: Scheduler delay time 445: Scheduling delay time
455: mode switch delay time

Claims (17)

Translated fromKorean
리눅스 기반 임베디드 시스템에 있어서,
커널 모드 상에서 동작하도록 구성되며 주기적인 인터럽트를 발생시키는 RTC(Real Time Clock)와,
커널 모드 상에서 동작하도록 구성되며, 상기 RTC로부터 인터럽트를 수신하고, 상기 인터럽트가 수신된 시점에서의 시스템 카운터값을 인터럽트 발생 시점값으로 기록하고 인터럽트에 대응한 태스크를 웨이크업하는 인터럽트 핸들러와,
커널 모드 상에서 동작하도록 구성되며, 상기 인터럽트에 대응한 태스크가 웨이크업되면, 가장 빠른 우선순위를 가진 태스크가 우선적으로 실행되도록 스케줄링을 수행하고 상기 태스크를 실행하기 위한 태스크 실행 신호를 발생시키는 스케줄러와,
유저 모드 상에서 동작하도록 구성되며, 상기 인터럽트 핸들러로부터 상기 인터럽트 발생 시점값을 수신하며, 상기 스케줄러로부터 상기 태스크 실행 신호를 수신할 때 상기 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값으로서 기록하고 상기 태스크 시작 시점값으로부터 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 실시간 성능 측정 장치를 포함하는 리눅스 기반 임베디드 시스템.
In a Linux-based embedded system,
Real Time Clock (RTC), which is configured to run in kernel mode and generates periodic interrupts,
An interrupt handler configured to operate in a kernel mode, receiving an interrupt from the RTC, recording a system counter value at the point of time at which the interrupt is received as an interrupt occurrence point value, and waking up a task corresponding to the interrupt;
A scheduler configured to operate in kernel mode, when a task corresponding to the interrupt wakes up, schedules the task having the highest priority to be executed first, and generates a task execution signal for executing the task;
Receive the interrupt occurrence time value from the interrupt handler, when receiving the task execution signal from the scheduler, record a system counter value at the received time point as a task start time value, and Linux-based embedded system including a real-time performance measurement device that calculates the preemption delay by subtracting the interrupt occurrence time value from the task start time value.
제1항에 있어서, 상기 실시간 성능 측정 장치는 상기 선점 지연시간을 계산한 후 이전에 계산된 적어도 하나의 선점 지연시간들과 합산하고 그 평균값을 구하며, 상기 평균값을 실시간 성능 측정값으로 출력하는 것을 특징으로 하는 리눅스 기반 임베디드 시스템.The method of claim 1, wherein the real-time performance measuring device calculates the preemption delay time and adds the average of at least one preemption delay time and calculates the average value, and outputs the average value as a real-time performance measurement value. Featured Linux-based embedded system.제1항에 있어서, 상기 실시간 성능 측정 장치는 상기 RTC가 주기적으로 인터럽트를 발생시키도록 설정하는 것을 특징으로 하는 리눅스 기반 임베디드 시스템.The Linux-based embedded system of claim 1, wherein the apparatus for measuring real-time performance sets the RTC to periodically generate an interrupt.제1항에 있어서, 상기 실시간 성능 측정 장치는 성능 측정을 위한 태스크에 가장 빠른 우선순위를 부여하는 것을 특징으로 하는 리눅스 기반 임베디드 시스템.The Linux-based embedded system of claim 1, wherein the real-time performance measuring device gives the highest priority to a task for performance measurement.제1항에 있어서, 상기 실시간 성능 측정 장치는 메모리로부터 태스크를 꺼내거나 메모리로 가져오는 것을 방지하는 메모리 잠금을 실행하는 것을 특징으로 하는 리눅스 기반 임베디드 시스템.The Linux-based embedded system of claim 1, wherein the real-time performance measuring device implements a memory lock that prevents the task from being taken out of the memory or brought into the memory.제1항에 있어서, 상기 실시간 성능 측정 장치는
상기 RTC가 주기적으로 인터럽트를 발생시키도록 설정하는 전처리부와,
상기 스케줄러로부터 상기 태스크 실행 신호를 수신한 시점에서 시스템 카운터의 카운터값을 판독하여 태스크 시작 시점값으로서 출력하는 카운터 판독부와,
상기 인터럽트 핸들러로부터 인터럽트 발생 시점값을 수신하고, 상기 카운터 판독부로부터 태스크 시작 시점값을 제공받으면 상기 태스크 시작 시점값으로부터 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 지연시간 계산부를 포함하는 것을 특징으로 하는 리눅스 기반 임베디드 시스템.
The apparatus of claim 1, wherein the real-time performance measuring device
A preprocessor configured to periodically set the RTC to generate an interrupt;
A counter reading unit for reading a counter value of a system counter and outputting the counter value as a task starting time point at the time when the task execution signal is received from the scheduler;
And a delay time calculating unit configured to receive an interrupt occurrence time point value from the interrupt handler and calculate a preemption delay time by subtracting the interrupt occurrence time point value from the task start time point value when the task start time point value is provided from the counter reading unit. Featured Linux-based embedded system.
제6항에 있어서, 상기 실시간 성능 측정 장치는, 상기 지연시간 계산부로부터 상기 계산된 선점 지연시간을 수신하고, 이전에 계산된 적어도 하나의 선점 지연시간들과 합산하고 그 평균값을 구하며, 상기 평균값을 실시간 성능 측정값으로 출력하는 통계 처리부를 더 포함하는 리눅스 기반 임베디드 시스템.The apparatus of claim 6, wherein the apparatus for measuring real-time performance receives the calculated preemption delay time from the delay time calculation unit, adds the previously calculated at least one preemption delay time, calculates an average thereof, and the average value. Linux-based embedded system further comprises a statistical processing unit for outputting a real-time performance measurement.리눅스 기반 임베디드 시스템에서 실시간 성능을 측정하는 방법에 있어서,
커널 모드 상에서 동작하도록 구성된 RTC(Real Time Clock)에 의해 주기적인 인터럽트를 발생시키는 단계와,
커널 모드 상에서 동작하도록 구성된 인터럽트 핸들러에 의해, 상기 RTC로부터 인터럽트를 수신하고, 상기 인터럽트가 수신된 시점에서의 시스템 카운터값을 인터럽트 발생 시점값으로 기록하는 단계와,
상기 인터럽트 핸들러에 의해 상기 인터럽트에 대응한 태스크를 웨이크업하는 단계와,
커널 모드 상에서 동작하도록 구성된 스케줄러에 의해, 상기 인터럽트에 대응한 태스크가 웨이크업되면, 가장 빠른 우선순위를 가진 태스크가 우선적으로 실행되도록 스케줄링을 수행하는 단계와,
상기 스케줄러에 의해 상기 태스크를 실행하기 위한 태스크 실행 신호를 발생시키는 단계와,
유저 모드 상에서 동작하도록 구성된 실시간 성능 측정 장치에 의해, 상기 인터럽트 핸들러로부터 상기 인터럽트 발생 시점값을 수신하는 단계와,
상기 실시간 성능 측정 장치에 의해 상기 스케줄러로부터 상기 태스크 실행 신호를 수신할 때 상기 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값으로서 기록하는 단계와,
상기 실시간 성능 측정 장치에 의해 상기 태스크 시작 시점값으로부터 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 단계를 포함하는 실시간 성능 측정 방법.
In measuring real-time performance in Linux-based embedded system,
Generating a periodic interrupt by a Real Time Clock (RTC) configured to operate in kernel mode,
Receiving, by an interrupt handler configured to operate in kernel mode, an interrupt from the RTC, recording a system counter value at the time the interrupt was received as an interrupt occurrence time value,
Waking up the task corresponding to the interrupt by the interrupt handler;
Scheduling by the scheduler configured to operate in kernel mode so that when the task corresponding to the interrupt wakes up, the task having the fastest priority is executed first;
Generating a task execution signal for executing the task by the scheduler;
Receiving, by the real time performance measurement apparatus, configured to operate in a user mode, the interrupt occurrence time point value from the interrupt handler;
Recording the system counter value at the received time point as a task start time point value when the task execution signal is received from the scheduler by the real-time performance measuring device;
And calculating a preemption delay time by subtracting an interrupt occurrence time point value from the task start time point value by the real-time performance measurement device.
제8항에 있어서, 상기 실시간 성능 측정 장치에 의해 상기 선점 지연시간을 계산한 후 이전에 계산된 적어도 하나의 선점 지연시간들과 합산하고 그 평균값을 구하는 단계와,
상기 실시간 성능 측정 장치에 의해 상기 평균값을 실시간 성능 측정값으로 출력하는 단계를 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.
The method of claim 8, further comprising: calculating the preemption delay time by the real-time performance measuring device and then adding the calculated preemption delays with at least one preemption delay time and calculating an average thereof;
And outputting the average value as a real-time performance measurement value by the real-time performance measurement device.
제8항에 있어서, 상기 인터럽트 발생 단계 이전에, 상기 실시간 성능 측정 장치에 의해 상기 RTC가 주기적으로 인터럽트를 발생시키도록 설정하는 단계를 더 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.The method of claim 8, further comprising setting the RTC to generate an interrupt periodically by the real-time performance measuring device before the interrupt generating step.제8항에 있어서, 상기 인터럽트 발생 단계 이전에, 상기 실시간 성능 측정 장치에 의해 성능 측정을 위한 태스크에 가장 빠른 우선순위를 부여하는 단계를 더 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.10. The method of claim 8, further comprising, prior to the interrupt generating step, assigning the earliest priority to a task for performance measurement by the real-time performance measurement device.제8항에 있어서, 상기 인터럽트 발생 단계 이전에, 상기 실시간 성능 측정 장치에 의해 성능 측정을 위한 태스크에 가장 빠른 우선순위를 부여하는 단계를 더 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.10. The method of claim 8, further comprising, prior to the interrupt generating step, assigning the earliest priority to a task for performance measurement by the real-time performance measurement device.제8항에 있어서, 상기 인터럽트 발생 단계 이전에, 상기 실시간 성능 측정 장치에 의해 메모리로부터 태스크를 꺼내거나 메모리로 가져오는 것을 방지하는 메모리 잠금을 실행하는 단계를 더 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.10. The method of claim 8, further comprising executing a memory lock prior to the interrupt generation step, the memory lock which prevents the real-time performance measuring device from fetching or bringing a task from the memory into the memory. Way.실시간 성능 측정 장치에서 실시간 성능을 측정하는 방법에 있어서,
상기 실시간 성능 측정 장치에 의해 상기 커널 모드 상에서 동작하도록 구성된 RTC(Real Time Clock)가 주기적으로 인터럽트를 발생시키도록 설정하는 단계와,
커널 모드 상에서 동작하도록 구성된 인터럽트 핸들러로부터 인터럽트 발생 시점값을 수신하는 단계와,
커널 모드 상에서 동작하도록 구성된 스케줄러로부터 상기 인터럽트에 대응한 태스크를 실행하기 위한 태스크 실행 신호를 수신하는 단계와.
상기 스케줄러로부터 상기 태스크 실행 신호를 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값으로서 기록하는 단계와,
상기 태스크 시작 시점값으로부터 상기 인터럽트 발생 시점값을 감산함으로써 선점 지연시간을 계산하는 단계를 포함하는 실시간 성능 측정 방법.
In the method for measuring the real-time performance in a real-time performance measurement device,
Setting a real time clock (RTC) configured to operate in the kernel mode by the real-time performance measuring device to generate an interrupt periodically;
Receiving an interrupt occurrence time value from an interrupt handler configured to operate in kernel mode,
Receiving a task execution signal for executing a task corresponding to the interrupt from a scheduler configured to operate in kernel mode;
Recording a system counter value at the time point of receiving the task execution signal from the scheduler as a task start time point value;
And calculating a preemption delay time by subtracting the interrupt occurrence time value from the task start time value.
제14항에 있어서, 상기 선점 지연시간을 계산한 후 이전에 계산된 적어도 하나의 선점 지연시간들과 합산하고 그 평균값을 구하는 단계와,
상기 평균값을 실시간 성능 측정값으로 출력하는 단계를 포함하는 더 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.
15. The method of claim 14, further comprising: after calculating the preemption delay time, summing up at least one preemption delay time calculated and calculating an average value thereof;
And outputting said average value as a real-time performance measurement.
제14항에 있어서, 상기 설정하는 단계 이전에, 성능 측정을 위한 태스크에 가장 빠른 우선순위를 부여하는 단계를 더 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.15. The method of claim 14, further comprising, prior to the setting step, assigning the earliest priority to the task for performance measurement.제8항에 있어서, 상기 설정하는 단계 이전에, 메모리로부터 태스크를 꺼내거나 메모리로 가져오는 것을 방지하는 메모리 잠금을 실행하는 단계를 더 포함하는 것을 특징으로 하는 실시간 성능 측정 방법.
10. The method of claim 8, further comprising executing a memory lock prior to the setting step to prevent a task from being taken from or brought into the memory.
KR1020100125832A2010-12-092010-12-09Method for measuring real-time performance in linux-based embedded system and the systemWithdrawnKR20120064553A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
KR1020100125832AKR20120064553A (en)2010-12-092010-12-09Method for measuring real-time performance in linux-based embedded system and the system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
KR1020100125832AKR20120064553A (en)2010-12-092010-12-09Method for measuring real-time performance in linux-based embedded system and the system

Publications (1)

Publication NumberPublication Date
KR20120064553Atrue KR20120064553A (en)2012-06-19

Family

ID=46684640

Family Applications (1)

Application NumberTitlePriority DateFiling Date
KR1020100125832AWithdrawnKR20120064553A (en)2010-12-092010-12-09Method for measuring real-time performance in linux-based embedded system and the system

Country Status (1)

CountryLink
KR (1)KR20120064553A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106155865A (en)*2016-08-012016-11-23浪潮(北京)电子信息产业有限公司A kind of CPI acquisition methods, system and process performance judgement system in real time
WO2024158199A1 (en)*2023-01-262024-08-02삼성전자 주식회사Electronic device and method for detecting performance change in electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106155865A (en)*2016-08-012016-11-23浪潮(北京)电子信息产业有限公司A kind of CPI acquisition methods, system and process performance judgement system in real time
WO2024158199A1 (en)*2023-01-262024-08-02삼성전자 주식회사Electronic device and method for detecting performance change in electronic device

Similar Documents

PublicationPublication DateTitle
CN100504808C (en) A method for measuring the CPU usage rate of multitasking operating system tasks
US20080104610A1 (en)Hardware threads processor core utilization
US20150082325A1 (en)Apparatuses and methods for generating and tracing event codes
de Oliveira et al.Operating system noise in the linux kernel
CN100338581C (en)Operating system-independent method and system of determining CPU utilization
US9400734B2 (en)Apparatuses and methods for generating event codes including event source
Neukirchner et al.Monitoring arbitrary activation patterns in real-time systems
CN101689132B (en) Monitoring equipment
JP2010182101A (en)Field control system
US11249512B2 (en)Frequency execution monitoring in a real-time embedded system
CN103164321A (en)Occupancy rate measuring method and device of central processing unit
US20130262911A1 (en)Method and data processing unit for providing a timestamp
KR20120064553A (en)Method for measuring real-time performance in linux-based embedded system and the system
CN114625108A (en)Simulation test method and device
US10819896B1 (en)Computer readable recording medium can perform image sensing system control method and image sensing system
CN117785640A (en)Interrupt delay statistical method for embedded operating system
US8160845B2 (en)Method for emulating operating system jitter
WO2009026361A2 (en)Method, system and apparatus for measuring an idle value of a central processing unit
KR101006122B1 (en) Detection device, program and detection method
US20120188856A1 (en)Electronic apparatus, timepiece device and program
EmdeLong-term monitoring of apparent latency in PREEMPT RT Linux realtime systems
US9182958B2 (en)Software code profiling
JP2715904B2 (en) Computer system performance evaluation device
Lakhani et al.Applying design patterns to improve the reliability of embedded systems through a process of architecture migration
CN112463328A (en)Real-time simulation timing method, system and medium based on multi-core processor platform

Legal Events

DateCodeTitleDescription
PA0109Patent application

Patent event code:PA01091R01D

Comment text:Patent Application

Patent event date:20101209

PG1501Laying open of application
PC1203Withdrawal of no request for examination
WITNApplication deemed withdrawn, e.g. because no request for examination was filed or no examination fee was paid

[8]ページ先頭

©2009-2025 Movatter.jp