KR20080054592A - Log storing method for embedded system by using fixed memory area - Google Patents

Log storing method for embedded system by using fixed memory area Download PDF

Info

Publication number
KR20080054592A
KR20080054592A KR1020060127025A KR20060127025A KR20080054592A KR 20080054592 A KR20080054592 A KR 20080054592A KR 1020060127025 A KR1020060127025 A KR 1020060127025A KR 20060127025 A KR20060127025 A KR 20060127025A KR 20080054592 A KR20080054592 A KR 20080054592A
Authority
KR
South Korea
Prior art keywords
log
area
storing
output
kernel
Prior art date
Application number
KR1020060127025A
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 엘지노텔 주식회사 filed Critical 엘지노텔 주식회사
Priority to KR1020060127025A priority Critical patent/KR20080054592A/en
Publication of KR20080054592A publication Critical patent/KR20080054592A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A method for storing a log with a fixed memory area in an embedded system is provided to reduce burden of a developer and prevent mistake omitting the log by leaving the log with a simple output function without making a device driver developer consider or use the log separately, and leave the log even if the system is failed by fatal device error by recording the log in real-time. A fixed log area is reserved in a memory to prevent an OS(Operating System) or an application program from using the fixed log area when the OS is started(S510). A pointer of a buffer used for output is set in the fixed log area when contents are output from the application program or a kernel. The output contents are stored in the fixed log area together with time information related to output(S540). A cache of a CPU is flushed when the system supports a watchdog function(S560). The fixed log area includes a log header area storing log information, an application program log area storing an application program log, and a kernel log area storing the log related to the kernel. The log header area includes location information storing the last log and a checksum for checking whether log header information is correct or incorrect.

Description

내장형 시스템에서 고정위치 메모리 영역을 이용한 로그 저장 방법{LOG STORING METHOD FOR EMBEDDED SYSTEM BY USING FIXED MEMORY AREA}How to save log using fixed location memory area in embedded system {LOG STORING METHOD FOR EMBEDDED SYSTEM BY USING FIXED MEMORY AREA}

도 1은 저장매체 또는 할당받은 메모리에 로그를 저장하는 종래의 방법을 도시한 도면.1 illustrates a conventional method of storing logs in a storage medium or an allocated memory.

도 2는 일 실시예에 따른 로그 영역의 구조를 도시한 도면.2 is a diagram illustrating a structure of a log area according to an exemplary embodiment.

도 3은 일 실시예에 따른 로그 저장 방법을 도시한 도면.3 is a diagram illustrating a log storing method according to an exemplary embodiment.

도 4는 일 실시예에 따른 고장 원인 추적을 위한 로그 출력의 예를 도시한 도면.4 is a diagram illustrating an example of a log output for tracking a cause of a failure, according to an exemplary embodiment;

도 5는 일 실시예에 따른 고정위치 메모리 영역을 이용한 로그 저장 흐름도.5 is a flowchart illustrating a log storage using a fixed location memory area according to an exemplary embodiment.

본 발명은 내장형 시스템에서의 고장 추적 방법에 관한 것으로, 특히 램과 같은 메모리의 고정 위치에 로그(LOG)를 남겨 내장형 시스템에서의 고장을 추적할 수 있도록 하는 방법에 관한 것이다. The present invention relates to a fault tracking method in an embedded system, and more particularly, to a method of tracking faults in an embedded system by leaving a log in a fixed position of a memory such as a RAM.

로그는 소프트웨어가 수행한 이력 정보(에러, 이벤트 등)의 기록을 말하는 것으로, 시스템에 문제가 발생한 경우 고장 원인을 추적할 수 있는 정보가 된다. 일반적으로 시스템에서의 고장을 추적할 수 있도록 로그를 남기는 방법에는 두 가지가 있다. 하나는 저장 매체에 로그를 남기는 방법이며, 다른 하나는 할당받은 램 영역에 로그를 남기는 방법이다. 도 1에 도시된 바와 같이 디스크나 플래시(Flash) 등의 저장매체에 로그를 남기는 시스템은, API 호출을 통해 로그 저장을 요청하는 응용프로그램(110)과 로그를 저장하는 라이브러리(또는 관리자)(120), 로그 내용이 실제로 저장되는 공간인 저장매체(140)로 구성된다. 저장매체(140)는 데이터를 저장할 수 있는 장치를 말하며, 일반적으로 데이터를 저장한 후 전원이 인가되지 않아도 데이터가 그대로 남아있는 비휘발성 저장매체를 말한다. 응용프로그램(110)이 로그를 저장하기 위한 라이브러리나 관리자(120)에게 필요한 로그의 저장을 요청하면 로그 라이브러리나 관리자(120)가 이를 저장매체(140)에 저장하는 방식으로 저장매체(140)의 크기에 따라 많은 양의 로그를 남길 수 있고, 문제가 발생하여 시스템이 재시작되어도 저장매체(140)에 로그 내용이 그대로 남아서 문제점을 추적할 수 있다The log is a record of the history information (errors, events, etc.) performed by the software. The log is information that can trace the cause of the failure when a problem occurs in the system. In general, there are two ways to log so that you can track failures in your system. One method is to log on the storage medium and the other method is to log on the allocated RAM area. As shown in FIG. 1, a system for recording a log on a storage medium such as a disk or flash includes an application 110 requesting log storage through an API call and a library (or manager) 120 for storing the log. ), The storage medium 140 is a space in which log contents are actually stored. The storage medium 140 refers to a device capable of storing data. In general, the storage medium 140 refers to a nonvolatile storage medium in which data remains as it is even after power is stored. When the application 110 requests the library or the manager 120 to store the log to store the log, the log library or the manager 120 stores the log in the storage medium 140. Depending on the size, a large amount of logs can be left, and even if a problem occurs and the system is restarted, the contents of the log remain in the storage medium 140 so that the problem can be tracked.

