Search

CN-122019314-A - Visual analysis method, medium and device for SSD log

CN122019314ACN 122019314 ACN122019314 ACN 122019314ACN-122019314-A

Abstract

The application discloses a visual analysis method, medium and equipment for SSD logs, and relates to the technical field of SSD solid state disks, wherein a dotting function is embedded in a place where the logs need to be recorded in codes, and the dotting function distinguishes the logs through parameter transmission; when the code runs, the dotting function uses a preset fixed log format to fill parameters into a log buffer area in the mode of original data and record the number of the cached logs, after the recorded logs are written into the NAND storage medium, the stored log data are read from the NAND storage medium through a Host side log tool, and the read log data are processed by using a preset analysis tool to draw dotting information into a graph. According to the method, the parameters are directly filled into the log buffer in a data mode, so that complex parameter analysis is not needed, the SSD log space utilization efficiency is improved, and the SSD main control CPU consumption is reduced.

Inventors

  • Lu Songpin
  • MA YI
  • XIONG WEI
  • LUO WENJIE
  • DING LI
  • LIN BO
  • ZHOU JIAN

Assignees

  • 芯盛智能科技(湖南)有限公司

Dates

Publication Date
20260512
Application Date
20260415

Claims (7)

  1. 1. A visual analysis method for SSD logs, comprising: embedding a dotting function in a place where the log needs to be recorded in the code, wherein the dotting function distinguishes the log through parameter transmission; When the code runs, the dotting function uses a preset fixed log format, the parameters are filled into a log buffer area in the mode of original data, the number of the buffered logs is recorded, the preset fixed log format comprises a log record time stamp Ts, a log type identifier ID, the number of effective parameters Num and a parameter Value to be recorded by the log, different logs are identified through the log record time stamp Ts and the log type identifier ID, the character length of the log is shortened, the log record is carried out through a preset ID enabling state, if the ID enabling state, the log is recorded, otherwise, the log does not need to be recorded; after the recorded log is written into the NAND storage medium, reading the stored log data from the NAND storage medium through a Host side log tool; And processing the read log data by using a preset analysis tool, and drawing dotting information recorded in the log data into a graph to realize visual analysis of the SSD log.
  2. 2. The visual analysis method for SSD as recited in claim 1, wherein after the parameters are filled into the log buffer as raw data, the write pointer of the log buffer is updated to determine whether the log buffer needs to be flushed.
  3. 3. The visual analysis method for SSD logs of claim 2, wherein the log is to be flushed down to Nand, and the Host side requests data from the SSD by a log tool, obtains log data, and concatenates the log data into a binary file.
  4. 4. The visual analysis method for SSD log according to claim 3, characterized in that the processing of the binary file with a preset analysis tool specifically includes: Log statistics, counting the types, the number and the time range of the logs and the number and the range of the IDs of the logs, and counting the values; The method comprises the steps of log filtering, wherein the log filtering is used for manually closing or enabling a certain type of log for key analysis, namely, log drawing and log redirection are carried out on the filtered log; drawing logs, namely drawing the filtered logs into a graph according to preset filtering conditions; redirecting the logs, namely redirecting the filtered logs into a text format according to preset filtering conditions; the preset filtering condition comprises selectively checking certain IDs, and sorting according to the IDs or sorting according to the values.
  5. 5. The visual analysis method for SSD log as recited in claim 4, wherein the dynamic individual switch of the interval log is specified by setting an ID mask.
  6. 6. A computer storage medium, characterized in that the medium has stored thereon a computer program, which is executed by a processor to implement the method of any of claims 1-5.
  7. 7. An electronic device, the electronic device comprising: A memory storing executable instructions; a processor executing the executable instructions in the memory to implement the method of any one of claims 1-5.

Description

Visual analysis method, medium and device for SSD log Technical Field The invention relates to the technical field of SSD solid state drives, in particular to a visual analysis method, medium and equipment for SSD logs. Background In the running process of an SSD Solid state disk (Solid STATE DRIVE), in order to record the running state of a disk and facilitate problem positioning, the running log of the disk is inevitably required to be recorded, and a common log recording mode is to print a log prefix (including a timestamp, a log level, IO count and the like), a keyword, a key parameter and the like through a printf printing function, and then store the log prefix in a text mode. The main control log system provides corresponding API interface for calling party to print and output log, and the log system outputs the log content to serial port or writes the log content into log down-flushing buffer area. When the log buffer area is full or other brushing trigger conditions are met, the log system brushes the log in the buffer area down to the Nand flash memory for storage, and synchronously records key information such as brushing positions and the like. If the power-down condition occurs, the restarted log system needs to scan log data to recover related parameters, and then reads corresponding log content from the Nand flash memory according to the recovered brushing parameters. When the log is recorded, the key parameters are analyzed according to the formatted character string, and descriptive characters are printed to ensure the uniqueness of the log, so that the process is relatively time-consuming, especially for high-performance SSDs, frequent printing and parameter cyclic analysis consume CPU time, and performance is reduced. Disclosure of Invention The invention aims to overcome the defects of the prior art and provides a visual analysis method, medium and equipment for SSD logs. The aim of the invention is realized by the following technical scheme: In a first aspect, the present application discloses a visual analysis method for SSD logs, comprising: embedding a dotting function in a place where the log needs to be recorded in the code, wherein the dotting function distinguishes the log through parameter transmission; When the code runs, the dotting function uses a preset fixed log format, the parameters are filled into a log buffer area in the mode of original data, the number of the buffered logs is recorded, the preset fixed log format comprises a log record time stamp Ts, a log type identifier ID, the number of effective parameters Num and a parameter Value to be recorded by the log, different logs are identified through the log record time stamp Ts and the log type identifier ID, the character length of the log is shortened, the log record is carried out through a preset ID enabling state, if the ID enabling state, the log is recorded, otherwise, the log does not need to be recorded; after the recorded log is written into the NAND storage medium, reading the stored log data from the NAND storage medium through a Host side log tool; And processing the read log data by using a preset analysis tool, and drawing dotting information recorded in the log data into a graph to realize visual analysis of the SSD log. Based on the first aspect, after the parameters are filled into the log buffer area in the original data mode, the write pointer of the log buffer area is updated to judge whether the log buffer area needs to be flushed. Based on the first aspect, the log is to be brushed down to Nand, the Host side asks for data from the SSD through a log tool, log data are obtained, and the log data are spliced into a binary file. Based on the first aspect, processing the binary file by using a preset analysis tool specifically includes: Log statistics, counting the types, the number and the time range of the logs and the number and the range of the IDs of the logs, and counting the values; The method comprises the steps of log filtering, wherein the log filtering is used for manually closing or enabling a certain type of log for key analysis, namely, log drawing and log redirection are carried out on the filtered log; drawing logs, namely drawing the filtered logs into a graph according to preset filtering conditions; redirecting the logs, namely redirecting the filtered logs into a text format according to preset filtering conditions; the preset filtering condition comprises selectively checking certain IDs, and sorting according to the IDs or sorting according to the values. Based on the first aspect, by setting the ID mask, a dynamic individual switch of the section log is specified. In a second aspect, the present application discloses a computer storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the above-described method. In a third aspect, the present application discloses an electronic device, including: A memory storing e