CN116662136A - Data acquisition method and device - Google Patents

Data acquisition method and device Download PDF

Info

Publication number
CN116662136A
CN116662136A CN202310645090.9A CN202310645090A CN116662136A CN 116662136 A CN116662136 A CN 116662136A CN 202310645090 A CN202310645090 A CN 202310645090A CN 116662136 A CN116662136 A CN 116662136A
Authority
CN
China
Prior art keywords
simpleperf
dumpstate
data acquisition
state information
system state
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.)
Pending
Application number
CN202310645090.9A
Other languages
Chinese (zh)
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202310645090.9A priority Critical patent/CN116662136A/en
Publication of CN116662136A publication Critical patent/CN116662136A/en
Pending legal-status Critical Current

Links

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
    • 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/3466Performance evaluation by tracing or monitoring
    • G06F11/3495Performance evaluation by tracing or monitoring for systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/54Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a data acquisition method and a device thereof, belonging to the technical field of communication. The method comprises the following steps: starting a system state information dumpstate process; starting a performance analysis tool simpleperf process through the system state information dumpstate process, wherein the performance analysis tool simpleperf process inherits a first authority of the system state information dumpstate process, and the first authority comprises: rights to performance data acquisition; and acquiring performance data through the performance analysis tool simpleperf process to obtain target data.

Description