한편, 할당받은 램 영역에 로그를 남기는 시스템은, API호출 을 통해 로그 저장을 요청하는 응용 프로그램(110)과, 로그의 내용을 메모리를 할당받아 저장하는 라이브러리(또는 관리자)(120), 로그 내용이 실제로 저장되는 공간인 램(RAM)(130)으로 구성된다. 응용프로그램(110)이 로그를 저장하기 위한 라이브러리나 관리자(120)에게 필요한 로그의 저장을 요청하면 로그 라이브러리나 관리자(120)는 로그에 필요한 양만큼 메모리(130)를 할당받아 로그를 저장하는 것으로 서, 저장 매체(140)에 로그를 남기는 것에 비해 시스템 부하가 상대적으로 적고, 저장매체(140)에 비해 수명이 반영구적이며 안정성이 높다On the other hand, the system that leaves a log in the allocated RAM area, the application 110 requesting the log storage through the API call, the library (or administrator) 120 to store the contents of the log allocated to the memory, the log contents It is composed of a RAM (RAM) 130 which is a space that is actually stored. When the application 110 requests the library or the manager 120 to store the log to store the log, the log library or the manager 120 is allocated the memory 130 as necessary for the log to store the log. As a result, the system load is relatively low compared to leaving a log in the storage medium 140, and the life is semi-permanent and the stability is higher than that of the storage medium 140.

그러나, 저장 매체에 로그를 남기는 방법은 디스크나 플래시 등의 저장매체에 로그(LOG)를 남기는 것이므로 상대적으로 느리게 동작하고, 부하가 많이 발생하는 저장매체에 저장함으로 인해 시스템에 많은 부하가 발생하게 된다. 또한, 로그를 저장하기 위해서는 응용 프로그램에서 별도로 로그를 저장하는 API를 호출해 주어야 하며, 저장매체의 특성상 수명이 정해져 있고 저장매체가 고장이 발생할 확률이 높아서 안정성이 떨어지는 문제점이 있다. However, the method of leaving a log on a storage medium is to leave a log on a storage medium such as disk or flash, so that the operation is relatively slow and the load is generated on a storage medium that has a high load. . In addition, in order to save the log, an application program must call an API that stores the log separately. Due to the characteristics of the storage medium, its life is fixed, and the storage medium has a high probability of failure, resulting in poor stability.

할당받은 램 영역에 로그를 남기는 방법 역시 시스템에 문제가 발생하여 시스템이 재시작되면 로그가 사라져서 문제점을 추적할 수 없고, 로그를 저장하기 위해서 응용 프로그램이 별도의 API를 호출해야 하며, 로그를 남기기 위해 추가적인 부하가 발생하고, 응용 프로그램이 로그를 남기지 않을 경우에는 로그를 볼 수 없다는 문제점이 있었다.Logging in the allocated RAM area also causes problems in the system. When the system is restarted, the log disappears and the problem cannot be tracked. The application must call a separate API to save the log. If there is an additional load and the application does not leave a log, there is a problem that the log cannot be viewed.

본 발명은 부하없는 고장 추적을 수행하기 위해 내장형 시스템에서 고정위치 메모리 영역을 이용한 로그 저장 방법을 제공하는 것을 목적으로 한다.An object of the present invention is to provide a log storage method using a fixed location memory area in an embedded system to perform a load-free failure tracking.

이를 위해 일 실시예에서, 운영체제 또는 응용 프로그램이 사용하지 못하도록 운영체제 시작시 메모리에서의 고정위치 로그 영역을 예약하고, 응용 프로그램 또는 커널로부터 내용 출력시 출력을 위해 사용되는 버퍼에 대한 포인터를 상기 고정위치 로그 영역으로 설정하여, 출력되는 내용을 고정위치 로그 영역에 저장하는 방법이 제공된다.To this end, in one embodiment, the fixed location log area in memory is reserved at operating system startup to prevent the operating system or application from using it, and the pointer to the buffer used for output when outputting content from the application or kernel is fixed to the fixed location. By providing a log area, a method of storing the output content in a fixed location log area is provided.

