CN110908876B - Method and device for acquiring hardware performance data - Google Patents

Method and device for acquiring hardware performance data Download PDF

Info

Publication number
CN110908876B
CN110908876B CN201811090255.6A CN201811090255A CN110908876B CN 110908876 B CN110908876 B CN 110908876B CN 201811090255 A CN201811090255 A CN 201811090255A CN 110908876 B CN110908876 B CN 110908876B
Authority
CN
China
Prior art keywords
hardware
performance data
target
process performance
acquiring
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.)
Active
Application number
CN201811090255.6A
Other languages
Chinese (zh)
Other versions
CN110908876A (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.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811090255.6A priority Critical patent/CN110908876B/en
Publication of CN110908876A publication Critical patent/CN110908876A/en
Application granted granted Critical
Publication of CN110908876B publication Critical patent/CN110908876B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F11/3409Recording 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 for performance 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

The invention discloses a method and a device for acquiring hardware performance data, which relate to the technical field of computers and mainly aim to improve the accuracy of hardware performance analysis; the main technical scheme is as follows: receiving an instruction for acquiring process performance data of target hardware; judging whether the target hardware has the function of acquiring process performance data; the process performance data is data generated by hardware in the operation process; and if so, acquiring target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction.

Description

Method and device for acquiring hardware performance data
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for acquiring hardware performance data.
Background
The software and hardware integrated product with the deep combination of hardware and software has better user experience brought to users, so that the application is more and more extensive.
At present, in order to find out the fault of the soft and hard integrated product in time, the performance of the soft and hard integrated product needs to be analyzed. When the performance of the software and hardware integrated product is analyzed, the performance of software, a CPU and a memory can be generally analyzed finely, while for a large amount of hardware bypassing the memory and the CPU, such as RDMA (remote direct memory access), only black box analysis can be performed, and the black box analysis can only obtain a performance analysis result, and performance data in a hardware process is unknown, so that the accuracy of the performance analysis of the hardware is low.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for acquiring hardware performance data, and mainly aims to improve the accuracy of hardware performance analysis.
In order to solve the above problem, in a first aspect, the present invention provides a method for acquiring hardware performance data, where the method includes:
receiving an instruction for acquiring process performance data of target hardware;
judging whether the target hardware has the function of acquiring process performance data; the process performance data is data generated by hardware in the operation process;
and if so, acquiring target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction.
In a second aspect, the present invention provides an apparatus for acquiring hardware performance data, the apparatus comprising:
the receiving module is used for receiving an instruction for acquiring process performance data of target hardware;
the judging module is used for judging whether the target hardware has the function of acquiring process performance data; the process performance data is data generated by hardware in a running process; if yes, triggering an acquisition module;
and the acquisition module is used for acquiring target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction under the trigger of the judgment module.
In a third aspect, the present invention provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device in which the storage medium is located is controlled to execute the method for acquiring hardware performance data described in any one of the foregoing items.
In a fourth aspect, the present invention provides an electronic device, including a processor, a memory, and a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to call the program instructions in the memory to execute any one of the above methods for acquiring hardware performance data.
According to the method and the device for acquiring the hardware performance data, provided by the invention, when the hardware has the function of acquiring the process performance data, the process performance data of the hardware can be acquired according to the service requirement. The process performance data of the hardware can reflect the operation process of the hardware in detail, and the performance of the hardware can be accurately analyzed based on the process performance data. Therefore, the scheme provided by the embodiment of the invention can improve the accuracy of hardware performance analysis.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for obtaining hardware performance data according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method for obtaining hardware performance data according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram illustrating an apparatus for acquiring hardware performance data according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram illustrating an apparatus for acquiring hardware performance data according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram illustrating an apparatus for acquiring hardware performance data according to yet another embodiment of the present invention;
fig. 6 is a schematic structural diagram illustrating an apparatus for acquiring hardware performance data according to yet another embodiment of the present invention;
fig. 7 is a schematic structural diagram illustrating an apparatus for acquiring hardware performance data according to yet another embodiment of the present invention;
fig. 8 is a schematic structural diagram illustrating an apparatus for acquiring hardware performance data according to yet another embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, an embodiment of the present invention provides a method for acquiring hardware performance data, where the method includes:
101. an instruction to obtain process performance data for target hardware is received.
102. Judging whether the target hardware has the function of acquiring process performance data; the process performance data is data generated by hardware in the operation process; if yes, go to step 103.
103. And acquiring target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction.
According to the embodiment shown in fig. 1, when the hardware has the function of acquiring the process performance data, the process performance data of the hardware can be acquired according to the service requirement. The process performance data of the hardware can reflect the operation process of the hardware in detail, and the performance of the hardware can be accurately analyzed based on the process performance data. Therefore, the scheme provided by the embodiment of the invention can improve the accuracy of hardware performance analysis.
In one embodiment of the present invention, the specific type of target hardware involved in the flowchart shown in fig. 1 may be determined according to business requirements. Alternatively, the target hardware may include, but is not limited to, one or more of hardware, memory, and a CPU that bypass the memory and CPU. The hardware bypassing the memory and the CPU is hardware that does not interact with the memory and the CPU, such as a high performance network card, RDMA, intelligent hardware, and the like.
In this embodiment, the hardware that bypasses the memory and the CPU may be hardware of PCI (Peripheral Component Interconnect) standard, and may also be hardware of other standards, which is not specifically limited herein.
In an embodiment of the present invention, the specific type of the instruction involved in step 101 in the flowchart shown in fig. 1 can be determined according to the business requirements. Optionally, the instruction may carry, but is not limited to, one or more of a formatting requirement, a time requirement, a performance parameter ordering requirement, and a value requirement of data corresponding to the performance parameter.
In an embodiment of the present invention, the implementation manners of determining whether the target hardware has the function of acquiring the process performance data in step 102 in the flowchart shown in fig. 1 at least include the following three manners:
first, the step 102 in the flowchart shown in fig. 1 for determining whether the target hardware has the function of acquiring process performance data may include:
judging whether the target hardware is recorded in a specified list or not, wherein the specified list is arranged at a specified position;
and if so, judging that the target hardware has the function of acquiring the process performance data.
In this embodiment, the designated location may be determined according to the service requirement. Alternatively, the designated location may include, but is not limited to, a particular location in the system where the target hardware is located, such as a hard disk, or a particular location in a separate management node.
In this embodiment, when the target hardware has the function of acquiring the process performance data, the identifier corresponding to the target hardware is recorded in the designated list, so as to inform that the target hardware has the function of acquiring the process performance data through the designated list.
In this embodiment, if it is determined that the target hardware does not have the function of acquiring the process performance data, it is continuously determined whether a hardware performance analysis tool is deployed in the target hardware; if so, recording the target hardware in a specified list; if not, whether the target hardware allows the hardware performance analysis tool to be deployed is detected. If the hardware performance analysis tool is allowed to be downloaded, the preset hardware performance analysis tool is downloaded, and the downloaded hardware performance analysis tool is deployed into the target hardware. And recording the target hardware in a specified list after the deployment is finished, and executing to obtain target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction, wherein the target process performance data is process performance data corresponding to the instruction.
Second, the step 102 in the flowchart shown in fig. 1 for determining whether the target hardware has the function of acquiring process performance data may include:
judging whether the target hardware is registered on a system where the target hardware is located or an independent management node in a plug-in mode;
and if so, judging that the target hardware has the function of acquiring the process performance data.
In this embodiment, if the target hardware is registered in the form of a plug-in on the system where the target hardware is located or on an individual management node, the system where the target hardware is located or the individual management node has an address of the target hardware. For example, when the target hardware is the PCI standard hardware, the address may be a PCI-e address, and the address may include a bus, a setting, and a function. The target hardware may be driven according to the address.
In this embodiment, if it is determined that the target hardware does not have the function of acquiring the process performance data, it is continuously determined whether a hardware performance analysis tool is deployed in the target hardware; if the target hardware is deployed, registering the target hardware on a system or an independent management node where the target hardware is located in a plug-in mode; if not, whether the target hardware allows the hardware performance analysis tool to be deployed is detected. If the target process performance data is allowed to be obtained, downloading a preset hardware performance analysis tool, deploying the downloaded hardware performance analysis tool into the target hardware, registering the downloaded hardware performance analysis tool on a system where the target hardware is located or an independent management node in a plug-in mode after deployment is completed, and executing the step of obtaining the target process performance data through the hardware performance analysis tool deployed in the target hardware according to the instruction.
Thirdly, in an embodiment of the present invention, the step 102 in the flowchart shown in fig. 1 for determining whether the target hardware has a function of acquiring process performance data may include:
judging whether the target hardware is registered on a kernel in a plug-in mode or not; wherein the kernel supports software performance analysis;
and if so, judging that the target hardware has the function of acquiring the process performance data.
In this embodiment, the kernel supports software performance analysis, and a software performance analysis framework may be deployed in the kernel, so that the kernel may support the software performance analysis.
In this embodiment, if the target hardware is registered on the kernel in the form of a plug-in, the kernel has an address of the target hardware. For example, when the target hardware is the PCI standard hardware, the address may be a PCI-e address, and the address may include a bus, a setting, and a function.
In this embodiment, if it is determined that the target hardware does not have the function of acquiring the process performance data, it is continuously determined whether a hardware performance analysis tool is deployed in the target hardware; if the deployment is carried out, registering the software on the kernel in a plug-in mode; if not, whether the target hardware allows the hardware performance analysis tool to be deployed is detected. If the target process performance data is allowed to be acquired, downloading a preset hardware performance analysis tool, deploying the downloaded hardware performance analysis tool into the target hardware, registering the downloaded hardware performance analysis tool on the kernel in a plug-in mode after deployment is completed, and executing the hardware performance analysis tool deployed in the target hardware to acquire the target process performance data according to the instruction.
In this embodiment, since the target hardware is registered on the kernel in the form of a plug-in, after step 103 in the flowchart shown in fig. 1 obtains the target process performance data through the hardware performance analysis tool deployed in the target hardware according to the instruction, the method for obtaining hardware performance data may further include:
and controlling a preset drive corresponding to the target hardware through a plug-in corresponding to the target hardware, and driving the target hardware to map the target process performance data from the target hardware to a preset first storage area.
In the present embodiment, one hardware corresponds to only one driver, and one driver may correspond to a plurality of hardware.
In this embodiment, the process performance data of the hardware may be stored in a designated area in the hardware. When the target process performance data corresponding to the instruction is acquired, in order to enable a preset user-mode analysis tool or a user to conveniently extract the target process performance data, the target process performance data may be mapped to the first storage area from a designated area of hardware, so that the user analysis tool or the user extracts the target process performance data from the first storage area. User-mode analysis tools are used to analyze process performance data.
In this embodiment, the first storage area may be determined according to the service requirement. Optionally, the first storage area may be located in a memory, or in any storage element in a system in which hardware is located.
In this embodiment, the plug-in corresponding to the target hardware may be queried in the plug-in of the kernel through the address corresponding to the target hardware.
According to the embodiment, since the kernel supports software performance analysis, when the hardware is registered on the kernel in the form of plug-in, the software and hardware analysis capabilities can be provided at the same time. In addition, because the performance analysis of the software and the hardware is completed based on the kernel, and an element for registering the hardware does not need to be additionally arranged, the utilization rate of kernel resources can be improved, and the consumption of other element resources can be reduced.
In an embodiment of the present invention, step 103 in the flowchart shown in fig. 1 obtains target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction.
In this embodiment, the specific type of the hardware performance analysis tool can be determined according to the business requirements. Optionally, a method of hardware performance analysis or a hardware performance analysis execution function may be included within the hardware performance analysis tool.
In this embodiment, the target process performance data is process performance data corresponding to the instruction.
In this embodiment, before the instruction is obtained, the hardware performance analysis tool obtains, in real time, process performance data generated during the hardware operation. And when the instruction is acquired, acquiring target process performance data corresponding to the instruction from the existing process performance data.
Or before the instruction is obtained, the hardware performance analysis tool does not obtain the process performance data, and when the instruction is obtained, the hardware performance analysis tool obtains the corresponding target process performance data according to the instruction.
Or, before the instruction is acquired, the hardware performance analysis tool acquires process performance data generated in the hardware operation process in real time. When the instruction is obtained and the target process performance data corresponding to the instruction does not exist in the existing process performance data, the hardware performance analysis tool obtains the target process performance data corresponding to the instruction, which is generated in the hardware operation process, according to the instruction.
According to the embodiment, the process performance data acquired by the hardware performance analysis tool is data generated in the hardware operation process, so that the process performance data can accurately reflect the operation process and the operation state of the hardware.
In an embodiment of the present invention, the step 103 in the flowchart shown in fig. 1, obtaining target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction, may include:
determining whether the target hardware has pre-existing process performance data; the pre-existing process performance data is obtained by the hardware performance analysis tool;
if not, acquiring target process performance data corresponding to the instruction, which is generated in the current operation process of the target hardware, by the hardware performance analysis tool;
and if so, inquiring the existing process performance data, and continuously acquiring the target process performance data which is generated in the current operation process of the target hardware and corresponds to the instruction through the hardware performance analysis tool.
In this embodiment, the existing process performance data exists in at least two forms: firstly, the existing process performance data are all process performance data with a set format; second, the existing process performance data is the entire process performance data generated by the hardware operating process, and the entire process performance data does not have a uniform format. Alternatively, the process performance data with the set format mentioned in the first category may be obtained in two ways: in the first mode, a hardware performance analysis tool deployed in hardware directly acquires process performance data with a set format from an operation process; in the second mode, a hardware performance analysis tool deployed in hardware acquires all process performance data generated in the hardware operation process, and then extracts the process performance data with a set format from all the process performance data.
In this embodiment, when it is determined that the target hardware has the existing process performance data, the target process data corresponding to the instruction is directly queried in the existing process performance data, and when the query is completed, the target process data is directly obtained. And when the query is not available, acquiring target process performance data corresponding to the instruction, which is generated in the current operation process of the target hardware.
In this embodiment, the specific process of querying the existing process performance data may include: inquiring whether target process performance data corresponding to the required time and/or the required performance parameters exist in the existing process performance data or not; wherein the required time and/or the required performance parameter is carried in the fetch instruction. For example, when the target process performance data corresponding to the required time does not exist in the existing process performance data, the target process performance data corresponding to the instruction generated in the current operation process of the target hardware is acquired at the required time.
In an embodiment of the present invention, after step 103 in the flowchart shown in fig. 1 obtains target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction, the method further includes:
analyzing the instruction to obtain the formatting requirement of the target process performance data; wherein the formatting requirements are carried in the get instruction;
determining whether the acquired target process performance data meets the formatting requirements;
and if not, formatting the target process performance data according to the formatting requirement.
In this embodiment, the formatting requirement carried in the instruction may be determined according to subsequent performance analysis and fault diagnosis requirements. The formatting requirements may include, but are not limited to, at least one or more of time requirements, performance parameter requirements, ordering requirements of the performance parameters, and value requirements of data corresponding to the performance parameters.
In this embodiment, when it is determined that the obtained target process performance data meets the formatting requirement, it is indicated that the target process performance data meets the subsequent performance analysis and fault diagnosis requirements, and the formatting operation on the target process performance data is not required. And when the acquired target process performance data is determined not to meet the formatting requirement, formatting the target process performance data according to the formatting requirement to obtain the process performance data meeting the formatting requirement, so that the subsequent performance analysis and fault diagnosis are facilitated.
According to the embodiment, when the target process performance data corresponding to the instruction does not meet the formatting requirement carried by the instruction, the target process performance data is formatted according to the formatting requirement, so that the format of the target process data meets the subsequent performance analysis and fault diagnosis operation requirements, and the performance analysis and fault diagnosis speed is improved.
In an embodiment of the present invention, after step 103 in the flowchart shown in fig. 1 obtains target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction, the method further includes:
mapping the target process performance data to a preset second storage area;
and extracting process performance data with a specific format from the storage area by adopting a preset data formatting rule.
In this embodiment, the process performance data of the hardware may be stored in a designated area in the hardware. When the target process performance data corresponding to the instruction is obtained, in order to enable a preset user mode analysis tool or a user to conveniently extract the target process performance data, the target process performance data is mapped to a second storage area from a designated area of hardware.
In this embodiment, the second storage area may be determined according to service requirements. Alternatively, the second storage area may be located in a memory, or in any storage element in a system in which hardware is located.
In this embodiment, the data formatting rule may be set according to specific performance analysis requirements. Optionally, the data formatting rule may include, but is not limited to, one or more of a time requirement, a performance parameter requirement, an ordering requirement of the performance parameter, and a value requirement of data corresponding to the performance parameter.
In the embodiment, since the data extracted from the storage area is the process performance data having a specific format, the analysis result can be obtained quickly when the performance analysis and the process diagnosis of the hardware are performed based on the process performance data.
According to the above embodiment, the target process performance data is mapped to a preset storage area, and the process performance data having a specific format is extracted from the storage area using a preset data formatting rule. Therefore, the extraction of the target process performance data can be facilitated, and the follow-up performance analysis and fault diagnosis can be facilitated.
In an embodiment of the present invention, the method for obtaining hardware performance data may further include the following steps:
if the target hardware does not have the function of acquiring process performance data, detecting whether the target hardware allows a hardware performance analysis tool to be deployed;
if the instruction is allowed to be received, downloading a preset hardware performance analysis tool, deploying the downloaded hardware performance analysis tool to the target hardware, and executing the target process performance data corresponding to the acquired instruction.
In this embodiment, if it is determined that the target hardware does not have the function of acquiring the process performance data in the embodiment shown in fig. 1, it is described that the process performance data of the target hardware cannot be acquired. Therefore, in order to obtain the process performance data of the target hardware, a hardware performance analysis tool needs to be deployed in the target hardware, so that the process performance data of the target hardware can be obtained.
In this embodiment, the specific implementation process of detecting whether the target hardware allows the hardware performance analysis tool to be deployed includes at least the following three types: firstly, detecting whether a space for deploying a hardware performance analysis tool exists in target hardware, and if so, detecting that the target hardware allows the hardware performance analysis tool to be deployed; otherwise, detecting that the target hardware does not allow the hardware performance analysis tool to be deployed. Secondly, detecting whether the current deployment time is within a preset time interval, and if so, detecting that the target hardware allows to deploy a hardware performance analysis tool; otherwise, detecting that the target hardware does not allow the hardware performance analysis tool to be deployed.
In this embodiment, when it is detected that the target hardware allows the hardware performance analysis tool to be deployed, the preset hardware performance analysis tool may be downloaded from the preset download area. It should be noted that if there are multiple versions of the hardware performance analysis tool in the download area, the latest version of the hardware performance analysis tool is downloaded. Or when the hardware performance analysis tools of multiple versions exist in the downloading area, displaying the information of the multiple versions, and informing a user of which versions of the hardware performance analysis tools exist, so that the user can select the required hardware performance analysis tools according to the version information. And when a selection instruction of the version of the user is received, downloading a hardware performance analysis tool corresponding to the selection instruction.
In this embodiment, after downloading the hardware performance analysis tool, the hardware performance analysis tool may be deployed to a specified location in the target hardware. After the hardware performance analysis tool is deployed, the deployed hardware performance analysis tool can be tested by using a preset test command to detect whether the hardware performance analysis tool is deployed successfully. And if the deployment is detected to be successful, executing the target process performance data corresponding to the acquisition instruction. If the target process performance data corresponding to the instruction cannot be acquired, an error is reported if the target process performance data is detected to be not deployed successfully. When the user checks the error report, the exception handling can be carried out on the target hardware in time according to the error report.
In this embodiment, after the hardware performance analysis tool is deployed into the target hardware, the hardware performance analysis tool may be initialized. Wherein initializing the hardware performance analysis tool includes at least the following two cases: first, the hardware performance analysis tool is initialized to obtain the first formatted data, and the hardware performance analysis tool obtaining the first formatted data can directly obtain the process performance data with the first format during the operation process of the hardware. And secondly, initializing the hardware performance analysis tool into a hardware performance analysis tool for acquiring second formatted data, wherein the hardware performance analysis tool for acquiring the second formatted data can acquire all process performance data related to hardware in the running process of the hardware and extract the process performance data with the second format from all the process performance data.
According to the embodiment, when the hardware does not have the function of acquiring the process performance data, the hardware performance analysis tool can be deployed in the hardware, so that the hardware has the function of acquiring the process performance data. Therefore, the hardware performance analysis tool can be automatically deployed according to the condition of hardware without manual intervention, so that the automation degree is higher.
Based on the description in the above embodiments, the embodiments of the above methods can be freely combined into a new embodiment according to business needs. The following describes a method for acquiring hardware performance data by taking the flowchart shown in fig. 2 as an example.
201. An instruction to obtain process performance data for target hardware is received.
202. Judging whether target hardware is registered on a kernel in a plug-in mode or not; wherein the kernel supports software performance analysis; if yes, judging that the target hardware has the function of acquiring the process performance data, and executing step 203; otherwise, it is determined that the target hardware does not have the function of acquiring process performance data, and step 212 is performed.
203. Determining whether the target hardware has existing process performance data; the pre-existing process performance data is obtained by the hardware performance analysis tool; if not, go to step 205; otherwise, step 204 is performed.
204. Inquiring whether target process performance data corresponding to the required time and/or the required performance parameters exist in the existing process performance data; wherein the required time and/or the required performance parameter is carried in the fetch instruction. If yes, go to step 206; otherwise, step 205 is performed.
205. And acquiring target process performance data corresponding to the instruction, which is generated in the current operation process of the target hardware, by a hardware performance analysis tool deployed in the target hardware according to the instruction, and executing step 207.
206. In the existing process performance data, the corresponding target process performance data is obtained through a hardware performance analysis tool deployed in the target hardware according to the instruction, and step 207 is executed.
207. Analyzing the instruction to obtain the formatting requirement of the target process performance data; wherein the formatting requirements are carried in the instructions.
208. Determining whether the acquired target process performance data meets formatting requirements; if not, go to step 209; otherwise, step 210 is performed.
209. The target process performance data is formatted according to the formatting requirements.
210. And controlling a preset drive corresponding to the target hardware through a plug-in corresponding to the target hardware, and driving the target hardware to map the target process performance data from the target hardware to a preset storage area.
211. And extracting process performance data with a specific format from the storage area by adopting a preset data formatting rule, and ending the current flow.
212. Judging whether a hardware performance analysis tool is deployed in the target hardware, and if so, executing step 213; otherwise, step 214 is performed.
213. The target hardware is registered on the kernel in the form of a plug-in, and step 204 is performed.
214. Detecting whether the target hardware allows the hardware performance analysis tool to be deployed, and if so, executing step 215; otherwise, step 216 is performed.
215. Downloading a preset hardware performance analysis tool, deploying the downloaded hardware performance analysis tool into the target hardware, and step 213.
216. And (6) reporting an error.
As shown in fig. 3, an embodiment of the present invention provides an apparatus for acquiring hardware performance data, where the apparatus includes:
a receiving module 301, configured to receive an instruction for acquiring process performance data of target hardware;
a determining module 302, configured to determine whether the target hardware has a function of acquiring process performance data; the process performance data is data generated by hardware in the operation process; if yes, triggering the acquisition module 303;
the obtaining module 303 is configured to obtain target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction under the trigger of the determining module 302.
According to the embodiment shown in fig. 3, when the hardware has the function of acquiring the process performance data, the process performance data of the hardware can be acquired according to the service requirement. The process performance data of the hardware can reflect the operation process of the hardware in detail, and the performance of the hardware can be accurately analyzed based on the process performance data. Therefore, the scheme provided by the embodiment of the invention can improve the accuracy of hardware performance analysis.
In an embodiment of the present invention, the obtaining module 303 is configured to obtain, according to the instruction, corresponding target process performance data through a hardware performance analysis tool deployed in the target hardware.
In an embodiment of the present invention, the determining module 302 is configured to determine whether the target hardware is registered on a kernel in a form of a plug-in; wherein the kernel supports software performance analysis; and if so, judging that the target hardware has the function of acquiring the process performance data.
In an embodiment of the present invention, as shown in fig. 4, the apparatus for acquiring hardware performance data further includes:
a first mapping module 304, configured to control a preset driver corresponding to the target hardware through a plug-in corresponding to the target hardware, and drive the target hardware to map the target process performance data acquired by the acquiring module 303 from the target hardware to a preset first storage area.
In an embodiment of the present invention, as shown in fig. 5, the obtaining module 303 may include:
a determination submodule 3031 for determining whether the target hardware has existing process performance data; the existing process performance data is obtained by the hardware performance analysis tool; if not, triggering a first obtaining submodule 3032; if yes, triggering a second obtaining submodule 3033;
the first obtaining submodule 3032 is configured to obtain, by using the hardware performance analysis tool, target process performance data corresponding to the instruction, which is generated in the current operation process of the target hardware, under the trigger of the determining submodule 3031;
the second obtaining sub-module 3033 is configured to, under the trigger of the determining sub-module 3031, query the existing process performance data, and continue to obtain, by using the hardware performance analysis tool, the target process performance data corresponding to the instruction, where the target process performance data is generated in the current operation process of the target hardware.
In an embodiment of the present invention, the second obtaining sub-module 3033 is configured to query whether target process performance data corresponding to the required time and/or the required performance parameter exists in the existing process performance data; wherein the required time and/or the required performance parameter are carried in the fetch instruction.
In an embodiment of the present invention, as shown in fig. 6, the apparatus for acquiring hardware performance data further includes:
the analysis module 305 is configured to analyze the instruction to obtain a formatting requirement of the target process performance data; wherein the formatting requirements are carried in the get instruction;
a determining module 306, configured to determine whether the acquired target process performance data acquired by the acquiring module 303 meets the formatting requirement; if not, the formatting module 307 is triggered;
the formatting module 307 is configured to format the target process performance data according to the formatting requirement parsed by the parsing module under the trigger of the determining module 306.
In an embodiment of the present invention, as shown in fig. 7, the apparatus for acquiring hardware performance data further includes:
a detection module 308, configured to detect whether the target hardware allows a hardware performance analysis tool to be deployed when the target hardware does not have a function of acquiring process performance data; if yes, triggering the deployment module 309;
the deployment module 309 is configured to download a preset hardware performance analysis tool under the trigger of the detection module 308, deploy the downloaded hardware performance analysis tool to the target hardware, and trigger the receiving module 301.
In an embodiment of the present invention, as shown in fig. 8, the apparatus for acquiring hardware performance data further includes:
a second mapping module 310, configured to map the target process performance data to a preset second storage area;
the extracting module 311 is configured to extract process performance data with a specific format from the storage area by using a preset data formatting rule.
Because the content of information interaction, execution process, and the like among the modules in the device is based on the same concept as the method embodiment of the present invention, specific content can be referred to the description in the method embodiment of the present invention, and is not described herein again. Based on the description in the above embodiments, the embodiments of the apparatus can be freely combined into a new embodiment according to business needs.
An embodiment of the present invention provides a storage medium, where the storage medium includes a stored program, where when the program runs, a device in which the storage medium is located is controlled to execute the method for acquiring hardware performance data described in any one of the foregoing methods.
In an embodiment of the present invention, an electronic device is provided, as shown in fig. 9, which includes a processor 401, a memory 402, and a bus 403; the processor 401 and the memory 402 complete communication with each other through the bus 403; the processor 401 is configured to call the program instructions in the memory 402 to execute any one of the above methods for acquiring hardware performance data.
In the embodiment of the invention, when the hardware has the function of acquiring the process performance data, the process performance data of the hardware can be acquired according to the service requirement. The process performance data of the hardware can reflect the running process of the hardware in detail, and the performance of the hardware can be accurately analyzed based on the process performance data. Therefore, the scheme provided by the embodiment of the invention can improve the accuracy of hardware performance analysis.
In the embodiment of the invention, because the kernel supports software performance analysis, when the hardware is registered on the kernel in the form of plug-in, the kernel can have software and hardware analysis capabilities at the same time. In addition, because the performance analysis of the software and the hardware is completed based on the kernel, and an element for registering the hardware does not need to be additionally arranged, the utilization rate of kernel resources can be improved, and the consumption of other element resources can be reduced.
In the embodiment of the invention, the process performance data acquired by the hardware performance analysis tool is data generated in the hardware operation process, so the process performance data can accurately reflect the operation process and the operation state of the hardware.
In the embodiment of the invention, when the target process performance data corresponding to the instruction does not meet the formatting requirement carried by the instruction, the target process performance data is formatted according to the formatting requirement, so that the format of the target process data meets the subsequent performance analysis and fault diagnosis operation requirements, and the performance analysis and fault diagnosis speed is improved.
In the embodiment of the invention, the target process performance data is mapped to a preset storage area, and the process performance data with a specific format is extracted from the storage area by adopting a preset data formatting rule. Therefore, the extraction of the target process performance data can be facilitated, and the subsequent performance analysis and fault diagnosis can be facilitated.
In the embodiment of the invention, when the hardware does not have the function of acquiring the process performance data, the hardware performance analysis tool can be deployed in the hardware, so that the hardware has the function of acquiring the process performance data. Therefore, the hardware performance analysis tool can be automatically deployed according to the condition of hardware without manual intervention, so that the automation degree is higher.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (18)

1. A method for acquiring hardware performance data is characterized by comprising the following steps:
receiving an instruction for acquiring process performance data of target hardware;
judging whether the target hardware has the function of acquiring process performance data; the process performance data is data generated by hardware in the operation process;
and if so, acquiring target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction.
2. The method for acquiring hardware performance data according to claim 1, wherein determining whether the target hardware has a function of acquiring process performance data comprises:
judging whether the target hardware is registered on a kernel in a plug-in mode or not; wherein the kernel supports software performance analysis;
and if so, judging that the target hardware has the function of acquiring the process performance data.
3. The method of claim 2, wherein after obtaining target process performance data via a hardware performance analysis tool deployed in the target hardware according to the instructions, the method further comprises:
and controlling a preset drive corresponding to the target hardware through a plug-in corresponding to the target hardware, and driving the target hardware to map the target process performance data from the target hardware to a preset first storage area.
4. The method for obtaining hardware performance data according to any one of claims 1 to 3, wherein obtaining target process performance data by a hardware performance analysis tool deployed in the target hardware according to the instruction comprises:
determining whether the target hardware has pre-existing process performance data; the pre-existing process performance data is obtained by the hardware performance analysis tool;
if not, acquiring target process performance data corresponding to the instruction, which is generated in the current operation process of the target hardware, by the hardware performance analysis tool;
and if so, inquiring the existing process performance data, and continuously acquiring the target process performance data which is generated in the current operation process of the target hardware and corresponds to the instruction through the hardware performance analysis tool.
5. The method of claim 4, wherein querying the existing process performance data comprises:
inquiring whether target process performance data corresponding to the required time and/or the required performance parameters exist in the existing process performance data; wherein the required time and/or the required performance parameter is carried in the fetch instruction.
6. The method of obtaining hardware performance data of any of claims 1-3, wherein after obtaining target process performance data via a hardware performance analysis tool deployed in the target hardware according to the instructions, the method further comprises:
analyzing the instruction to obtain the formatting requirement of the target process performance data; wherein the formatting requirement is carried in the fetch instruction;
determining whether the obtained target process performance data meets the formatting requirements;
and if not, formatting the target process performance data according to the formatting requirement.
7. A method for obtaining hardware performance data according to any of claims 1-3, further comprising:
if the target hardware does not have the function of acquiring process performance data, detecting whether the target hardware allows a hardware performance analysis tool to be deployed;
if the instruction is allowed to be received, downloading a preset hardware performance analysis tool, deploying the downloaded hardware performance analysis tool to the target hardware, and executing the target process performance data corresponding to the acquired instruction.
8. The method of obtaining hardware performance data of any of claims 1-3, wherein after obtaining target process performance data via a hardware performance analysis tool deployed in the target hardware according to the instructions, the method further comprises:
mapping the target process performance data to a preset second storage area;
and extracting process performance data with a specific format from the storage area by adopting a preset data formatting rule.
9. An apparatus for acquiring hardware performance data, comprising:
the receiving module is used for receiving an instruction for acquiring process performance data of target hardware;
the judging module is used for judging whether the target hardware has the function of acquiring process performance data; the process performance data is data generated by hardware in a running process; if yes, triggering an acquisition module;
and the acquisition module is used for acquiring target process performance data through a hardware performance analysis tool deployed in the target hardware according to the instruction under the trigger of the judgment module.
10. The apparatus for acquiring hardware performance data according to claim 9, wherein the determining module is configured to determine whether the target hardware is registered on a kernel in a form of a plug-in; wherein the kernel supports software performance analysis; and if so, judging that the target hardware has the function of acquiring the process performance data.
11. The apparatus for acquiring hardware performance data of claim 10, further comprising:
the first mapping module is configured to control a preset driver corresponding to the target hardware through a plug-in corresponding to the target hardware, and drive the target hardware to map the target process performance data acquired by the acquisition module from the target hardware to a preset first storage area.
12. The apparatus for acquiring hardware performance data according to any of claims 9-11, wherein the acquiring module comprises:
a determination submodule to determine whether the target hardware has existing process performance data; the pre-existing process performance data is obtained by the hardware performance analysis tool; if not, triggering a first acquisition submodule; if yes, triggering a second obtaining submodule;
the first obtaining sub-module is used for obtaining target process performance data corresponding to the instruction, which is generated in the current operation process of the target hardware, through the hardware performance analysis tool under the trigger of the determining sub-module;
and the second obtaining sub-module is used for inquiring the existing process performance data under the trigger of the determining sub-module and continuously obtaining the target process performance data which is generated in the current operation process of the target hardware and corresponds to the instruction through the hardware performance analysis tool.
13. The apparatus for obtaining hardware performance data according to claim 12, wherein the second obtaining sub-module is configured to query whether target process performance data corresponding to the required time and/or the required performance parameter exists in the existing process performance data; wherein the required time and/or the required performance parameter are carried in the fetch instruction.
14. An apparatus for obtaining hardware performance data according to any one of claims 9-11, further comprising:
the analysis module is used for analyzing the command to obtain the formatting requirement of the target process performance data; wherein the formatting requirement is carried in the fetch instruction;
a determining module, configured to determine whether the acquired target process performance data acquired by the acquiring module meets the formatting requirement; if not, triggering the formatting module;
the formatting module is used for formatting the target process performance data according to the formatting requirement analyzed by the analyzing module under the trigger of the determining module.
15. An apparatus for obtaining hardware performance data according to any one of claims 9-11, further comprising:
the detection module is used for detecting whether the target hardware allows a hardware performance analysis tool to be deployed or not when the target hardware does not have the function of acquiring process performance data; if so, triggering the deployment module;
the deployment module is used for downloading a preset hardware performance analysis tool under the triggering of the detection module, deploying the downloaded hardware performance analysis tool into the target hardware, and triggering the receiving module.
16. An apparatus for obtaining hardware performance data according to any one of claims 9-11, further comprising:
the second mapping module is used for mapping the target process performance data to a preset second storage area;
and the extraction module is used for extracting the process performance data with a specific format from the storage area by adopting a preset data formatting rule.
17. A storage medium, characterized in that the storage medium comprises a stored program, wherein when the program runs, a device in which the storage medium is located is controlled to execute the method for acquiring hardware performance data according to any one of claims 1 to 8.
18. An electronic device, wherein the electronic device comprises a processor, a memory and a bus; the processor and the memory complete mutual communication through the bus; the processor is used for calling the program instructions in the memory to execute the hardware performance data acquisition method of any one of claims 1 to 8.
CN201811090255.6A 2018-09-18 2018-09-18 Method and device for acquiring hardware performance data Active CN110908876B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811090255.6A CN110908876B (en) 2018-09-18 2018-09-18 Method and device for acquiring hardware performance data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811090255.6A CN110908876B (en) 2018-09-18 2018-09-18 Method and device for acquiring hardware performance data

Publications (2)

Publication Number Publication Date
CN110908876A CN110908876A (en) 2020-03-24
CN110908876B true CN110908876B (en) 2023-03-28

Family

ID=69812963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811090255.6A Active CN110908876B (en) 2018-09-18 2018-09-18 Method and device for acquiring hardware performance data

Country Status (1)

Country Link
CN (1) CN110908876B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114579131A (en) * 2020-11-30 2022-06-03 中科寒武纪科技股份有限公司 Method, device and system for acquiring hardware performance data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006107349A (en) * 2004-10-08 2006-04-20 Sony Corp Data acquisition providing program
CN102043679A (en) * 2010-12-22 2011-05-04 北京中电普华信息技术有限公司 Method and system for acquiring performance analysis data of application system
CN102081679A (en) * 2011-01-24 2011-06-01 深圳市共济科技有限公司 Computer performance data acquisition method and device
CN103095492A (en) * 2012-12-28 2013-05-08 中兴通讯股份有限公司 Data collection method and data collection device
WO2014152469A1 (en) * 2013-03-18 2014-09-25 The Trustees Of Columbia University In The City Of New York Unsupervised anomaly-based malware detection using hardware features

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595472B2 (en) * 2010-11-22 2013-11-26 International Business Machines Corporation Ganged hardware counters for coordinated rollover and reset operations
JP6805784B2 (en) * 2016-12-12 2020-12-23 富士通株式会社 Information processing equipment, information processing methods and information processing programs

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006107349A (en) * 2004-10-08 2006-04-20 Sony Corp Data acquisition providing program
CN102043679A (en) * 2010-12-22 2011-05-04 北京中电普华信息技术有限公司 Method and system for acquiring performance analysis data of application system
CN102081679A (en) * 2011-01-24 2011-06-01 深圳市共济科技有限公司 Computer performance data acquisition method and device
CN103095492A (en) * 2012-12-28 2013-05-08 中兴通讯股份有限公司 Data collection method and data collection device
WO2014152469A1 (en) * 2013-03-18 2014-09-25 The Trustees Of Columbia University In The City Of New York Unsupervised anomaly-based malware detection using hardware features

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
I.D. McManus.High Performance Data Acquisition Systems.《IEE Colloquium on PC-Based Instrumentation》.1990,全文. *
车永刚 ; 王正华 ; 李晓梅.程序性能数据获取与分析技术.国际并行算法与计算环境专题讨论会.2003,全文. *

Also Published As

Publication number Publication date
CN110908876A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN107193750B (en) Script recording method and device
CN110515795B (en) Big data component monitoring method and device and electronic equipment
CN109542754B (en) Access method of mobile equipment, debugging method, device and system of application program
US11422917B2 (en) Deriving software application dependency trees for white-box testing
CN108874379B (en) Page processing method and device
CN109582549A (en) A kind of recognition methods of device type and device
CN110908876B (en) Method and device for acquiring hardware performance data
CN106648567B (en) Data acquisition method and device
CN106610845B (en) Information management method, device, server and system
CN108268369B (en) Test data acquisition method and device
CN111382183A (en) Data query method and device
CN110837446A (en) Equipment management method and device applied to embedded system, medium and embedded equipment
CN106648912B (en) Modularization method and device for data processing in data acquisition platform
CN111475394B (en) Application testing method and device
CN110727565B (en) Network equipment platform information collection method and system
CN109101297B (en) Page identification method and device
CN107766385B (en) Method and equipment for converting file format of virtual disk
CN109561121B (en) Method and device for monitoring deployment
CN114416442A (en) Hardware change detection method and device, electronic equipment and readable storage medium
CN116302095A (en) Instruction jump judging method and device, electronic equipment and readable storage medium
CN114330278A (en) Method and equipment for judging consistency of returned data
CN109150993B (en) Method for obtaining network request tangent plane, terminal device and storage medium
CN107908516B (en) Data display method and device
CN113110870A (en) Resource packaging management method, device, equipment and storage medium
CN110968488B (en) User data storage method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40026773

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231214

Address after: Room 1-2-A06, Yungu Park, No. 1008 Dengcai Street, Sandun Town, Xihu District, Hangzhou City, Zhejiang Province

Patentee after: Aliyun Computing Co.,Ltd.

Address before: Box 847, four, Grand Cayman capital, Cayman Islands, UK

Patentee before: ALIBABA GROUP HOLDING Ltd.

TR01 Transfer of patent right