Data acquisition method and device
Technical Field
The application belongs to the technical field of communication, and particularly relates to a data acquisition method and a device thereof.
Background
In the software development process, aiming at the performance problem, a developer uses a performance analysis tool simpleperf to perform performance analysis, but the premise of using the simpleperf is that the performance data acquisition can be performed only by acquiring the root authority of the equipment, and the performance data acquisition can not be performed in the unroot state.
Disclosure of Invention
The embodiment of the application aims to provide a data acquisition method and a device thereof, which can solve the problem that the performance data acquisition can be carried out only by acquiring the root permission of equipment in the prior art.
In a first aspect, an embodiment of the present application provides a data acquisition method, including:
starting a system state information dumpstate process;
starting a performance analysis tool simpleperf process through the system state information dumpstate process, wherein the performance analysis tool simpleperf process inherits a first authority of the system state information dumpstate process, and the first authority comprises: rights to performance data acquisition;
and acquiring performance data through the performance analysis tool simpleperf process to obtain target data.
In a second aspect, an embodiment of the present application provides a data acquisition device, including:
the starting module is used for starting the system state information dumpstate process;
the processing module is configured to start a performance analysis tool simpleperf process through the system state information dumpstate process, where the performance analysis tool simpleperf process inherits a first right of the system state information dumpstate process, and the first right includes: rights to performance data acquisition;
and the acquisition module is used for acquiring the performance data through the performance analysis tool simpleperf process to obtain target data.
In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, the performance analysis tool simpleperf process is started by starting the system state information dumpstate process, the performance analysis tool simpleperf process is started by the system state information dumpstate process, the performance analysis tool simpleperf process inherits the authority of performance data acquisition of the system state information dumpstate process, and the performance data acquisition is performed by the performance analysis tool simpleperf process to obtain target data. According to the scheme, the simpleperf process is started through the dumplstate process, so that the simpleperf process inherits the permission of performance data acquisition of the dumplstate process, performance data acquisition can be carried out through the simpleperf process, the whole process does not need to acquire root permission of equipment, acquisition of the performance data can be completed without connecting a PC (personal computer) end, and the data acquisition efficiency is improved.
Drawings
FIG. 1 is a flow chart of a data acquisition method provided by an embodiment of the application;
FIG. 2 is a specific flowchart of a data acquisition method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data acquisition device according to an embodiment of the present application;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present application;
fig. 5 is a block diagram of another electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The data acquisition method provided by the embodiment of the application is described in detail through specific embodiments and application scenes thereof with reference to the accompanying drawings.
As shown in fig. 1, an embodiment of the present application provides a data acquisition method, which may be applied to an electronic device. The data acquisition method specifically comprises the following steps:
step 101, start the system state information dumpstate process.
Specifically, the electronic device starts a system state information dumpstate process, which is a preconfigured process.
It should be noted that, in the Android system, the dump state process is an important process for diagnosing system faults and collecting logs, and when the system encounters serious errors, such as system crashes, application crashes and the like, the dump state process can be automatically started to collect relevant log information, so that developers can be helped to quickly locate and eliminate problems. Meanwhile, the dumpstate process can be manually invoked to collect state information of the equipment for problem investigation and performance optimization.
And, the dumpstate process has sys_ptrace authority, which is an authority provided by the Android system and used for allowing one process to access information such as a memory of another process in a debugging mode. Specifically, sys_ptrace may cause one process to signal another process via a system call function ptrace () to obtain or modify information such as registers, memory, stacks, file descriptors, etc. of the process. The Android system closes sys_ptrace authority by default. In the Android system, the dumpstate process has the right.
Step 102, starting a performance analysis tool simpleperf process through the system state information dumpstate process, wherein the performance analysis tool simpleperf process inherits a first authority of the system state information dumpstate process, and the first authority comprises: rights to performance data collection.
Specifically, simpleperf is an Android performance analysis tool, which can help developers to perform performance analysis on application programs on Android devices, so that performance problems and bottlenecks are identified and optimized. In the unot state, the simplef process does not have the permission of performance data acquisition, and the dumpete process has the permission of performance data acquisition, so that the electronic equipment starts the simplef process through the dumpete process, and the simplef process can inherit the permission of performance data acquisition of the dumpete process.
Moreover, the simplef process does not have the system tracking sys_ptrace authority, the dumpstate process has the sys_ptrace authority, and the electronic device starts the simplef process through the dumpstate process, so that the simplef process can inherit the sys_ptrace authority of the dumpstate process.
Furthermore, the authority of the performance data collection may be specifically a security policy configuration file sepiolicy authority. The Security authority of Android can be understood as an implementation manner of Security-Enhanced Linux (SELinux) on an Android system, and is a description and setting of SELinux Security policies for limiting the access of dumpstate processes to system resources.
The SELinux policy realizes the description and setting of specific rights through a security policy configuration file sepolicy. The assigned sepiolicy permissions of the dumpstate process are configured to ensure that the dumpstate process can access the required system resources and services. For example, "allow dumpstate proc _perf: file write" is a rule statement in which "dumpstate" in the rule indicates that the dumpstate process is permitted to perform this operation, "proc_perf: file" indicates that the object to be operated is a proc_perf file, and "write" indicates that the process is permitted to perform a write operation.
The SELinux is a forced access control (MAC system) mechanism, is a security enhancement technology realized on a Linux operating system, and mainly aims to improve the security of the Linux system, and prevents attack of malicious codes and utilization of system loopholes by carrying out fine-grained control on access rights of processes.
And step 103, collecting performance data through the performance analysis tool simpleperf process to obtain target data.
Specifically, the simplepref process inherits the authority of performance data acquisition, so that the simplepref can acquire corresponding target data by performing performance data acquisition, a programmer can be helped to know the execution condition of a program through the target data, the performance bottleneck is found out and optimized, and meanwhile, the problem of the program can be positioned and solved by analyzing the information such as the function call relation, the code block execution condition and the like.
Wherein the performance data that the simpleperf process can collect includes at least one of:
the CPU (Central Processing Unit, CPU) instruction execution times and CPU time occupation;
calling relation, calling times, consumed time and other information of the functions and the code blocks;
stack tracking information for analyzing performance bottlenecks and performance optimizations in the program;
common compiler instructions are executed as follows: cyclic expansion, vectorization and the like;
information such as kernel functions, system calls and the like in a call chain provides support for kernel-level performance analysis;
the CPU cache hit rate and cache service conditions and other information provide support for program optimization;
and the execution conditions of the program on different CPU cores support multi-core parallel performance optimization.
In the above embodiment of the present application, a performance analysis tool simpleaf process is started by starting a system state information dumpstate process, then the performance analysis tool simpleaf process is started by the system state information dumpstate process, and inherits the authority of performance data acquisition of the system state information dumpstate process, and then performance data acquisition is performed by the performance analysis tool simpleaf process, so as to obtain target data. According to the scheme, the simpleperf process is started through the dumplstate process, so that the simpleperf process inherits the permission of performance data acquisition of the dumplstate process, performance data acquisition can be carried out through the simpleperf process, the whole process does not need to acquire root permission of equipment, acquisition of the performance data can be completed without connecting a PC (personal computer) end, and the data acquisition efficiency is improved.
As an alternative embodiment, the performance analysis tool simpleperf process also has a communication interface; the method may further comprise:
and sending the target data to a target application program through the communication interface.
Specifically, the simpleperf process is further configured with a communication interface, such as: socket, thus the simplef process has the capability of using a communication interface such as socket, so that the simplef process can communicate with the target application program, can accept data acquisition parameters sent by the target application program, and can also send the obtained target data to the target application program so as to save the target data to a target position configured by the target application program for user access.
It will be appreciated that the target application is configured with data acquisition parameters, which are command parameters provided to the simpleperf process for acquisition of the required performance data. Because the simplef process is configured with a communication interface, the electronic device can send the data acquisition parameters configured in the target application program to the simplef process, so that the simplef process performs performance data acquisition according to the data acquisition parameters. The data collection parameters may be set in a target application program in a customized manner, which is not limited herein.
In addition, the signature of the platform manufacturer can be configured in the target application program so as to acquire the authority of the attribute of the read-write system.
As an optional embodiment, the step 101 starts a system state information dumpstate process, which specifically includes:
under the condition that the electronic equipment starts a target application program, acquiring a first input of the target application program;
in response to the first input, a system state information dumpstate process is started.
Specifically, the user installs a target application program in the electronic device, the electronic device obtains a second input of the user to the icon of the target application program, the target application program is started, and under the condition that the target application program is started, that is, under the condition that the target application program is operated, the electronic device obtains a first input of the user to the target application program, and in response to the first input, the system state information dumpstate process is started.
It will be appreciated that the target application is a system-level application, is an Android application package (Android application package, apk) file, may be directly installed in the electronic device, and has a User Interface (UI), and the User may perform clicking, double clicking, etc. on the UI of the target application.
It should be noted that, in order to enable the dumpetate process to be started by the target application program, the target application program needs to have a switch for starting the dumpetate process, that is, a system attribute may be added to the Android system, where the system attribute corresponds to a switch, and the target application program may start the dumpetate process by modifying a state (i.e., the first input) of the system attribute.
As an optional embodiment, the step 102 starts a performance analysis tool simpleperf process through the system state information dumpstate process, which specifically includes:
acquiring target parameters in the system state information dumpstate process;
and under the condition that the target parameters are consistent with preset parameters, creating and starting the performance analysis tool simpleperf process through the system state information dumpstate process.
Specifically, the electronic device acquires a target parameter in the dumpstate process, compares whether the target parameter is consistent with a preset parameter, and if so, can create and start a simpleperf process through the dumpstate process; if the target parameter is inconsistent with the preset parameter, no authority is indicated to create the simpleperf process. Specifically, the sub-process of the dumpstate process, i.e., the simpleperf process, can be created by means of a bifurcation function fork.
It should be noted that the target parameter may be account information given when the target application program starts the dump, and the account information is account information of the login target application program.
As an optional embodiment, the step 103 performs performance data collection through the performance analysis tool simpleperf process to obtain target data, which specifically includes:
and under the condition that a performance data acquisition command sent by the target application program is received, performing performance data acquisition through the performance analysis tool simpleperf process to obtain target data.
Specifically, under the condition that a performance data acquisition command sent by a target application program is received, the simplepref process analyzes the data acquisition parameters to acquire corresponding performance data, so that required target data is obtained, a programmer can be helped to know the execution condition of the program through the target data obtained by the simplepref process, the performance bottleneck is found out and optimized, and meanwhile, the problem of the program can be positioned and solved by analyzing information such as a function call relation, the execution condition of a code block and the like.
It will be appreciated that, before performance data collection is performed by the performance analysis tool simpleperf process, the simpleperf process determines whether the application program transmitting the data collection parameters is a target application program. If the application program sending the data acquisition parameters is a target application program, the simpleperf process can acquire performance data according to the data acquisition parameters; and if the application program sending the data acquisition parameters is inconsistent with the target application program, prohibiting the simpleperf process from acquiring the performance data, and ending the flow.
As shown in fig. 2, the above scheme is specifically described below by way of a specific embodiment:
step 201: in the case where the electronic device initiates a target application, the electronic device obtains a first input to the target application.
Step 202: in response to the first input, the electronic device starts a dumpstate process configured with permissions for performance data collection.
Step 203: the electronic device obtains target parameters in the dumpstate process.
Step 204: the electronic equipment compares whether the target parameters are consistent with preset parameters or not through a dumpstate process; if so, go to step 205; if not, ending the flow.
Step 205: the electronic equipment creates and starts a simpleperf process through a dumpltate process, the simpleperf process inherits the authority of performance data acquisition, and a communication interface of the simpleperf process and a target application program is configured.
Step 206: the electronic equipment controls the simpleperf process to acquire the data acquisition parameters of the target application program through the communication interface.
Step 207: the electronic equipment judges whether the application program for sending the data acquisition parameters is a target application program or not through a simpleperf process, if so, the step 208 is entered; if not, the process is ended.
Step 208: and the electronic equipment performs performance data acquisition according to the data acquisition parameters to obtain target data.
In summary, in the embodiment of the present application, under the condition that the electronic device starts the target application, a first input to the target application is obtained, and in response to the first input, a system state information dumpstate process is started, then a simplef process is started through the dumpstate process, and the simplef process inherits the permission of performance data acquisition of the dumpstate process, and then performance data acquisition is performed through the simplef process, so as to obtain target data. According to the scheme, the simpleperf process is started through the dumplstate process, so that the simpleperf process inherits the permission of performance data acquisition of the dumplstate process, performance data acquisition can be carried out through the simpleperf process, the whole process does not need to acquire root permission of equipment, acquisition of the performance data can be completed without connecting a PC (personal computer) end, and the data acquisition efficiency is improved.
According to the data acquisition method provided by the embodiment of the application, the execution main body can be a data acquisition device. In the embodiment of the application, a method for executing data acquisition by a data acquisition device is taken as an example, and the data acquisition device provided by the embodiment of the application is described.
As shown in fig. 3, an embodiment of the present application further provides a data acquisition device 300, including:
the starting module 301 is configured to start a system state information dumpstate process;
a processing module 302, configured to start a performance analysis tool simpleperf process through the system state information dumpstate process, where the performance analysis tool simpleperf process inherits a first right of the system state information dumpstate process, and the first right includes: rights to performance data acquisition;
and the acquisition module 303 is used for acquiring the performance data through the performance analysis tool simpleperf process to obtain target data.
According to the embodiment of the application, the system state information dumpest process is started, the simplepref process is started through the dumpest process, the simplepref process inherits the authority of performance data acquisition of the dumpest process, and the performance data acquisition is carried out through the simplepref process to obtain target data. According to the scheme, the simpleperf process is started through the dumplstate process, so that the simpleperf process inherits the permission of performance data acquisition of the dumplstate process, performance data acquisition can be carried out through the simpleperf process, the whole process does not need to acquire root permission of equipment, acquisition of the performance data can be completed without connecting a PC (personal computer) end, and the data acquisition efficiency is improved.
Optionally, the performance analysis tool simpleperf process further has a communication interface; the apparatus further comprises:
and the sending module is used for sending the target data to a target application program through the communication interface.
Optionally, the processing module 302 is specifically configured to:
acquiring target parameters in the system state information dumpstate process;
and under the condition that the target parameters are consistent with preset parameters, creating and starting the performance analysis tool simpleperf process through the system state information dumpstate process.
Optionally, the starting module 301 is specifically configured to:
under the condition that the electronic equipment starts a target application program, acquiring a first input of the target application program;
in response to the first input, a system state information dumpstate process is started.
Optionally, the collecting module 303 is specifically configured to:
and under the condition that a performance data acquisition command sent by the target application program is received, performing performance data acquisition through the performance analysis tool simpleperf process to obtain target data.
In summary, in the embodiment of the present application, under the condition that the electronic device starts the target application, a first input to the target application is obtained, and in response to the first input, a system state information dumpstate process is started, then a simplef process is started through the dumpstate process, and the simplef process inherits the permission of performance data acquisition of the dumpstate process, and then performance data acquisition is performed through the simplef process, so as to obtain target data. According to the scheme, the simpleperf process is started through the dumplstate process, so that the simpleperf process inherits the permission of performance data acquisition of the dumplstate process, performance data acquisition can be carried out through the simpleperf process, the whole process does not need to acquire root permission of equipment, acquisition of the performance data can be completed without connecting a PC (personal computer) end, and the data acquisition efficiency is improved.
The data acquisition device in the embodiment of the application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. For example, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), or the like, and the embodiments of the present application are not limited in particular.
The data acquisition device in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The data acquisition device provided by the embodiment of the present application can implement each process implemented by the embodiments of the methods of fig. 1 to 2, and in order to avoid repetition, a detailed description is omitted here.
Optionally, as shown in fig. 4, the embodiment of the present application further provides an electronic device 400, including a processor 401 and a memory 402, where the memory 402 stores a program or an instruction that can be executed on the processor 401, and the program or the instruction implements each step of the above-mentioned data acquisition method embodiment when executed by the processor 401, and the steps can achieve the same technical effect, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 5 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 1000 includes, but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 1010 by a power management system to perform functions such as managing charge, discharge, and power consumption by the power management system. The electronic device structure shown in fig. 5 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 1010 is configured to start a system state information dumpstate process;
starting a performance analysis tool simpleperf process through the system state information dumpstate process, wherein the performance analysis tool simpleperf process inherits a first authority of the system state information dumpstate process, and the first authority comprises: rights to performance data acquisition;
and acquiring performance data through the performance analysis tool simpleperf process to obtain target data.
To sum up, in the embodiment of the application, the system state information dumplstate process is started, the simpleperf process is started through the dumplstate process, the simpleperf process inherits the authority of performance data acquisition of the dumplstate process, and the performance data acquisition is performed through the simpleperf process to obtain target data. According to the scheme, the simpleperf process is started through the dumplstate process, so that the simpleperf process inherits the permission of performance data acquisition of the dumplstate process, performance data acquisition can be carried out through the simpleperf process, the whole process does not need to acquire root permission of equipment, acquisition of the performance data can be completed without connecting a PC (personal computer) end, and the data acquisition efficiency is improved.
Optionally, the performance analysis tool simpleperf process further has a communication interface; the processor 1010 is further configured to:
and sending the target data to a target application program through the communication interface.
Optionally, when the processor 1010 starts the performance analysis tool simpleperf process through the system state information dumpstate process, the processor is specifically configured to:
acquiring target parameters in the system state information dumpstate process;
and under the condition that the target parameters are consistent with preset parameters, creating and starting the performance analysis tool simpleperf process through the system state information dumpstate process.
Optionally, when the processor 1010 starts the system state information dumpstate process, the method specifically is used for:
under the condition that the electronic equipment starts a target application program, acquiring a first input of the target application program;
in response to the first input, a system state information dumpstate process is started.
Optionally, when the processor 1010 performs performance data collection through the performance analysis tool simpleperf process to obtain target data, the processor is specifically configured to:
and under the condition that a performance data acquisition command sent by the target application program is received, performing performance data acquisition through the performance analysis tool simpleperf process to obtain target data.
In summary, in the embodiment of the present application, under the condition that the electronic device starts the target application, a first input to the target application is obtained, and in response to the first input, a system state information dumpstate process is started, then a simplef process is started through the dumpstate process, and the simplef process inherits the permission of performance data acquisition of the dumpstate process, and then performance data acquisition is performed through the simplef process, so as to obtain target data. According to the scheme, the simpleperf process is started through the dumplstate process, so that the simpleperf process inherits the permission of performance data acquisition of the dumplstate process, performance data acquisition can be carried out through the simpleperf process, the whole process does not need to acquire root permission of equipment, acquisition of the performance data can be completed without connecting a PC (personal computer) end, and the data acquisition efficiency is improved.
It should be appreciated that in an embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 can include two portions, a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
The memory 1009 may be used to store software programs as well as various data. The memory 1009 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 1009 may include volatile memory or nonvolatile memory, or the memory 1009 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 1009 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, and the like, and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 1010.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements each process of the above-mentioned data acquisition method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the data acquisition method embodiment, and can achieve the same technical effects, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the data acquisition method embodiments described above, and achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (12)