일 실시예에서, 로그 영역은 상기 로그에 관한 정보를 저장하는 로그 헤더 영역, 상기 응용 프로그램 로그를 저장하는 응용 프로그램 로그 영역, 및 상기 커널에 관련된 로그를 저장하는 커널 로그 영역을 포함할 수 있으며, 로그 헤더 영역은 마지막으로 로그를 저장한 위치 정보 및 상기 로그 헤더 정보가 올바른 것인지 검사할 수 있도록 하는 체크섬(checksum) 정보를 포함할 수도 있다.In one embodiment, the log area may include a log header area for storing information about the log, an application log area for storing the application log, and a kernel log area for storing logs related to the kernel, The log header area may include location information where the log was last stored and checksum information for checking whether the log header information is correct.

일 실시예에서, 출력과 관련된 시간 정보를 더 포함하여 로그가 저장될 수 있으며, 와치독(watchdog) 기능을 지원하는 경우 CPU 캐시(cache)를 플러쉬(flush)할 수 있다. In one embodiment, the log may be stored further including time information related to the output, and the CPU cache may be flushed when the watchdog function is supported.

일 실시예에서, 로그 영역은 버퍼에서 버퍼가 다 사용된 경우, 새롭게 추가되는 버퍼 내용을 처음 위치에서부터 원형으로 겹쳐쓰도록(overwrite) 하기 위한 고정된 크기의 원형 버퍼(circular buffer) 형태로 관리될 수 있다.In one embodiment, the log area may be managed in the form of a fixed size circular buffer to overwrite the newly added buffer contents circularly from the initial position when the buffer is used up. Can be.

이하, 첨부된 도면을 참조하여 본 발명의 다양한 실시예들에 관하여 설명한다. Hereinafter, various embodiments of the present invention will be described with reference to the accompanying drawings.

도 2는 일 실시예에 따른 로그 영역의 구조를 도시한 도면이다. 시스템이 부팅되면서 운영체제는 각각의 목적에 따라 메모리를 맵핑(mapping)한다. 각각 운영체제 영역(210), 로그 영역(240) 및 응용 프로그램 영역(270)으로 메모리가 할당될 수 있으며, 로그 영역(240)은 고정 위치에 있는 램 영역으로서 전원이 차단되지 않는 한 시스템이 재시작되어도 내용이 그대로 보존된다. 본 실시예에서, 램(RAM) 은 전원이 공급되는 동안에만 저장된 데이터를 유지하는 휘발성 메모리를 의미하지만, 여기에 한정되는 것은 아니며, 이러한 기능을 수행하는 본 발명의 기술분야의 어떠한 적절한 저장매체로 구현될 수 있다.2 is a diagram illustrating a structure of a log area according to an exemplary embodiment. As the system boots, the operating system maps memory for different purposes. Memory may be allocated to the operating system area 210, the log area 240, and the application area 270, respectively, and the log area 240 is a RAM area in a fixed position, even if the system is restarted unless power is cut off. The content is preserved as it is. In this embodiment, RAM refers to a volatile memory that retains stored data only while power is supplied, but is not limited to any suitable storage medium in the art that performs this function. Can be implemented.

로그 영역(240)은 시스템 전체 메모리의 크기에 따라 변화할 수 있으며, 로그에 관한 정보를 저장하는 로그 헤더(header) 영역(242), 응용 프로그램 로그를 저장하는 응용 프로그램 로그 영역(245) 및 운영체제 또는 장치 드라이버의 로그를 저장하는 커널(Kernel) 로그 영역(248)으로 나누어질 수 있다. 로그 헤더 영역(242)은 마지막으로 로그를 저장한 위치(243) 및 로그 헤더 정보가 올바른 것인지 검사할 수 있도록 하는 체크섬(Checksum) 정보(244)를 포함할 수 있다. 마지막으로 로그를 저장한 위치(243) 정보를 바탕으로 버퍼 포인터를 마지막으로 로그가 저장된 위치로 변경하여 그 이후부터 로그가 저장될 수 있도록 한다. 체크섬이란 데이터의 정확성을 검사하기 위한 용도로 사용되는 합계, 오류 검출 방식의 하나로서, 데이터의 입력이나 전송 시에 제대로 되었는지를 확인하기 위해, 입력 데이터나 전송 데이터의 맨 마지막에 앞서 보낸 모든 데이터를 다 합한 합계를 따로 보내는 것이다. 데이터를 받아들이는 측에서는 하나씩 받아들여 합산한 다음 이를 최종적으로 들어온 검사 합계와 비교하여 착오가 있는지를 점검함으로써, 로그 헤더 정보의 무결성을 검사할 수 있다. 앞서 설명한 바와 같이, 고정위치의 메모리 영역(fixed memory area)을 로그 영역(240)으로 사용하고 이 영역을 보호하는 것은, 시스템에 고장이 발생하여 재시작되더라도 전원이 차단되지 않는 한 로그의 내용이 그대로 남게 되므로 사후에 고장의 원인을 추적할 수 있기 때문이다. The log area 240 may change according to the size of the system-wide memory, a log header area 242 for storing information about the log, an application log area 245 for storing an application log, and an operating system Alternatively, it may be divided into a kernel log area 248 that stores a log of a device driver. The log header area 242 may include a location 243 where the log was last stored, and checksum information 244 for checking whether the log header information is correct. Finally, the buffer pointer is changed to the location where the log was last stored based on the information on the location of the log 243 so that the log can be stored thereafter. A checksum is a sum and error detection method used to check the accuracy of data. It checks all data sent before the last input data or the last transmission data to check whether the data is correctly entered or transmitted. It is sending the total sum separately. The receiving party can check the integrity of the log header information by taking one by one, summing them up, and then comparing them with the final check sum. As described above, using a fixed memory area as a log area 240 and protecting this area is that the contents of the log remain intact unless the power is shut down even if the system fails and restarts. This is because the cause of the failure can be traced afterwards.

