




본 발명은 리눅스 기반 임베디드 시스템에서 실시간 성능 측정 방법 및 그 시스템 에 관한 것이다.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)는 인터럽트가 발생한 시점부터 태스크가 수행되는 시점을 명확히 규정함으로써 성능 측정을 용이하게 한다.The
이를 위해, 본 발명에 따른 실시간 성능 측정 장치(100)는 도 1에 도시된 바와 같이, 리눅스 기반 임베디드 시스템에서 유저 모드 상에서 구현된다.To this end, the real-time
실시간 성능 측정 장치(100)는 시스템 인터페이스(200)를 통해 커널 모드의 구성요소들(310-330) 중 일부와 통신한다.The
커널 모드 구성요소들은 인터럽트 핸들러(310), 스케줄러(320), 디바이스 드라이버(330) 등을 포함한다. 디바이스 드라이버(330)는 네트워크 드라이버(332), 디스플레이 드라이버(334), RTC(Real-Time Clock)(336) 등을 포함한다.Kernel mode components include an
인터럽트 핸들러(310)는 어떤 특정 인터럽트가 발생했을 시 실행될 루틴 혹은 함수를 의미한다. 다시 말해, 인터럽트 핸들러(310)는 인터럽트가 발생하면, 스케줄러(320)에게 발생된 인터럽트에 대응한 태스크의 실행을 요청한다. 이를 위해, 인터럽트 핸들러(310)는 인터럽트가 발생하면 발생된 인터럽트에 대응한 태스크를 스케줄러(320)로 통지한다. 구체적으로 인터럽트 핸들러(310)는 인터럽트에 따라 우선순위가 높은 태스크들을 웨이크업(wake-up)한다. 이 경우, 인터럽트 핸들러(310)는 본 발명에 따라 상기 인터럽트가 수신된 시점에서의 시스템 카운터값을 인터럽트 발생 시점값으로 기록하고, 이 인터럽트 발생 시점값을 실시간 성능 측정 장치(100)로 제공한다.The
스케줄러(320)는 인터럽트 핸들러(310)에 의해 인터럽트에 대응한 태스크가 웨이크업되면, CPU가 수행할 태스크들을 스케줄링한다. 즉, 스케줄러(320)는 웨이크업된 태스크, 즉 가장 높은 우선순위를 가진 태스크가 먼저 또는 우선적으로 실행되도록 스케줄링을 수행한다. 그리고 스케줄러(320)는 스케줄링된 대로 태스크들을 수행되도록 유저 모드에서 해당 태스크를 수행하는 어플리케이션에 통지한다. 즉 스케줄러(320)는 해당 태스크를 실행하기 위한 태스크 실행 신호를 발생시키고 상기 어플리케이션에 제공한다.The
본 발명에 따라, RTC(336)는 실시간 성능 측정 장치(100)에 의해 주기적으로 인터럽트를 발생하도록 구성된다. RTC(336)은 일반적인 임베디드 시스템에 대부분 구비되어 있다.In accordance with the present invention, the
본 발명에 따라, 실시간 성능 측정 장치(100)는 인터럽트 핸들러(310)가 호출되는 시점부터 스케줄러(320)가 인터럽트에 따른 태스크를 수행하도록 해당 어플리케이션에 통지하는 시점 사이의 구간을 성능 측정 구간으로 규정한다. 본 발명에 따른 성능 측정 구간을 도 2를 참조하여 상세히 설명한다.
According to the present invention, the
도 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 interrupt
하드웨어 인터럽트 지연시간(415)는 실제 내/외부 특정 인터럽트가 발생한 시점(410)으로부터 발생된 인터럽트를 위한 인터럽트 핸들러(320)가 호출되는 시점(420)까지의 구간에 대응한다. 인터럽트 핸들러 구간(425)은 발생된 인터럽트를 소프트웨어적으로 처리하는 구간에 대응한다. 다시 말해, 인터럽트 핸들러 구간(425)은 발생된 인터럽트를 위한 서비스 루틴을 수행하는데 소요되는 시간에 대응한다. 즉, 인터럽트 핸들러 구간(425)은 인터럽트 핸들러(420)가 시작하는 시점(420)에서부터 인터럽트 핸들러(430)가 종료하는 시점(430)까지의 시간에 해당한다. 스케줄러 지연시간(435)은 인터럽트 핸들러(310)가 종료된 시점(430)부터 스케줄러(320)가 실행되는 시점(440)까지의 지연시간에 해당한다. 스케줄링 지연시간(445)는 스케줄러(320)에서 실제 스케줄링에 소요되는 시간에 해당한다. 모드 스위치 지연시간(455)은 스케줄링이 완료된 시점(450)에서부터 가장 우선순위가 높은 태스크를 수행시키기 위해 유저 모드 상의 관련 어플리케이션을 호출하는 시점(460)까지의 시간에 해당한다.The hardware interrupt
원래는 선점 지연시간은 시점 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 interrupt
그런데, 이 하드웨어 인터럽트 지연시간(415)는 실제로 하드웨어적으로 소요되는 시간이며 전체 선점 지연시간에서 매우 적게 차지한다. 또한, 하드웨어 인터럽트 지연시간(415)의 구간은 매우 짧아서 그 값을 무시할 수 있다. 따라서, 본 발명에서는 지점 420에서부터 지점 460까지의 걸리는 시간을 측정하고 결과적인 측정값을 선점 지연시간으로 사용한다.However, this hardware interrupt
이와 같이, 실시간 성능 측정 장치(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, the
이를 위해 실시간 성능 측정 장치(100)는 상기 인터럽트 핸들러(310)로부터 이 인터럽트 발생 시점값을 수신한다. 그리고 실시간 성능 측정 장치(100)는 상기 스케줄러(320)로부터 태스크 실행 신호를 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값로서 기록한다. 이어서, 실시간 성능 측정 장치(100)는 태스크 시작 시점값으로부터 인터럽트 발생 시점값 A를 감산함으로써 선점 지연시간을 계산한다. 이하, 실시간 성능 측정 장치(100)가 선점 지연시간을 측정하는 프로세스를 도 3을 참조하여 설명한다.
To this end, the real-time
도 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, the
인터럽트 핸들러(310)는 인터럽트를 수신하면 단계 508에서 인터럽트 발생 시점 A을 기록한다. 구체적으로 인터럽트 핸들러(310)는 인터럽트를 수신한 시점에서의 카운터값을 인터럽트 발생 시점값 A로 기록한다.The interrupt
이 경우, 커널 모드와 유저 모드 양쪽에서 사용가능한 고정밀 시스템 카운터가 사용된다. 당업계에 공지된 바와 같이, 임베디드 시스템은 시스템 클럭을 포함한다. 시스템 클록은 프로세서 내에 존재하며 컴퓨터 시스템 내에서 동작하는 모든 회로와 장치들의 같은 시각에 일을 할 수 있도록. 동기화 하기 위하여 일정한 간격으로 펄스를 발생시키는 장치이다. 시스템 카운터는 이러한 클록 펄스를 카운트함으로써 시스템에 정확한 시간을 제공할 수 있다.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 interrupt
다음으로, 스케줄러(320)는 인터럽트 핸들러(310)에 의해 인터럽트에 대응한 태스크가 웨이크업되면, 단계 514에서 CPU가 수행할 태스크들을 스케줄링한다. 즉, 스케줄러(320)는 웨이크업된 태스크, 즉 가장 높은 우선순위를 가진 태스크들이 먼저 실행되도록 스케줄링을 수행한다. 이어서, 스케줄러(320)는 단계 516에서 태스크 실행 신호를 실시간 성능 측정 장치(100)에 제공한다. 구체적으로, 스케줄러(320)는 스케줄링된 대로 태스크들을 수행되도록 유저 모드에서 해당 태스크를 수행하는 어플리케이션에 대응하는 실시간 성능 측정 장치(100)에 통지한다. 다시 말해 스케줄러(320)는 상기 태스크를 실행하기 위한 태스크 실행 신호를 발생시킨다.Next, when the task corresponding to the interrupt wakes up by the interrupt
실시간 성능 측정 장치(100)는 스케줄러(320)에 의해 태스크 실행 신호를 수신한 시점에서의 시스템 카운터값을 태스크 시작 시점값 B로서 기록한다. 이어서, 실시간 성능 측정 장치(100)는 단계 520에서 태스크 시작 시점값 B로부터 인터럽트 발생 시점값 A를 감산함으로써 선점 지연시간을 계산한다.
The
도 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-time
입출력부(110)는 실시간 성능 측정 장치(100)가 커널 모드 구성요소들에 대해 신호 또는 데이터를 입력 또는 출력하기 위한 것이다.The input /
전처리부(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 the
전처리부(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, the
카운터 판독부(130)는 태스크 시작 시점이 결정되면 시스템 카운터로부터 카운터값을 판독한다. 구체적으로 카운터 판독부(130)는 스케줄러(320)으로부터 태스크 실행 신호를 수신한 시점에서 시스템 카운터의 카운터값을 판독하여 태스크 시작 시점값 B로서 지연시간 계산부(140)에 출력한다.The
지연시간 계산부(140)는 인터럽트 핸들러(310)로부터 인터럽트 발생 시점값 A를 수신하고, 카운터 판독부(130)로부터 태스크 시작 시점값 B를 제공받으면 선점 지연시간을 계산한다. 즉, 지연시간 계산부(140)는 태스크 시작 시점값 B로부터 인터럽트 발생 시점값 A를 감산하고 그 결과를 선점 지연시간으로 출력한다.The
통계 처리부(150)는 지연시간 계산부(140)로부터 선점 지연시간들을 제공받아 통계 처리를 수행한다. 통계 처리부(150)는 복수개의 지연시간들을 평균하고 그 평균값을 실시간 성능 측정값으로 출력할 수 있다. 통계 처리부(150)는 상기 선점 지연시간을 계산한 후 이전에 계산된 적어도 하나의 선점 지연시간들과 합산하고 그 평균값을 구하며, 상기 평균값을 실시간 성능 측정값으로 출력한다.
The
도 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 in
이어서, 실시간 성능 측정 장치는 단계 604에서 성능 측정을 위한 태스크에 가장 높은 우선순위를 부여하고, 단계 606에서 측정 시간 교정(Measurement Time Calibration)을 수행하는데, 이에 대해서는 전술한 설명을 참조한다.Next, the apparatus for real-time performance measurement gives the highest priority to the task for performance measurement in
이어서, 실시간 성능 측정 장치는 단계 608에서 주기적 RTC를 설정하고 실행한다. 구체적으로 실시간 성능 측정 장치는 RTC가 예컨대, 즉 기설정된 시간 간격으로 인터럽트를 발생되도록 설정하고, RTC를 실행한다.The real-time performance measuring device then sets up and executes the periodic RTC in
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 in
이어서, 실시간 성능 측정 장치는 단계 612에서 스케줄러로부터 태스크 실행 신호를 수신하는 지를 판단한다. 실시간 성능 측정 장치는 태스크 실행 신호를 스케줄러에서 수신하면 단계 614에서 태스크 시작 시점값 B를 기록한다. 이를 위해, 실시간 성능 측정 장치는 태스크 실행 신호를 수신한 시점에서 시스템 카운터의 카운터값을 태스크 시작 시점값 B로서 판독한다.In
이어서 실시간 성능 측정 장치는 단계 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에서 실시간 성능 측정을 종료하기 위한 종료 신호를 수신하는 지를 판단한다. 통상적으로 종료 신호는 응용 프로그램이 종료되면서 발생되거나 사용자가 키보드를 이용해서 보낼 수 있다.In
이와 같은 본 발명에 따르면 기존의 리눅스 기반 임베디드 시스템의 실시간 성능 측정보다 명확한 실시간 성능 측정 구간에 해당하는 지연시간을 하드웨어 시스템 카운터를 이용하여 정밀하게 측정할 수 있으며, 기존의 다양한 방법보다 훨씬 사용자 직관적인 선점 지연시간의 결과값을 얻을 수 있는 장점이 있다.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
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020100125832AKR20120064553A (en) | 2010-12-09 | 2010-12-09 | Method for measuring real-time performance in linux-based embedded system and the system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1020100125832AKR20120064553A (en) | 2010-12-09 | 2010-12-09 | Method for measuring real-time performance in linux-based embedded system and the system |
| Publication Number | Publication Date |
|---|---|
| KR20120064553Atrue KR20120064553A (en) | 2012-06-19 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| KR1020100125832AWithdrawnKR20120064553A (en) | 2010-12-09 | 2010-12-09 | Method for measuring real-time performance in linux-based embedded system and the system |
| Country | Link |
|---|---|
| KR (1) | KR20120064553A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106155865A (en)* | 2016-08-01 | 2016-11-23 | 浪潮(北京)电子信息产业有限公司 | A kind of CPI acquisition methods, system and process performance judgement system in real time |
| WO2024158199A1 (en)* | 2023-01-26 | 2024-08-02 | 삼성전자 주식회사 | Electronic device and method for detecting performance change in electronic device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106155865A (en)* | 2016-08-01 | 2016-11-23 | 浪潮(北京)电子信息产业有限公司 | A kind of CPI acquisition methods, system and process performance judgement system in real time |
| WO2024158199A1 (en)* | 2023-01-26 | 2024-08-02 | 삼성전자 주식회사 | Electronic device and method for detecting performance change in electronic device |
| Publication | Publication Date | Title |
|---|---|---|
| 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 | |
| Emde | Long-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 |
| Date | Code | Title | Description |
|---|---|---|---|
| PA0109 | Patent application | Patent event code:PA01091R01D Comment text:Patent Application Patent event date:20101209 | |
| PG1501 | Laying open of application | ||
| PC1203 | Withdrawal of no request for examination | ||
| WITN | Application deemed withdrawn, e.g. because no request for examination was filed or no examination fee was paid |