1. A method of data acquisition, comprising:
starting a system state information dumpstate process;
starting a performance analysis tool simpleperf process through the system state information dumpstate process, wherein the performance analysis tool simpleperf process inherits a first authority of the system state information dumpstate process, and the first authority comprises: rights to performance data acquisition;
and acquiring performance data through the performance analysis tool simpleperf process to obtain target data.
2. The method of claim 1, wherein the performance analysis tool simpleperf process further has a communication interface; the method further comprises the steps of:
and sending the target data to a target application program through the communication interface.
3. The method of claim 1, wherein the launching of a performance analysis tool simpleperf process by the system state information dumpstate process comprises:
acquiring target parameters in the system state information dumpstate process;
and under the condition that the target parameters are consistent with preset parameters, creating and starting the performance analysis tool simpleperf process through the system state information dumpstate process.
4. The method of claim 1, wherein the starting the system state information dumpstate process comprises:
under the condition that the electronic equipment starts a target application program, acquiring a first input of the target application program;
in response to the first input, a system state information dumpstate process is started.
5. The method according to claim 1, wherein the performance data acquisition by the performance analysis tool simpleperf process obtains target data, including:
and under the condition that a performance data acquisition command sent by the target application program is received, performing performance data acquisition through the performance analysis tool simpleperf process to obtain target data.
6. A data acquisition device, comprising:
the starting module is used for starting the system state information dumpstate process;
the processing module is configured to start a performance analysis tool simpleperf process through the system state information dumpstate process, where the performance analysis tool simpleperf process inherits a first right of the system state information dumpstate process, and the first right includes: rights to performance data acquisition;
and the acquisition module is used for acquiring the performance data through the performance analysis tool simpleperf process to obtain target data.
7. The apparatus of claim 6, wherein the performance analysis tool simpleperf process further has a communication interface; the apparatus further comprises:
and the sending module is used for sending the target data to a target application program through the communication interface.
8. The apparatus of claim 6, wherein the processing module is specifically configured to:
acquiring target parameters in the system state information dumpstate process;
and under the condition that the target parameters are consistent with preset parameters, creating and starting the performance analysis tool simpleperf process through the system state information dumpstate process.
9. The device according to claim 6, wherein the starting module is specifically configured to:
under the condition that the electronic equipment starts a target application program, acquiring a first input of the target application program;
in response to the first input, a system state information dumpstate process is started.
10. The device according to claim 6, wherein the acquisition module is specifically configured to:
and under the condition that a performance data acquisition command sent by the target application program is received, performing performance data acquisition through the performance analysis tool simpleperf process to obtain target data.
11. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the data acquisition method of any one of claims 1-5.
12. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the data acquisition method according to any one of claims 1-5.
CN202310645090.9A 2023-05-31 2023-05-31 Data acquisition method and device Pending CN116662136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310645090.9A CN116662136A (en) 2023-05-31 2023-05-31 Data acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310645090.9A CN116662136A (en) 2023-05-31 2023-05-31 Data acquisition method and device