도 3은 일 실시예에 따른 로그 저장 방법을 도시한 도면이다. 응용 프로그램(310) 또는 커널(350)이 콘솔 장치로 임의의 내용을 출력할 때에는 반드시 임시버퍼에 출력될 내용을 저장하게 된다. 커널(350)은 운영체제에서 가장 기초적이고 핵심적인 기능을 담당하는 부분으로 기억 장소, 메모리, 파일, 주변 장치 등과 같은 시스템을 구성하는 중요한 자원을 관리한다. 뿐만 아니라 시간 관리, 프로세서 관리, CPU 스케줄링, 입출력 제어, 시스템 자원의 배분 등과 같이 컴퓨터 운영에 필요한 핵심 사항을 처리한다. 한편, 콘솔 장치는 시스템의 수행 내용을 보여주는 터미널 장치를 말하는 것으로 예컨대 PC에서의 모니터, 내장형 시스템에서의 시리얼 장치나 랜 등이 이에 해당된다. 시스템 수행 단계에서 예컨대, printf(320) 또는 printk(360)와 같은 프린트 출력 함수 등을 통해 응용 프로그램(310) 또는 커널(350)에서의 내용을 콘솔 장치로 출력하게 되는데, 시스템 모듈(도시하지 않음)은 사용되는 버퍼에 대한 포인터를 고정위치의 메모리 영역인 응용 프로그램 로그 영역(330) 또는 커널 로그 영역(370)으로 바꿀 수 있다. 고정위치의 메모리 영역은 크기가 한정되어 있으므로, 정해진 크기 내에서 사용할 있도록 로그 영역은 원형 버퍼(circular buffer; 340, 380) 형태로 관리될 수 있다. 원형 버퍼(340, 380)는 원형 버퍼에서 버퍼가 다 사용된 경우, 새롭게 추가되는 버퍼 내용을 처음 위치에서부터 원형으로 겹쳐쓰도록(overwrite) 함으로써 고정된 크기를 가질 수 있다. 이를 통해 버퍼 내용을 따로 복사하여 저장하는 추가적인 부하 없이 로그를 저장할 수 있으며, 응용 프로그램(310) 또는 커널(350)에서 출력되는 모든 메시지의 내용이 로그 영역에 남게 되므로 로그를 남기기 위해 응용 프로그램(310)이나 커널(350)에서 별도의 API를 사용할 필요가 없게 된다. 3 is a diagram illustrating a log storing method according to an exemplary embodiment. When the application 310 or the kernel 350 outputs arbitrary contents to the console device, the contents to be output to the temporary buffer must be stored. The kernel 350 is the most basic and core function of the operating system, and manages important resources constituting the system such as storage, memory, files, and peripheral devices. In addition, it handles key aspects of computer operations such as time management, processor management, CPU scheduling, I / O control, and system resource allocation. On the other hand, the console device refers to a terminal device that shows the performance of the system, such as a monitor on a PC, a serial device or LAN in an embedded system. In the system execution step, for example, the contents of the application 310 or the kernel 350 are output to the console device through a print output function such as printf 320 or printk 360, and a system module (not shown). ) May change the pointer to the buffer used to the application log area 330 or the kernel log area 370, which is a memory area of a fixed location. Since the memory area of the fixed position is limited in size, the log area may be managed in the form of circular buffers 340 and 380 to be used within a predetermined size. The circular buffers 340 and 380 may have a fixed size when the buffers are used up in the circular buffer by overwriting the newly added buffer contents in a circular form from the initial position. Through this, the log can be saved without the additional load of copying and storing the buffer contents separately, and the contents of all messages output from the application 310 or the kernel 350 remain in the log area, thereby leaving the application 310 to leave the log. ) Or kernel 350 does not need to use a separate API.

