[go: up one dir, main page]

CN105824669B - Debugging log obtaining method and device and terminal equipment - Google Patents

Debugging log obtaining method and device and terminal equipment Download PDF

Info

Publication number
CN105824669B
CN105824669B CN201610150781.1A CN201610150781A CN105824669B CN 105824669 B CN105824669 B CN 105824669B CN 201610150781 A CN201610150781 A CN 201610150781A CN 105824669 B CN105824669 B CN 105824669B
Authority
CN
China
Prior art keywords
command line
terminal device
line parameter
serial port
debugging
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.)
Expired - Fee Related
Application number
CN201610150781.1A
Other languages
Chinese (zh)
Other versions
CN105824669A (en
Inventor
田小华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610150781.1A priority Critical patent/CN105824669B/en
Publication of CN105824669A publication Critical patent/CN105824669A/en
Application granted granted Critical
Publication of CN105824669B publication Critical patent/CN105824669B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请提出一种调试日志获取方法、装置及终端设备,其中,该方法包括:在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;根据所述第一命令行参数关闭串口;当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。

The present application proposes a method, device and terminal device for obtaining a debug log, wherein the method comprises: in the kernel loading stage of the terminal device, parsing a first command line parameter preset in a boot image file corresponding to the application version of the terminal device; closing the serial port according to the first command line parameter; when it is necessary to obtain a debug log, refreshing the boot image file, parsing a second command line parameter corresponding to the debug version of the terminal device in the refreshed boot image file; opening the serial port according to the second command line parameter to obtain the debug log. Thus, while reducing the boot time of the terminal device, the debug log information can be obtained according to the application needs.

Description

调试日志获取方法、装置及终端设备Debugging log acquisition method, device and terminal equipment

技术领域technical field

本申请涉及计算机处理技术领域,尤其涉及一种调试日志获取方法、装置及终端设备。The present application relates to the technical field of computer processing, and in particular to a debugging log acquisition method, device and terminal equipment.

背景技术Background technique

当终端设备运行过程中出现问题时,需要通过分析调试日志解决问题。例如:手机不开机等问题。When a problem occurs during the operation of the terminal device, you need to analyze the debugging log to solve the problem. For example: problems such as mobile phones not turning on.

目前,趋于linux层终端设备注册的调试信息需要通过串口来抓取日志,同时,针对不开机的问题也需要通过串口来获取调试信息。但是,对于终端设备的正式发布版本,需要通过关闭串口达到减少开机时间的目的。因此,当终端设备运行中出现问题时,将无法获取调试日志来分析问题。At present, the debugging information tending to be registered by the terminal device at the linux layer needs to capture logs through the serial port. However, for the official release version of the terminal device, it is necessary to reduce the boot time by closing the serial port. Therefore, when a problem occurs during the operation of the terminal device, the debug log cannot be obtained to analyze the problem.

发明内容Contents of the invention

本申请旨在至少在一定程度上解决相关技术中的技术问题之一。This application aims to solve one of the technical problems in the related art at least to a certain extent.

为此,本申请的第一个目的在于提出一种调试日志获取方法,该方法实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。Therefore, the first purpose of the present application is to propose a method for obtaining debugging logs, which realizes obtaining debugging log information according to application needs while reducing the startup time of the terminal device.

本申请的第二个目的在于提出一种调试日志获取装置。The second purpose of the present application is to propose a debugging log acquisition device.

本申请的第三个目的在于提出一种终端设备。The third purpose of the present application is to provide a terminal device.

为达上述目的,本申请第一方面实施例提出了一种调试日志获取方法,包括:在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;根据所述第一命令行参数关闭串口;当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;根据所述第二命令行参数打开串口获取所述调试日志。In order to achieve the above purpose, the embodiment of the first aspect of the present application proposes a debug log acquisition method, including: in the kernel loading stage of the terminal device, parsing the first command preset in the boot image file corresponding to the application version of the terminal device Line parameters; close the serial port according to the first command line parameter; when the debug log needs to be obtained, refresh the boot boot image file, and analyze the second command line parameter corresponding to the terminal device debugging version in the refreshed boot boot image file ; Opening a serial port according to the second command line parameter to obtain the debugging log.

本申请实施例的调试日志获取方法,通过在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;根据所述第一命令行参数关闭串口;当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。The debugging log acquisition method of the embodiment of the present application, by analyzing the first command line parameter corresponding to the application version of the terminal device preset in the boot boot image file in the kernel loading stage of the terminal device; closing according to the first command line parameter Serial port; when it is necessary to obtain the debug log, refresh the boot boot image file, and analyze the second command line parameter corresponding to the terminal device debugging version in the refreshed boot boot image file; open the serial port according to the second command line parameter to obtain The debug log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

为达上述目的,本申请第二方面实施例提出了一种调试日志获取装置,包括:第一解析模块,用于在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;第一处理模块,用于根据所述第一命令行参数关闭串口;刷新模块,用于当需要获取调试日志时,刷新所述开机引导镜像文件;第二解析模块,用于解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;第二处理模块,用于根据所述第二命令行参数打开串口获取所述调试日志。In order to achieve the above purpose, the embodiment of the second aspect of the present application proposes a debug log acquisition device, including: a first parsing module, used to analyze the preset in the boot image file and the terminal device during the kernel loading stage of the terminal device The first command line parameter corresponding to the application version; the first processing module is used to close the serial port according to the first command line parameter; the refresh module is used to refresh the boot image file when debugging logs need to be obtained; the second The analysis module is used to analyze the second command line parameters corresponding to the debugging version of the terminal device in the refreshed boot image file; the second processing module is used to open a serial port according to the second command line parameters to obtain the debugging log.

本申请实施例的调试日志获取装置,通过在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;根据所述第一命令行参数关闭串口;当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。The debug log acquisition device of the embodiment of the present application analyzes the first command line parameter corresponding to the application version of the terminal device preset in the boot image file during the kernel loading stage of the terminal device; closes the log according to the first command line parameter Serial port; when it is necessary to obtain the debug log, refresh the boot boot image file, and analyze the second command line parameter corresponding to the terminal device debugging version in the refreshed boot boot image file; open the serial port according to the second command line parameter to obtain The debug log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

为达上述目的,本申请第三方面实施例提出了一种终端设备,包括以下一个或多个组件:处理器,存储器,电源电路,多媒体组件,音频组件,输入/输出(I/O)的接口,传感器组件,以及通信组件;其中,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上;所述电源电路,用于为所述移动终端的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行以下步骤:To achieve the above purpose, the embodiment of the third aspect of the present application proposes a terminal device, including one or more of the following components: processor, memory, power supply circuit, multimedia component, audio component, input/output (I/O) interface, sensor components, and communication components; wherein, the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used for Powering each circuit or device of the mobile terminal; the memory is used to store executable program code; the processor reads the executable program code stored in the memory to run the program corresponding to the executable program code program to perform the following steps:

在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;In the kernel loading phase of the terminal device, parsing the first command line parameter corresponding to the application version of the terminal device preset in the boot image file;

根据所述第一命令行参数关闭串口;closing the serial port according to the first command line parameter;

当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;When it is necessary to obtain the debugging log, refresh the boot boot image file, and analyze the second command line parameter corresponding to the terminal device debugging version in the boot boot mirror file after the refresh;

根据所述第二命令行参数打开串口获取所述调试日志。Opening a serial port according to the second command line parameter to obtain the debugging log.

本申请实施例的终端设备,通过在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;根据所述第一命令行参数关闭串口;当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。The terminal device of the embodiment of the present application analyzes the first command line parameter corresponding to the application version of the terminal device preset in the boot image file during the kernel loading stage of the terminal device; closes the serial port according to the first command line parameter; When it is necessary to obtain the debug log, refresh the boot boot image file, analyze the refreshed boot boot image file and the second command line parameter corresponding to the terminal device debugging version; open the serial port according to the second command line parameter to obtain the debug log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

附图说明Description of drawings

本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and easy to understand from the following description of the embodiments in conjunction with the accompanying drawings, wherein:

图1是本申请一个实施例的调试日志获取方法的流程图;Fig. 1 is the flow chart of the debug log acquisition method of one embodiment of the present application;

图2是本申请另一个实施例的调试日志获取方法的流程图;Fig. 2 is the flow chart of the debugging log obtaining method of another embodiment of the present application;

图3为调试日志获取方法的流程框图;Fig. 3 is a flowchart of a method for obtaining a debug log;

图4是本申请一个实施例的调试日志获取装置的结构示意图;FIG. 4 is a schematic structural diagram of a debugging log acquisition device according to an embodiment of the present application;

图5是本申请另一个实施例的调试日志获取装置的结构示意图;FIG. 5 is a schematic structural diagram of a debugging log acquisition device according to another embodiment of the present application;

图6是本申请一个实施例的终端设备的结构示意图。Fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.

具体实施方式Detailed ways

下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。Embodiments of the present application are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary, and are intended to explain the present application, and should not be construed as limiting the present application.

下面参考附图描述本申请实施例的调试日志获取方法、装置及终端设备。The debugging log acquisition method, device, and terminal device according to the embodiments of the present application are described below with reference to the accompanying drawings.

图1是本申请一个实施例的调试日志获取方法的流程图。Fig. 1 is a flow chart of a method for acquiring debug logs according to an embodiment of the present application.

如图1所示,该调试日志获取方法包括:As shown in Figure 1, the methods for obtaining debug logs include:

步骤101,在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数。Step 101, in the kernel loading stage of the terminal device, parse the first command line parameter corresponding to the application version of the terminal device preset in the boot image file.

步骤102,根据所述第一命令行参数关闭串口。Step 102, close the serial port according to the first command line parameter.

具体地,本实施例提供的调试日志获取方法被配置具有操作系统的终端设备中执行。需要注意的是,终端设备的类型很多,可以根据应用需要进行选择,例如:手机、平板电脑、智能手表等。Specifically, the debugging log acquisition method provided in this embodiment is executed on a terminal device configured with an operating system. It should be noted that there are many types of terminal devices, which can be selected according to application needs, such as mobile phones, tablet computers, smart watches, etc.

对于终端设备在运行过程中出现的问题,都是通过串口获取调试日志后,对调试日志进行分析来解决问题的。然而,当串口打开后,虽然可以获取调试日志,但是大大增加了开机时间。因此,为了减少终端设备的开机时间,在终端设备的发布版本中对串口进行关闭。For the problems that occur during the operation of the terminal equipment, after obtaining the debugging logs through the serial port, analyze the debugging logs to solve the problems. However, when the serial port is opened, although the debug log can be obtained, it greatly increases the boot time. Therefore, in order to reduce the startup time of the terminal device, the serial port is closed in the release version of the terminal device.

但是,一旦终端设备出现运行问题,由于串口关闭,也无法获取调试日志进行分析。如果通过刷新内核文件的方式来打开串口获取调试日志,整个内核处理过程会一直占用内存空间。例如:However, once the terminal device has a running problem, the debug log cannot be obtained for analysis because the serial port is closed. If you open the serial port to obtain the debug log by refreshing the kernel file, the entire kernel processing process will always occupy memory space. E.g:

对于不开机的终端设备通过重刷内核镜像,会导致内存被占用,无法准确分析问题现象。由此,本实施例提供的调试日志获取方法通过在开机引导阶段(内核阶段之前)的开机引导镜像文件中设置命令行参数,以区分终端设备的调试版本与发布版本。For terminal devices that are not powered on, reflashing the kernel image will cause the memory to be occupied, and the problem cannot be accurately analyzed. Therefore, the debug log acquisition method provided by this embodiment distinguishes the debug version and the release version of the terminal device by setting command line parameters in the boot image file in the boot phase (before the kernel phase).

进而利用命令行参数从开机引导阶段(内核之前)传递到内核阶段时不会随之消失,但是开机引导镜像文件会在系统运行内核后,从内存消失(即不占用内存)的特点,内核根据此值来控制串口的打开与关闭,以期达到减少终端设备开机时间同时自如抓取日志信息的目标。具体包括如下步骤:Furthermore, the command line parameters will not disappear when they are passed from the boot stage (before the kernel) to the kernel stage, but the boot image file will disappear from the memory after the system runs the kernel (that is, it does not occupy memory). This value is used to control the opening and closing of the serial port, in order to achieve the goal of reducing the boot time of the terminal device and grabbing log information freely. Specifically include the following steps:

为了在终端设备正常运行时关闭串口,并且在运行出现问题时打开串口,在编译开机引导镜像文件时,设置与编译选项值对应的命令行参数,例如:In order to close the serial port when the terminal device is running normally, and open the serial port when there is a problem with the operation, when compiling the boot image file, set the command line parameters corresponding to the compilation option values, for example:

当编译选项值为终端设备应用版本时,设置与终端设备应用版本对应的第一命令行参数,其中,第一命令行参数用于指示关闭串口。When the compilation option value is the terminal device application version, set the first command line parameter corresponding to the terminal device application version, wherein the first command line parameter is used to instruct closing the serial port.

当编译选项值为终端设备编译版本时,设置与所述终端设备编译版本对应的第二命令行参数,其中,第二命令行参数用于指示打开串口。When the compilation option value is a compiled version of the terminal device, a second command line parameter corresponding to the compiled version of the terminal device is set, wherein the second command line parameter is used to instruct to open the serial port.

针对终端设备的应用版本,在开机引导阶段结束后进入内核加载阶段时,开机引导镜像文件中与终端设备应用版本对应的第一命令行参数传递到内核阶段。For the application version of the terminal device, when entering the kernel loading phase after the booting phase, the first command line parameter corresponding to the application version of the terminal device in the booting image file is passed to the kernel phase.

进而,内核解析该第一命令行参数,并根据该第一命令行参数关闭串口,从而阻止调试日志信息通过串口输出,节约了开机时间。Furthermore, the kernel parses the first command line parameter, and closes the serial port according to the first command line parameter, thereby preventing the debugging log information from being output through the serial port, saving booting time.

步骤103,当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数。Step 103, when it is necessary to obtain the debugging log, refresh the boot image file, and analyze the second command line parameter corresponding to the debug version of the terminal device in the refreshed boot image file.

步骤104,根据所述第二命令行参数打开串口获取所述调试日志。Step 104, open a serial port according to the second command line parameter to obtain the debugging log.

具体地,当终端设备的应用版本在运行过程中出现问题时,需要获取调试日志对问题进行分析。此时,刷新开机引导镜像文件,即获取预先设置在开机引导镜像文件中与调试版本对应的用于打开串口的第二命令行参数。Specifically, when a problem occurs during the running of the application version of the terminal device, it is necessary to obtain debug logs to analyze the problem. At this time, refresh the boot image file, that is, obtain the second command line parameter for opening the serial port that is preset in the boot image file and corresponds to the debugging version.

针对终端设备刷新后与终端设备调试版本对应的开机引导镜像文件,在开机引导阶段结束后进入内核加载阶段时,开机引导镜像文件中与终端设备调试版本对应的第二命令行参数传递到内核阶段。For the boot boot image file corresponding to the debug version of the terminal device after the terminal device is refreshed, when entering the kernel loading phase after the boot boot phase ends, the second command line parameter corresponding to the debug version of the terminal device in the boot boot image file is passed to the kernel phase .

进而,内核解析该第二命令行参数,并根据该第二命令行参数打开串口,从而使调试日志信息通过串口输出,获取调试日志信息,以对出现的问题进行分析。Furthermore, the kernel parses the second command line parameter, and opens the serial port according to the second command line parameter, so that the debugging log information is output through the serial port, and the debugging log information is obtained to analyze the problem that occurs.

本申请实施例的调试日志获取方法,在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数,根据所述第一命令行参数关闭串口,当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数,根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。The debug log acquisition method of the embodiment of the present application, in the kernel loading stage of the terminal device, parses the first command line parameter corresponding to the application version of the terminal device preset in the boot image file, and closes the serial port according to the first command line parameter , when it is necessary to obtain the debugging log, refresh the boot boot image file, analyze the second command line parameter corresponding to the terminal device debugging version in the refreshed boot boot image file, and open the serial port according to the second command line parameter to obtain the Described debug log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

图2是本申请另一个实施例的调试日志获取方法的流程图。Fig. 2 is a flow chart of a method for acquiring debug logs according to another embodiment of the present application.

如图2所示,该调试日志获取方法包括:As shown in Figure 2, the methods for obtaining debug logs include:

步骤201,在编译所述开机引导镜像文件的过程中,设置与编译选项值对应的命令行参数。Step 201, during the process of compiling the boot image file, set command line parameters corresponding to the compiling option values.

具体地,为了在终端设备正常运行时关闭串口,并且在运行出现问题时打开串口,在编译开机引导镜像文件时,设置与编译选项值对应的命令行参数,例如:Specifically, in order to close the serial port when the terminal device is running normally, and open the serial port when there is a problem with the operation, when compiling the boot image file, set the command line parameters corresponding to the compilation option values, for example:

当编译选项值为终端设备应用版本时,设置与终端设备应用版本对应的第一命令行参数,其中,第一命令行参数用于指示关闭串口。When the compilation option value is the terminal device application version, set the first command line parameter corresponding to the terminal device application version, wherein the first command line parameter is used to instruct closing the serial port.

当编译选项值为终端设备编译版本时,设置与所述终端设备编译版本对应的第二命令行参数,其中,第二命令行参数用于指示打开串口。When the compilation option value is a compiled version of the terminal device, a second command line parameter corresponding to the compiled version of the terminal device is set, wherein the second command line parameter is used to instruct to open the serial port.

步骤202,在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数。Step 202, in the kernel loading stage of the terminal device, parse the first command line parameter corresponding to the application version of the terminal device preset in the boot image file.

步骤203,根据所述第一命令行参数将全局变量值初始化为第一状态;Step 203, initialize the global variable value to the first state according to the first command line parameter;

步骤204,当所述串口驱动时,调用与所述第一状态对应的第一功能函数关闭所述串口。Step 204, when the serial port is driven, call a first function corresponding to the first state to close the serial port.

具体地,针对终端设备的应用版本,在开机引导阶段结束后进入内核加载阶段时,开机引导镜像文件中与终端设备应用版本对应的第一命令行参数传递到内核阶段。内核解析该第一命令行参数,并根据该第一命令行参数将全局变量值初始化为第一状态。Specifically, for the application version of the terminal device, when entering the kernel loading phase after the booting phase ends, the first command line parameter corresponding to the application version of the terminal device in the booting image file is passed to the kernel phase. The kernel parses the first command line parameter, and initializes the global variable value to a first state according to the first command line parameter.

进而,当对串口进行驱动时,调用预设的与该第一状态对应的第一功能函数关闭串口,从而阻止调试日志信息通过串口输出,节约了开机时间。Furthermore, when the serial port is driven, the preset first function corresponding to the first state is invoked to close the serial port, thereby preventing the debugging log information from being output through the serial port and saving the boot time.

步骤205,当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数。Step 205, when it is necessary to obtain the debugging log, refresh the boot boot image file, and analyze the second command line parameter corresponding to the debug version of the terminal device in the refreshed boot boot image file.

步骤206,根据所述第二命令行参数将全局变量值初始化为第二状态。Step 206, initialize the global variable value to the second state according to the second command line parameter.

步骤207,当所述串口驱动时,调用与所述第二状态对应的第二功能函数打开所述串口,获取所述调试日志。Step 207, when the serial port is driven, call a second function corresponding to the second state to open the serial port, and acquire the debugging log.

当终端设备的应用版本在运行过程中出现问题时,需要获取调试日志对问题进行分析。此时,刷新开机引导镜像文件,即获取预先设置在开机引导镜像文件中与调试版本对应的用于打开串口的第二命令行参数。When the application version of the terminal device has a problem during operation, it is necessary to obtain the debug log to analyze the problem. At this time, refresh the boot image file, that is, obtain the second command line parameter for opening the serial port that is preset in the boot image file and corresponds to the debugging version.

针对终端设备刷新后与终端设备调试版本对应的开机引导镜像文件,在开机引导阶段结束后进入内核加载阶段时,开机引导镜像文件中与终端设备调试版本对应的第二命令行参数传递到内核阶段。内核解析该第二命令行参数,根据所述第二命令行参数将全局变量值初始化为第二状态。For the boot boot image file corresponding to the debug version of the terminal device after the terminal device is refreshed, when entering the kernel loading phase after the boot boot phase ends, the second command line parameter corresponding to the debug version of the terminal device in the boot boot image file is passed to the kernel phase . The kernel parses the second command line parameter, and initializes the global variable value to a second state according to the second command line parameter.

进而,当对串口进行驱动时,调用预设的与该第二状态对应的第二功能函数打开串口,从而使调试日志信息通过串口输出,获取调试日志信息,以对出现的问题进行分析。Furthermore, when the serial port is driven, the preset second function corresponding to the second state is called to open the serial port, so that the debugging log information is output through the serial port, and the debugging log information is obtained to analyze the problems that occur.

需要说明的是,上述实施例中涉及的第一命令行参数、第二命令行参数、全局变量值的第一状态和第二状态、以及第一功能函数和第二功能函数,可以根据实际应用需要进行设置,本实施例对此不作限制。为了更加清楚的描述上述实施过程,通过图3所示实施例对上述概念进行说明。It should be noted that the first command line parameter, the second command line parameter, the first state and the second state of the global variable value, and the first function function and the second function function involved in the above-mentioned embodiment can be based on the actual application It needs to be set, which is not limited in this embodiment. In order to describe the above implementation process more clearly, the above concepts are illustrated through the embodiment shown in FIG. 3 .

图3为调试日志获取方法的流程框图,参见图3,本实施例中的第一命令行参数为disable.uart=1、第二命令行参数disable.uart=0、全局变量enable_uart值的第一状态为1,第二状态为1。获取调试日志的具体步骤包括:Fig. 3 is the block flow diagram of debugging log acquisition method, referring to Fig. 3, the first command line parameter in the present embodiment is disable.uart=1, the second command line parameter disable.uart=0, the first value of global variable enable_uart The state is 1 and the second state is 1. The specific steps to obtain the debug log include:

步骤1:在开机引导镜像文件的中,当编译选项值为应用版本release时,设置对应的第一命令行参数为disable.uart=1(名称任意),当编译选项值为调试版本debug时,设置对应的第二命令行参数为disable.uart=0。Step 1: In the boot image file, when the compilation option value is the application version release, set the corresponding first command line parameter to disable.uart=1 (any name), when the compilation option value is the debug version debug, Set the corresponding second command line parameter to disable.uart=0.

步骤2:内核在串口初始化之前获取第一命令行参数disable.uart=1,根据第一命令行参数初始化一个全局变量enable_uart为1。Step 2: The kernel obtains the first command line parameter disable.uart=1 before serial port initialization, and initializes a global variable enable_uart to 1 according to the first command line parameter.

步骤3:在串口驱动中根据enable_uart为1调用第一功能函数对串口进行关闭。Step 3: In the serial port driver, according to enable_uart being 1, call the first function to close the serial port.

步骤4:需要获取调试日志时,通过重刷开机引导镜像文件中的第二命令行参数disable.uart=0。内核在串口初始化之前获取第二命令行参数disable.uart=0,根据第二命令行参数初始化一个全局变量enable_uart为1。Step 4: When it is necessary to obtain the debug log, reset the second command line parameter disable.uart=0 in the boot image file. The kernel obtains the second command line parameter disable.uart=0 before serial port initialization, and initializes a global variable enable_uart to 1 according to the second command line parameter.

步骤5:在串口驱动中根据enable_uart为0调用第二功能函数对串口进行打开,即可通过串口获取所需日志。Step 5: In the serial port driver, according to enable_uart is 0, call the second function to open the serial port, and the required logs can be obtained through the serial port.

本申请实施例的调试日志获取方法,在编译所述开机引导镜像文件的过程中,设置与编译选项值对应的命令行参数,在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数,根据所述第一命令行参数关闭串口,当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数,根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。In the debugging log acquisition method of the embodiment of the present application, in the process of compiling the boot boot image file, the command line parameters corresponding to the compilation option value are set, and in the kernel loading stage of the terminal device, the parsing is preset in the boot boot mirror file According to the first command line parameter corresponding to the application version of the terminal device, the serial port is closed according to the first command line parameter, and when the debugging log needs to be obtained, the boot boot image file is refreshed, and the refreshed boot boot mirror image file is analyzed and compared with the terminal The second command line parameter corresponding to the debugging version of the device, and opening a serial port according to the second command line parameter to obtain the debugging log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

为了实现上述实施例,本申请还提出一种调试日志获取装置。In order to realize the foregoing embodiments, the present application further proposes a debugging log acquisition device.

图4是本申请一个实施例的调试日志获取装置的结构示意图。Fig. 4 is a schematic structural diagram of an apparatus for acquiring debug logs according to an embodiment of the present application.

如图4所示,该调试日志获取装置包括:As shown in Figure 4, the debug log acquisition device includes:

第一解析模块11,用于在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;The first parsing module 11 is used for parsing the first command line parameter corresponding to the application version of the terminal device preset in the boot image file during the kernel loading phase of the terminal device;

第一处理模块12,用于根据所述第一命令行参数关闭串口;The first processing module 12 is configured to close the serial port according to the first command line parameter;

刷新模块13,用于当需要获取调试日志时,刷新所述开机引导镜像文件;Refresh module 13, for when needing to obtain debug log, refresh described power-on guide image file;

第二解析模块14,用于解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;The second parsing module 14 is used for parsing the second command line parameters corresponding to the terminal device debugging version in the boot image file after refreshing;

第二处理模块15,用于根据所述第二命令行参数打开串口获取所述调试日志。The second processing module 15 is configured to open a serial port to obtain the debugging log according to the second command line parameter.

需要说明的是,前述对调试日志获取方法实施例的解释说明也适用于该实施例的调试日志获取装置,此处不再赘述。It should be noted that, the foregoing explanations on the embodiment of the debugging log acquisition method are also applicable to the debugging log acquisition device of this embodiment, which will not be repeated here.

本申请实施例的调试日志获取装置,在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数,根据所述第一命令行参数关闭串口,当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数,根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。The debug log acquisition device of the embodiment of the present application, in the kernel loading stage of the terminal device, parses the first command line parameter corresponding to the application version of the terminal device preset in the boot image file, and closes the serial port according to the first command line parameter , when it is necessary to obtain the debugging log, refresh the boot boot image file, analyze the second command line parameter corresponding to the terminal device debugging version in the refreshed boot boot image file, and open the serial port according to the second command line parameter to obtain the Described debug log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

图5是本申请另一个实施例的调试日志获取装置的结构示意图。Fig. 5 is a schematic structural diagram of an apparatus for acquiring debug logs according to another embodiment of the present application.

如图5所示,基于图4所示实施例,所述装置还包括:As shown in Figure 5, based on the embodiment shown in Figure 4, the device further includes:

设置模块16,用于在编译所述开机引导镜像文件的过程中,设置与编译选项值对应的命令行参数。The setting module 16 is used to set the command line parameters corresponding to the compilation option values during the process of compiling the boot image file.

具体地,所述设置模块16用于:Specifically, the setting module 16 is used for:

当所述编译选项值为终端设备应用版本时,设置与所述终端设备应用版本对应的第一命令行参数;When the compilation option value is a terminal device application version, setting a first command line parameter corresponding to the terminal device application version;

当所述编译选项值为终端设备编译版本时,设置与所述终端设备编译版本对应的第二命令行参数。When the compilation option value is a compiled version of the terminal device, a second command line parameter corresponding to the compiled version of the terminal device is set.

进一步地,在一个实施例中,所述第一处理模块12,包括:Further, in one embodiment, the first processing module 12 includes:

第一初始化单元121,用于根据所述第一命令行参数将全局变量值初始化为第一状态;The first initialization unit 121 is configured to initialize the global variable value to a first state according to the first command line parameter;

第一调用单元122,用于当所述串口驱动时,调用与所述第一状态对应的第一功能函数关闭所述串口。The first calling unit 122 is configured to call a first function corresponding to the first state to close the serial port when the serial port is driven.

进一步地,在一个实施例中,所述第二处理模块15,包括:Further, in one embodiment, the second processing module 15 includes:

第二初始化单元151,用于根据所述第二命令行参数将全局变量值初始化为第二状态;The second initialization unit 151 is configured to initialize the global variable value to a second state according to the second command line parameter;

第二调用单元152,用于当所述串口驱动时,调用与所述第二状态对应的第二功能函数打开所述串口,获取所述调试日志。The second calling unit 152 is configured to call a second function corresponding to the second state to open the serial port and obtain the debugging log when the serial port is driven.

需要说明的是,前述对调试日志获取方法实施例的解释说明也适用于该实施例的调试日志获取装置,此处不再赘述。It should be noted that, the foregoing explanations on the embodiment of the debugging log acquisition method are also applicable to the debugging log acquisition device of this embodiment, which will not be repeated here.

本申请实施例的调试日志获取装置,在编译所述开机引导镜像文件的过程中,设置与编译选项值对应的命令行参数,在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数,根据所述第一命令行参数关闭串口,当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数,根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。The debug log acquisition device of the embodiment of the present application, in the process of compiling the boot boot image file, sets the command line parameters corresponding to the compilation option value, and parses the presets in the boot boot image file during the kernel loading stage of the terminal device According to the first command line parameter corresponding to the application version of the terminal device, the serial port is closed according to the first command line parameter, and when the debugging log needs to be obtained, the boot boot image file is refreshed, and the refreshed boot boot mirror image file is analyzed and compared with the terminal The second command line parameter corresponding to the debugging version of the device, and opening a serial port according to the second command line parameter to obtain the debugging log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

为了实现上述实施例,本申请还提出一种调试日志获取装置。In order to realize the foregoing embodiments, the present application further proposes a debugging log acquisition device.

图6是本申请一个实施例的终端设备的结构示意图。例如,终端设备1000可以是移动电话等。Fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application. For example, the terminal device 1000 may be a mobile phone or the like.

参见图6,终端设备1000可以包括以下一个或多个组件:处理器1001,存储器1002,电源电路1003,多媒体组件1004,音频组件1005,输入/输出(I/O)的接口1006,传感器组件1007,以及通信组件1008。6, terminal device 1000 may include one or more of the following components: processor 1001, memory 1002, power circuit 1003, multimedia component 1004, audio component 1005, input/output (I/O) interface 1006, sensor component 1007 , and a communication component 1008 .

所述电源电路1003,用于为所述移动终端的各个电路或器件供电;所述存储器1002用于存储可执行程序代码;所述处理器1001通过读取所述存储器1002中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行以下步骤:The power supply circuit 1003 is used to supply power to various circuits or devices of the mobile terminal; the memory 1002 is used to store executable program codes; the processor 1001 reads the executable program stored in the memory 1002 code to run a program corresponding to the executable program code for performing the following steps:

在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;In the kernel loading phase of the terminal device, parsing the first command line parameter corresponding to the application version of the terminal device preset in the boot image file;

根据所述第一命令行参数关闭串口;closing the serial port according to the first command line parameter;

当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;When it is necessary to obtain the debugging log, refresh the boot boot image file, and analyze the second command line parameter corresponding to the terminal device debugging version in the boot boot mirror file after the refresh;

根据所述第二命令行参数打开串口获取所述调试日志。Opening a serial port according to the second command line parameter to obtain the debugging log.

需要说明的是,前述对调试日志获取方法实施例的解释说明也适用于该实施例的终端设备,其实现原理类似,此处不再赘述。It should be noted that the foregoing explanations on the embodiment of the debugging log acquisition method are also applicable to the terminal device in this embodiment, and the implementation principles thereof are similar, so details are not repeated here.

本申请实施例的终端设备,在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数,根据所述第一命令行参数关闭串口,当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数,根据所述第二命令行参数打开串口获取所述调试日志。由此,实现了在减少终端设备开机时间的同时,可以根据应用需要获取调试日志信息。In the terminal device of the embodiment of the present application, in the kernel loading stage of the terminal device, the first command line parameter corresponding to the application version of the terminal device preset in the boot image file is parsed, and the serial port is closed according to the first command line parameter, when When it is necessary to obtain the debugging log, refresh the boot boot image file, analyze the second command line parameter corresponding to the debug version of the terminal device in the refreshed boot boot image file, and open the serial port to obtain the debug log according to the second command line parameter. log. In this way, while reducing the startup time of the terminal device, debugging log information can be obtained according to application requirements.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific examples", or "some examples" mean that specific features described in connection with the embodiment or example , structure, material or characteristic is included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the described specific features, structures, materials or characteristics may be combined in any suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples and features of different embodiments or examples described in this specification without conflicting with each other.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In the description of the present application, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions in flowcharts or otherwise described herein may be understood to represent modules, segments or portions of code comprising one or more executable instructions for implementing specific logical functions or steps of the process , and the scope of preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in substantially simultaneous fashion or in reverse order depending on the functions involved, which shall It should be understood by those skilled in the art to which the embodiments of the present application belong.

在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium, For use with instruction execution systems, devices, or devices (such as computer-based systems, systems including processors, or other systems that can fetch instructions from instruction execution systems, devices, or devices and execute instructions), or in conjunction with these instruction execution systems, devices or equipment used. For the purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use in or in conjunction with an instruction execution system, device or device. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection with one or more wires (electronic device), portable computer disk case (magnetic device), random access memory (RAM), Read Only Memory (ROM), Erasable and Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, since the program can be read, for example, by optically scanning the paper or other medium, followed by editing, interpretation or other suitable processing if necessary. The program is processed electronically and stored in computer memory.

应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that each part of the present application may be realized by hardware, software, firmware or a combination thereof. In the embodiments described above, various steps or methods may be implemented by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques known in the art: Discrete logic circuits, ASICs with suitable combinational logic gates, Programmable Gate Arrays (PGAs), Field Programmable Gate Arrays (FPGAs), etc.

Claims (7)

1.一种调试日志获取方法,其特征在于,包括以下步骤:1. A debug log acquisition method, characterized in that, comprising the following steps: 在编译开机引导镜像文件的过程中,设置与编译选项值对应的命令行参数,其中,所述设置与编译选项值对应的命令行参数,包括:当所述编译选项值为终端设备应用版本时,设置与所述终端设备应用版本对应的第一命令行参数;当所述编译选项值为终端设备调试版本时,设置与所述终端设备调试版本对应的第二命令行参数;In the process of compiling the boot image file, set the command line parameters corresponding to the compilation option value, wherein the setting of the command line parameters corresponding to the compilation option value includes: when the compilation option value is the terminal device application version , setting a first command line parameter corresponding to the terminal device application version; when the compilation option value is a terminal device debugging version, setting a second command line parameter corresponding to the terminal device debugging version; 在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;In the kernel loading phase of the terminal device, parsing the first command line parameter corresponding to the application version of the terminal device preset in the boot image file; 根据所述第一命令行参数关闭串口;closing the serial port according to the first command line parameter; 当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;When it is necessary to obtain the debugging log, refresh the boot boot image file, and analyze the second command line parameter corresponding to the terminal device debugging version in the boot boot mirror file after the refresh; 根据所述第二命令行参数打开串口获取所述调试日志。Opening a serial port according to the second command line parameter to obtain the debugging log. 2.如权利要求1所述的方法,其特征在于,所述根据所述第一命令行参数关闭串口,包括:2. The method according to claim 1, wherein said closing the serial port according to the first command line parameter comprises: 根据所述第一命令行参数将全局变量值初始化为第一状态;initializing global variable values to a first state according to the first command line parameter; 当所述串口驱动时,调用与所述第一状态对应的第一功能函数关闭所述串口。When the serial port is driven, call the first function corresponding to the first state to close the serial port. 3.如权利要求1所述的方法,其特征在于,所述根据所述第二命令行参数打开串口获取所述调试日志,包括:3. The method according to claim 1, wherein said opening a serial port according to said second command line parameter to obtain said debugging log comprises: 根据所述第二命令行参数将全局变量值初始化为第二状态;initializing the global variable value to a second state according to the second command line parameter; 当所述串口驱动时,调用与所述第二状态对应的第二功能函数打开所述串口,获取所述调试日志。When the serial port is driven, call a second function corresponding to the second state to open the serial port and obtain the debugging log. 4.一种调试日志获取装置,其特征在于,包括:4. A debugging log acquisition device, characterized in that, comprising: 设置模块,用于在编译开机引导镜像文件的过程中,设置与编译选项值对应的命令行参数,其中,所述设置模块用于:当所述编译选项值为终端设备应用版本时,设置与所述终端设备应用版本对应的第一命令行参数;当所述编译选项值为终端设备调试版本时,设置与所述终端设备调试版本对应的第二命令行参数;The setting module is used to set the command line parameters corresponding to the compilation option value during the process of compiling the boot image file, wherein the setting module is used to: when the compilation option value is the terminal device application version, set the The first command line parameter corresponding to the application version of the terminal device; when the compilation option value is a terminal device debugging version, setting the second command line parameter corresponding to the terminal device debugging version; 第一解析模块,用于在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;The first parsing module is used to parse the first command line parameter corresponding to the application version of the terminal device preset in the boot image file during the kernel loading phase of the terminal device; 第一处理模块,用于根据所述第一命令行参数关闭串口;A first processing module, configured to close the serial port according to the first command line parameter; 刷新模块,用于当需要获取调试日志时,刷新所述开机引导镜像文件;A refresh module, configured to refresh the boot image file when debugging logs need to be obtained; 第二解析模块,用于解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;The second parsing module is used for parsing the second command line parameters corresponding to the debug version of the terminal device in the refreshed boot image file; 第二处理模块,用于根据所述第二命令行参数打开串口获取所述调试日志。The second processing module is configured to open a serial port to obtain the debugging log according to the second command line parameter. 5.如权利要求4所述的装置,其特征在于,所述第一处理模块,包括:5. The device according to claim 4, wherein the first processing module comprises: 第一初始化单元,用于根据所述第一命令行参数将全局变量值初始化为第一状态;a first initialization unit, configured to initialize global variable values to a first state according to the first command line parameter; 第一调用单元,用于当所述串口驱动时,调用与所述第一状态对应的第一功能函数关闭所述串口。A first calling unit, configured to call a first function corresponding to the first state to close the serial port when the serial port is driven. 6.如权利要求4所述的装置,其特征在于,所述第二处理模块,包括:6. The device according to claim 4, wherein the second processing module comprises: 第二初始化单元,用于根据所述第二命令行参数将全局变量值初始化为第二状态;a second initialization unit, configured to initialize the global variable value to a second state according to the second command line parameter; 第二调用单元,用于当所述串口驱动时,调用与所述第二状态对应的第二功能函数打开所述串口,获取所述调试日志。The second calling unit is configured to call a second function corresponding to the second state to open the serial port and obtain the debugging log when the serial port is driven. 7.一种终端设备,其特征在于,包括以下一个或多个组件:处理器,存储器,电源电路,多媒体组件,音频组件,输入/输出(I/O)的接口,传感器组件,以及通信组件;其中,电路板安置在壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上;所述电源电路,用于为所述终端设备的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行以下步骤:7. A terminal device, characterized in that it includes one or more of the following components: processor, memory, power circuit, multimedia component, audio component, input/output (I/O) interface, sensor component, and communication component ; Wherein, the circuit board is placed inside the space surrounded by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to each circuit or device of the terminal device; The memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to perform the following steps: 在编译开机引导镜像文件的过程中,设置与编译选项值对应的命令行参数,其中,所述设置与编译选项值对应的命令行参数,包括:当所述编译选项值为终端设备应用版本时,设置与所述终端设备应用版本对应的第一命令行参数;当所述编译选项值为终端设备调试版本时,设置与所述终端设备调试版本对应的第二命令行参数;In the process of compiling the boot image file, set the command line parameters corresponding to the compilation option value, wherein the setting of the command line parameters corresponding to the compilation option value includes: when the compilation option value is the terminal device application version , setting a first command line parameter corresponding to the terminal device application version; when the compilation option value is a terminal device debugging version, setting a second command line parameter corresponding to the terminal device debugging version; 在终端设备的内核加载阶段,解析预设在开机引导镜像文件中与终端设备应用版本对应的第一命令行参数;In the kernel loading phase of the terminal device, parsing the first command line parameter corresponding to the application version of the terminal device preset in the boot image file; 根据所述第一命令行参数关闭串口;closing the serial port according to the first command line parameter; 当需要获取调试日志时,刷新所述开机引导镜像文件,解析刷新后的开机引导镜像文件中与终端设备调试版本对应的第二命令行参数;When it is necessary to obtain the debugging log, refresh the boot boot image file, and analyze the second command line parameter corresponding to the terminal device debugging version in the boot boot mirror file after the refresh; 根据所述第二命令行参数打开串口获取所述调试日志。Opening a serial port according to the second command line parameter to obtain the debugging log.
CN201610150781.1A 2016-03-16 2016-03-16 Debugging log obtaining method and device and terminal equipment Expired - Fee Related CN105824669B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610150781.1A CN105824669B (en) 2016-03-16 2016-03-16 Debugging log obtaining method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610150781.1A CN105824669B (en) 2016-03-16 2016-03-16 Debugging log obtaining method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN105824669A CN105824669A (en) 2016-08-03
CN105824669B true CN105824669B (en) 2018-02-06

Family

ID=56523860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610150781.1A Expired - Fee Related CN105824669B (en) 2016-03-16 2016-03-16 Debugging log obtaining method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN105824669B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704380A (en) * 2017-07-26 2018-02-16 深圳天珑无线科技有限公司 Mobile terminal adjustment method, device and storage medium
CN109147821A (en) * 2018-08-20 2019-01-04 Oppo广东移动通信有限公司 Intelligent terminal audio detection method, electronic device and computer-readable storage medium
CN109274758B (en) * 2018-10-17 2021-05-18 北京龙之心科技有限公司 Request message processing method and computing device
CN110515853A (en) * 2019-08-30 2019-11-29 苏州浪潮智能科技有限公司 A dual serial port debugging method and device
CN111414299B (en) * 2020-03-26 2023-06-06 深圳忆联信息系统有限公司 SSD (solid State disk) extension information acquisition method and device based on hdchart
CN111897569B (en) * 2020-07-13 2024-04-16 深圳市亿道数码技术有限公司 Processing method and system for mobile terminal configuration device based on MTK platform
CN112000379A (en) * 2020-08-06 2020-11-27 北京浪潮数据技术有限公司 BIOS setup interface access control equipment, method and related components
CN113986806B (en) * 2021-11-03 2022-08-02 厦门市美亚柏科信息股份有限公司 GOIP high-speed evidence obtaining method and system based on serial port and network port and storage medium
CN114416543A (en) * 2022-01-06 2022-04-29 昆明闻泰通讯有限公司 Serial port processing method, device, equipment and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9355265B2 (en) * 2010-03-25 2016-05-31 Dell Products, Lp Computer data protection lock
CN104461953A (en) * 2014-12-31 2015-03-25 厦门雅迅网络股份有限公司 Method and system for carrying out linux log management through virtual serial port

Also Published As

Publication number Publication date
CN105824669A (en) 2016-08-03

Similar Documents

Publication Publication Date Title
CN105824669B (en) Debugging log obtaining method and device and terminal equipment
US10846101B2 (en) Method and system for starting up application
WO2015055074A1 (en) Method and device for dynamically loading and invoking program
CN109889875B (en) Communication method, communication device, terminal equipment and computer readable medium
CN111124713B (en) Equipment system function calling method, device, terminal equipment and storage medium
US20120297178A1 (en) Configuration mode switching system and method
WO2020001112A1 (en) Application method for platform supporting multiple types of devices, and mobile terminal
CN115658160B (en) Multi-operating system upgrading method, device and system based on multi-core heterogeneous SOC
EP4345611A1 (en) Bootloader loading method, apparatus and system, electronic device and medium
CN105739961A (en) Starting method and device of embedded system
WO2015074526A1 (en) Method and apparatus for injecting java by tecode into target process
US10318731B2 (en) Detection system and detection method
CN105205142A (en) Method, device and mobile terminal for saving log file
CN105117255A (en) Boot method and apparatus for BootLoader program
CN106649098A (en) Method and device for achieving version-release-software debugging on terminal device
CN116009921A (en) Embedded operating system upgrade method, device and medium thereof
WO2016023520A1 (en) Method and device for recognizing application causing temperature rise of terminal, and terminal
CN111708548A (en) Software installation method, device, equipment and storage medium
CN111930575B (en) Firmware acquisition method and device and electronic equipment
WO2023016481A1 (en) Data processing method and related apparatus
CN105824668A (en) Process control method, device and terminal equipment
CN111399926A (en) Method and device for downloading starting program
WO2019157891A1 (en) Application installation method and application installer generating method
CN108009039B (en) Terminal information recording method, device, storage medium and electronic equipment
CN116382794A (en) Code sharing method, system, device and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523859 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180206