Publications (1)

Publication Number Publication Date
CN116662136A true CN116662136A (en) 2023-08-29

Family

ID=87727427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310645090.9A Pending CN116662136A (en) 2023-05-31 2023-05-31 Data acquisition method and device

Country Status (1)

Country Link
CN (1) CN116662136A (en)

Similar Documents

Publication Publication Date Title
KR102324336B1 (en) User device and integrity verification method for the same
KR20060108694A (en) System for invoking a privileged function in a device
US10210331B2 (en) Executing full logical paths for malware detection
WO2022247301A1 (en) Testing method, graphical interface and related apparatus
Dai et al. Behavior-based malware detection on mobile phone
CN103164653A (en) Apparatus and method for analyzing malware in data analysis system
CN112231198B (en) Malicious process debugging method and device, electronic equipment and medium
WO2022247300A1 (en) Sandbox initialization method, graphical interface and related apparatus
CN111062032A (en) Anomaly detection method and system and computer-readable storage medium
US9185513B1 (en) Method and system for compilation with profiling feedback from client
WO2019139740A1 (en) Extensible input stack for processing input device data
CN113176926A (en) API dynamic monitoring method and system based on virtual machine introspection technology
CN111385661B (en) Method, device, terminal and storage medium for voice control of full screen playing
Ruan et al. Analyzing android application in real-time at kernel level
CN109145598B (en) Virus detection method and device for script file, terminal and storage medium
CN116662136A (en) Data acquisition method and device
CN113282435B (en) Application exception processing method and electronic equipment
WO2019139738A1 (en) Extensible input stack for processing input device data
CN116956272A (en) Authority calling monitoring method and device and electronic equipment
CN106775608B (en) Method and device for realizing independent system process
US11755745B2 (en) Systems and methods for monitoring attacks to devices
CN111177726A (en) System vulnerability detection method, device, equipment and medium
CN112491799B (en) Remote repair method and device for communication module, computer equipment and storage medium
WO2024088053A1 (en) Code debugging method, electronic device, and computer readable storage medium
CN112560018B (en) Sample file detection method, device, terminal equipment and storage medium

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