시스템에 따라 와치독(Watchdog) 장치를 포함할 수도 있다. 와치독 장치는 하드웨어나 소프트웨어의 고장으로 인해 특정 위치에서 무한루프를 수행하게 되어 다른 작업을 전혀 할 수 없게 된 경우, 일정 주기 동안 와치독을 소프트웨어가 리셋하지 않으면 시스템 전체를 자동으로 강제 리셋시키는 장치이다. 이러한 와치독 기능을 가진 시스템에서는 와치독을 통해 하드웨어가 리셋되는 경우 메모리에 저장된 내용이 실제의 물리적 메모리에 저장되지 않고 중앙처리장치의 캐시(CPU Cache)에만 존재할 수 있다. 따라서, 와치독 기능이 있는 시스템에서는 출력이 끝난 후 캐시를 플러쉬(flush)함으로써 중앙처리장치의 캐시와 메모리의 내용을 일치시키는 작업을 수행할 수 있다. Depending on the system, a watchdog device may be included. Watchdog is a device that automatically resets the entire system when the watchdog is not reset by the software for a certain period of time when a hardware or software failure causes an infinite loop to be performed at a specific position and no other work can be done at all. to be. In a system having such a watchdog function, when hardware is reset through the watchdog, the contents stored in the memory may exist only in the CPU cache of the central processing unit instead of the actual physical memory. Therefore, in a system having a watchdog function, after the output is finished, the cache may be flushed to match the contents of the cache and the memory of the CPU.

한편, 로그 영역(330, 370)에 로그를 저장할 때 시각 정보를 함께 저장할 수도 있다. 고장 분석 시, 문제가 발생한 시각이 중요한 경우가 많으므로 이와 같이 시각 정보를 함께 저장하게 되면 분석을 보다 용이하게 수행할 수 있다. Meanwhile, when storing logs in the log areas 330 and 370, time information may be stored together. In the failure analysis, the time when a problem occurs is often important, so when the visual information is stored together in this way, the analysis can be performed more easily.

리눅스와 같은 유닉스 계열의 운영체제에서는 응용 프로그램(310)이 잘못된 주소에 접근하여 종료될 때에, 수행중인 응용 프로그램의 수행 내용은 파일로 저장되고 사후에 이 파일을 분석할 수 있게 된다. 이러한 파일의 저장공간이 따로 존재하지 않는 경우에는 이를 저장하여 분석할 수 없게 되지만, 일 실시예에 따라 종료 정보를 출력하기만 하면 로그가 자동으로 로그 영역에 저장되므로, 응용 프로그램(310)의 오류 분석이 가능해진다. In a Unix-like operating system such as Linux, when an application 310 accesses the wrong address and terminates, the execution contents of the running application program are stored as a file and the file can be analyzed later. If the storage space of such a file does not exist separately, it cannot be stored and analyzed, but according to an exemplary embodiment, since the log is automatically stored in the log area simply by outputting the termination information, an error of the application 310 may occur. Analysis is possible.

도 4는 일 실시예에 따른 고장 원인 추적을 위한 로그 출력의 예를 도시한 도면이다. 예를 들어, 응용 프로그램이나 장치 드라이버에 오류가 발생한 경우 이들은 강제 종료되고 종료될 시점의 중앙처리장치 내의 레지스터 정보 등을 출력한 후 운영체제는 시스템을 재시작하거나 응용 프로그램을 재시작할 수 있다. 이 때, 출력 메시지는 앞에서 설명한 바와 같이 로그로 저장되므로 고장의 원인을 추적할 수 있게 된다. 도 4에 도시된 로그 정보는 출원인이 개발한 통신 장비에 사용하기 위해 안정성을 높인 리눅스인 FTLinux(Fault Tolerant Linux)에서의 로그 출력을 예시한 것이며, 이러한 정보를 통해 로그를 분석하여 고장 원인을 추적할 수 있다. 4 is a diagram illustrating an example of a log output for tracking a cause of a failure, according to an exemplary embodiment. For example, when an error occurs in an application program or a device driver, the operating system may restart the system or restart the application program after outputting register information in the central processing unit at the time of forced termination and termination. At this time, the output message is stored as a log as described above, so that the cause of the failure can be traced. The log information shown in FIG. 4 is an example of a log output from FTLinux (Fault Tolerant Linux), which is a Linux having improved stability for use in a communication device developed by the applicant, and analyzes the log to track the cause of the failure. can do.

도 5는 일 실시예에 따른 고정위치 메모리 영역을 이용한 로그 저장 흐름도이다. 시스템이 시작되면 운영체제가 각각의 목적에 따라 메모리를 할당하며 고정위치 메모리 영역, 즉 로그 영역(240)(도 2)을 사용하지 못하도록 예약한다(S510). 운영 프로그램 또는 커널이 콘솔로 정보를 출력할 때, 예컨대, printf 또는 printk와 같은 프린트 출력 함수를 호출한다(S520). 단계(S530)에서, 버퍼 포인터를 마지막으로 로그가 저장된 위치로 변경하여 그 이후부터 로그가 저장될 수 있도록 한다. 다음으로, 콘솔로 출력되는 내용이 램과 같은 메모리의 로그 영역, 즉 응용 프로그램 로그 영역(245) 또는 커널 로그 영역(248)에 저장된다(S540). 시스템이 와치독 기능을 지원하는지를 판단하고(S550), 와치독 기능을 지원하는 경우, CPU의 캐시를 플러쉬함으로써 CPU 캐시의 내용과 메모리의 내용을 일치시킨다(S560). 5 is a flowchart illustrating a log storing using a fixed location memory area, according to an exemplary embodiment. When the system starts, the operating system allocates memory for each purpose and reserves the fixed location memory area, that is, the log area 240 (FIG. 2) from being used (S510). When the operating program or the kernel outputs information to the console, for example, a print output function such as printf or printk is called (S520). In step S530, the buffer pointer is changed to the location where the log was last stored so that the log can be stored thereafter. Next, the content output to the console is stored in the log area of the memory such as RAM, that is, the application log area 245 or the kernel log area 248 (S540). It is determined whether the system supports the watchdog function (S550), and if the watchdog function is supported, the CPU cache is flushed to match the contents of the CPU cache (S560).

상기 실시예들은 또한 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨 터 시스템에 의해 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광데이터 저장장치 등이 있으며, 또한 케리어 웨이브(예를 들어 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 또한, 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다. 그리고, 상기 실시예들을 구현하기 위한 기능적인(functional) 프로그램, 코드 및 코드 세그먼트들은 본 발명이 속하는 기술분야의 프로그래머들에 의해 용이하게 추론될 수 있다.The above embodiments can also be embodied as computer readable codes on a computer readable recording medium. Computer-readable recording media include any type of recording device that stores data that can be read by a computer system. Examples of computer-readable recording media include ROM, RAM, CD-ROM, magnetic tape, floppy disks, optical data storage devices, and the like, which are also implemented in the form of carrier waves (for example, transmission over the Internet). Include. The computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion. In addition, functional programs, codes, and code segments for implementing the above embodiments can be easily inferred by programmers in the art to which the present invention belongs.

이상에서 본 발명의 바람직한 실시예를 참조하여 본 발명에 대해서 상세하게 설명되었으나, 이들은 단지 예시적인 것에 불과하며, 본 발명이 속하는 기술 분야에서 통상의 기술을 가진 자라면 이로부터 다양한 변형 및 균등한 다른 실시예가 가능하다는 점을 이해할 것이다. 따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 특허청구범위의 기술적 사상에 의하여 정해져야 할 것이다.Although the present invention has been described in detail with reference to the preferred embodiments of the present invention, these are merely exemplary, and those skilled in the art to which the present invention pertains have various modifications and equivalents therefrom. It will be appreciated that embodiments are possible. Therefore, the true technical protection scope of the present invention will be defined by the technical spirit of the appended claims.

상기 실시예들에 따르면, 응용 프로그램 개발자는 장치 드라이버 개발자가 별도의 로그를 고려하거나 사용하지 않고 단순한 출력 함수만으로도 로그를 남길 수 있게 되어 개발자의 부담을 줄일 수 있고, 로그를 빠뜨리는 실수를 원천적으로 방지할 수 있으며, 별도의 라이브러리나 관리자를 설치할 필요가 없다. 그리고 실시간으로 로그가 남기 때문에 치명적인 장치 결함의 이유로 갑자기 시스템이 고장 나는 경우에도 로그를 남길 수 있게 된다. According to the above embodiments, the application program developer can leave a log with a simple output function without the device driver developer considering or using a separate log, thereby reducing the burden on the developer and preventing a mistake of dropping the log. You don't need to install a separate library or manager. And because the log remains in real time, it can be logged even if the system suddenly fails due to a fatal device fault.

또한 상기 실시예들에 따르면, 로그를 저장하기 위해 추가적인 버퍼 복사가 없으므로 시스템 부하를 줄일 수 있고, 로그를 메모리에 저장하므로 로그가 손상될 확률이 줄어들게 되며 전원이 차단되지 않는 한 시스템이 재시작되어도 이전의 로그가 그대로 남아있게 된다. 마지막으로, 응용 프로그램 로그 뿐만 아니라 커널 로그도 남길 수 있게 되는 효과가 있다. In addition, according to the above embodiments, there is no additional buffer copy to store the log, so that the system load can be reduced, and the log is stored in memory, thereby reducing the possibility of log corruption, even if the system is restarted unless the power is turned off. Will remain intact. Finally, the effect is that you can leave not only the application log but also the kernel log.

Claims (11)

내장형 시스템에서 고정위치 메모리 영역을 이용한 로그(LOG) 저장 방법으로서,Log storage method using fixed location memory area in embedded system, 운영체제 또는 응용 프로그램이 사용하지 못하도록 운영체제 시작시 메모리에서의 고정위치 로그 영역을 예약하는 단계;Reserving a fixed location log area in memory at startup of the operating system to prevent use by the operating system or an application program; 응용 프로그램 또는 커널로부터 내용 출력시, 상기 출력을 위해 사용되는 버퍼에 대한 포인터를 상기 고정위치 로그 영역으로 설정하는 단계; 및When outputting content from an application or kernel, setting a pointer to a buffer used for the output to the fixed location log area; And 상기 출력되는 내용을 상기 고정위치 로그 영역에 저장하는 단계Storing the output content in the fixed location log area 를 포함하는 방법.How to include. 제1항에 있어서,The method of claim 1, 상기 로그 영역은 상기 로그에 관한 정보를 저장하는 로그 헤더 영역, 상기 응용 프로그램 로그를 저장하는 응용 프로그램 로그 영역, 및 상기 커널에 관련된 로그를 저장하는 커널 로그 영역을 포함하는 방법.The log area includes a log header area for storing information about the log, an application log area for storing the application log, and a kernel log area for storing logs related to the kernel. 제2항에 있어서, The method of claim 2, 상기 로그 헤더 영역은 마지막으로 로그를 저장한 위치 정보 및 상기 로그 헤더 정보가 올바른 것인지 검사할 수 있도록 하는 체크섬(checksum) 정보를 포함 하는 방법.And the log header area includes checksum information for checking whether or not the log header information is correct. 제1항에 있어서,The method of claim 1, 상기 저장하는 단계는 상기 출력과 관련된 시간 정보를 더 포함하여 저장하는 단계를 포함하는 방법. The storing step further includes storing the time information associated with the output. 제1항에 있어서,The method of claim 1, 상기 시스템이 와치독(watchdog) 기능을 지원하는 경우, CPU 캐시(cache)를 플러쉬(flush)하는 단계를 더 포함하는 방법. If the system supports a watchdog function, further comprising flushing a CPU cache. 제1항에 있어서,The method of claim 1, 상기 로그 영역은 버퍼에서 버퍼가 다 사용된 경우, 새롭게 추가되는 버퍼 내용을 처음 위치에서부터 원형으로 겹쳐쓰도록(overwrite) 하기 위한 고정된 크기의 원형 버퍼(circular buffer) 형태로 관리되는 방법. The log area is managed in the form of a fixed size circular buffer to overwrite the newly added buffer contents from the initial position when the buffer is used up in the buffer. 내장형 시스템에서 고정위치 메모리 영역을 이용한 로그 저장 시스템으로서,A log storage system using a fixed location memory area in an embedded system, 운영체제 또는 응용 프로그램이 사용하지 못하도록 상기 운영체제 시작시 자신의 고정위치 로그 영역이 예약되는 메모리; 및A memory in which its fixed location log area is reserved at the start of the operating system to prevent an operating system or an application from using it; And 응용 프로그램 또는 커널로부터 내용 출력시, 상기 출력을 위해 사용되는 버퍼에 대한 포인터를 상기 고정위치 로그 영역으로 설정하는 모듈A module that, when outputting content from an application or kernel, sets a pointer to the buffer used for the output to the fixed location log area. 을 포함하는 로그 저장 시스템.Log storage system comprising a. 제7항에 있어서,The method of claim 7, wherein 상기 로그 영역은 상기 로그에 관한 정보를 저장하는 로그 헤더 영역, 상기 응용 프로그램 로그를 저장하는 응용 프로그램 로그 영역, 및 상기 커널에 관련된 로그를 저장하는 커널 로그 영역을 포함하는 로그 저장 시스템.The log area includes a log header area for storing information about the log, an application log area for storing the application log, and a kernel log area for storing logs related to the kernel. 제7항에 있어서,The method of claim 7, wherein 상기 로그 영역은 버퍼에서 버퍼가 다 사용된 경우, 새롭게 추가되는 버퍼 내용을 처음 위치에서부터 원형으로 겹쳐쓰도록 하기 위한 고정된 크기의 원형 버퍼 형태로 관리되는 로그 저장 시스템. The log area is managed in the form of a fixed size circular buffer for overwriting the newly added buffer contents in a circular form when the buffer is used up in the buffer. 제7항에 있어서,The method of claim 7, wherein 와치독(watchdog) 장치를 더 포함하고,Further comprising a watchdog device, 상기 출력 후 상기 고정위치 로그 영역은 CPU 캐시의 플러쉬를 통해 상기 캐시의 정보와 일치되는 로그 저장 시스템.And the fixed location log area after the output is consistent with information in the cache through flushing a CPU cache. 내장형 시스템에서 고정위치 메모리 영역을 이용한 로그 저장 방법을 수행하기 위한 컴퓨터 실행 가능 명령어들을 저장하는 컴퓨터 판독 가능 기록 매체로서, 상기 방법은,A computer readable recording medium storing computer executable instructions for performing a log storage method using a fixed location memory area in an embedded system, the method comprising: 운영체제 또는 응용 프로그램이 사용하지 못하도록 운영체제 시작시 메모리에서의 고정위치 로그 영역을 예약하는 단계;Reserving a fixed location log area in memory at startup of the operating system to prevent use by the operating system or an application program; 응용 프로그램 또는 커널로부터 내용 출력시, 상기 출력을 위해 사용되는 버퍼에 대한 포인터를 상기 고정위치 로그 영역으로 설정하는 단계; 및When outputting content from an application or kernel, setting a pointer to a buffer used for the output to the fixed location log area; And 상기 출력되는 내용을 상기 고정위치 로그 영역에 저장하는 단계Storing the output content in the fixed location log area 를 포함하는 컴퓨터 판독 가능 기록 매체.Computer-readable recording medium comprising a.
KR1020060127025A 2006-12-13 2006-12-13 Log storing method for embedded system by using fixed memory area KR20080054592A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020060127025A KR20080054592A (en) 2006-12-13 2006-12-13 Log storing method for embedded system by using fixed memory area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020060127025A KR20080054592A (en) 2006-12-13 2006-12-13 Log storing method for embedded system by using fixed memory area

Publications (1)

Publication Number Publication Date
KR20080054592A true KR20080054592A (en) 2008-06-18

Family

ID=39801520

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060127025A KR20080054592A (en) 2006-12-13 2006-12-13 Log storing method for embedded system by using fixed memory area

Country Status (1)

Country Link
KR (1) KR20080054592A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294176A (en) * 2016-08-19 2017-01-04 暴风集团股份有限公司 The method and system of application failure location in Mac OS system
CN110147304A (en) * 2019-04-03 2019-08-20 珠海全志科技股份有限公司 A kind of method and apparatus of acquisition system bootload log
KR102326683B1 (en) 2020-07-22 2021-11-16 웹케시 주식회사 System and method for asynchronous logging using queue and computer program for the same

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294176A (en) * 2016-08-19 2017-01-04 暴风集团股份有限公司 The method and system of application failure location in Mac OS system
CN106294176B (en) * 2016-08-19 2018-11-06 暴风集团股份有限公司 The method and system that application failure positions in Mac OS systems
CN110147304A (en) * 2019-04-03 2019-08-20 珠海全志科技股份有限公司 A kind of method and apparatus of acquisition system bootload log
KR102326683B1 (en) 2020-07-22 2021-11-16 웹케시 주식회사 System and method for asynchronous logging using queue and computer program for the same

Similar Documents

Publication Publication Date Title
EP1693757B1 (en) System and method for using a file system to automatically backup a file as a generational file
US8694983B1 (en) Systems and methods for providing guidance on the potential impact of application and operating-system changes on a computing system
US10296423B2 (en) System and method for live virtual incremental restoring of data from cloud storage
US20170046152A1 (en) Firmware update
US9110918B1 (en) Systems and methods for measuring compliance with a recovery point objective for an application
US7552044B2 (en) Simulated storage area network
US7225361B2 (en) Detecting a stalled routine
US9678682B2 (en) Backup storage of vital debug information
US7363546B2 (en) Latent fault detector
US8397032B2 (en) Recovery in shared memory environment
US20050204186A1 (en) System and method to implement a rollback mechanism for a data storage unit
US8219851B2 (en) System RAS protection for UMA style memory
US7516317B2 (en) Measuring an operating system's boot duration
US10049036B2 (en) Reliable distributed messaging using non-volatile system memory
US20150161008A1 (en) Virtual machine crash management
US9195670B1 (en) Tracking write operations for incremental backups of data
US7603442B2 (en) Method and system for maintaining service dependency relationships in a computer system
CN114222975A (en) Data preservation using memory aperture flush sequence
US20070083792A1 (en) System and method for error detection and reporting
US10514972B2 (en) Embedding forensic and triage data in memory dumps
KR20080054592A (en) Log storing method for embedded system by using fixed memory area
US11210024B2 (en) Optimizing read-modify-write operations to a storage device by writing a copy of the write data to a shadow block
US11226875B2 (en) System halt event recovery
JP2023532835A (en) Live migrate virtual machine to target host on fatal memory error
US10712952B1 (en) Metadata caches in a reliable distributed computing system

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E601 Decision to refuse application