CN113377614A - Generation method and device of call chain information, electronic equipment and storage medium - Google Patents

Generation method and device of call chain information, electronic equipment and storage medium Download PDF

Info

Publication number
CN113377614A
CN113377614A CN202110637629.7A CN202110637629A CN113377614A CN 113377614 A CN113377614 A CN 113377614A CN 202110637629 A CN202110637629 A CN 202110637629A CN 113377614 A CN113377614 A CN 113377614A
Authority
CN
China
Prior art keywords
target
monitored
program
target agent
application program
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.)
Granted
Application number
CN202110637629.7A
Other languages
Chinese (zh)
Other versions
CN113377614B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110637629.7A priority Critical patent/CN113377614B/en
Publication of CN113377614A publication Critical patent/CN113377614A/en
Application granted granted Critical
Publication of CN113377614B publication Critical patent/CN113377614B/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/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The utility model provides a generation method, a device, an electronic device and a storage medium of call chain information, which relates to the technical field of computers, in particular to the technical field of artificial intelligence such as deep learning and big data processing, the method comprises the following steps: determining a starting instruction corresponding to the application program to be monitored, and analyzing the starting instruction to obtain a target identifier; starting a target agent program corresponding to the target identifier, wherein the target agent program calls a target callback event function of the virtual machine after being started; and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function. Therefore, the generation of the call chain information is realized in an auxiliary way through interaction with the virtual machine, the influence on the service logic related to the source program code file is avoided, the integrity of the call chain information can be effectively improved, and the generation efficiency and the generation effect of the call chain information are effectively improved.

Description

Generation method and device of call chain information, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the technical fields of artificial intelligence, such as deep learning and big data processing, and in particular, to a method and an apparatus for generating call chain information, an electronic device, and a storage medium.
Background
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning technology, a deep learning technology, a big data processing technology, a knowledge map technology and the like.
In the related art, a source code file of an application program is pre-dotted or byte code is injected to assist in generating call chain information related to the application program.
Disclosure of Invention
The disclosure provides a generation method and device of call chain information, an electronic device, a storage medium and a computer program product.
According to a first aspect of the present disclosure, a method for generating call chain information is provided, including: determining an application program to be monitored; determining a starting instruction corresponding to the application program to be monitored, and analyzing the starting instruction to obtain a target identifier; starting a target agent program corresponding to the target identifier, wherein the target agent program calls a target callback event function of the virtual machine after being started; and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
According to a second aspect of the present disclosure, there is provided a generation apparatus of call chain information, including: the first determining module is used for determining the application program to be monitored; the second determining module is used for determining a starting instruction corresponding to the application program to be monitored and analyzing the starting instruction to obtain a target identifier; the starting module is used for starting a target agent program corresponding to the target identifier, wherein the target agent program calls a target callback event function of the virtual machine after being started; and the generation module is used for generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the call chain information generation method of the embodiments of the present disclosure.
According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute a method for generating call chain information disclosed in an embodiment of the present disclosure is provided.
According to a fifth aspect of the present disclosure, a computer program product is proposed, which comprises a computer program that, when executed by a processor, implements the method for generating call chain information disclosed in the embodiments of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure;
fig. 2 is an architecture diagram of a generation apparatus of call chain information in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 4 is a schematic diagram according to a third embodiment of the present disclosure;
FIG. 5 is a schematic diagram according to a fourth embodiment of the present disclosure;
FIG. 6 is a schematic diagram according to a fifth embodiment of the present disclosure;
FIG. 7 illustrates a schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present disclosure.
It should be noted that the main execution body of the method for generating call chain information in this embodiment is a device for generating call chain information, and the device may be implemented in a software and/or hardware manner, and the device may be configured in an electronic device, and the electronic device may include, but is not limited to, a terminal, a server, and the like.
The embodiment of the disclosure relates to the technical field of computers, in particular to the technical field of artificial intelligence such as deep learning and big data processing, and particularly relates to a method and a device for generating call chain information, an electronic device and a storage medium.
Wherein, Artificial Intelligence (Artificial Intelligence), english is abbreviated as AI. The method is a new technical science for researching and developing theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.
Deep learning is the intrinsic law and expression level of the learning sample data, and the information obtained in the learning process is very helpful for the interpretation of data such as characters, images and sounds. The final goal of deep learning is to make a machine capable of human-like analytical learning, and to recognize data such as characters, images, and sounds.
The big data processing refers to a process of analyzing and processing large-scale data in an artificial intelligence mode, and the big data can be summarized into 5V, and has large data Volume (Volume), high speed (Velocity), multiple types (Velocity), Value (Value) and authenticity (Veracity).
As shown in fig. 1, the method for generating call chain information includes:
s101: and determining the application program to be monitored.
The application program whose call chain information is to be analyzed may be referred to as an application program to be monitored, and the call chain information may be information describing a call situation between a plurality of functions implementing the application program to be monitored.
The number of the applications to be monitored may be 1 or multiple, and the number of the applications to be monitored is not specifically limited in the embodiment of the present invention, and may be set by a person skilled in the art according to an actual situation.
The determining of the application program to be monitored may be that the generation device of the call chain information receives an analysis request of the call chain information sent by the third-party detection device, and then analyzes the analysis request, identifies an application program identifier from the analysis request, and determines the application program to which the application program identifier belongs as the application program to be monitored, or may use all of a plurality of application programs running in the electronic device as the application program to be monitored, or may be selected according to actual development test requirements of developers, without limitation.
S102: and determining a starting instruction corresponding to the application program to be monitored, and analyzing the starting instruction to obtain a target identifier.
The starting instruction can be configured in the electronic device in advance, and when the starting instruction is called, the application program to be monitored can be started based on the starting instruction.
In the embodiment of the present disclosure, after the application program to be monitored is determined, a pre-configured start instruction corresponding to the application program to be monitored may be read, and then the start instruction is analyzed, so as to obtain the target identifier obtained by analyzing from the start instruction.
Wherein the target identifier may be used to uniquely identify the target agent, and the target agent may be one of a plurality of agents generated in advance.
The Agent program, namely the Agent program Agent, may be constructed by using an Agent technology, and the Agent program Agent may be used to assist monitoring, running, or even replacing other programs.
As shown in fig. 2, fig. 2 is an architecture schematic diagram of a generation apparatus of call chain information in an embodiment of the present disclosure, and includes: the system comprises an application program to be monitored, a target Agent program Agent, a JVMTI layer and a Java virtual machine JVM, wherein the application program to be monitored, the target Agent program Agent, the JVMTI layer and the JVM are used for supporting the whole processing logic of the generation method of the call chain information.
That is, as shown in fig. 2, corresponding agents may be configured in advance for different applications, and the corresponding agents may be registered in a Virtual Machine (e.g., a Java Virtual Machine (JVM)), where the Java Virtual Machine JVM correspondingly has a Java Virtual Machine Tool Interface (JVM Tool Interface) layer, and the JVM layer can provide a local programming Interface for the Java Virtual Machine, so that in this embodiment of the disclosure, multiple agents may be registered in the JVM Interface layer in advance, and a corresponding identifier may be configured for each Agent, and each Agent may be provided with a function of analyzing call chain information of the corresponding application.
Therefore, in the embodiment of the present disclosure, after the starting instruction is analyzed to obtain the target identifier obtained by analyzing the starting instruction, the target identifier may be directly used to assist in subsequently determining the corresponding target agent program, so as to invoke the function of analyzing the call chain information provided by the target agent program.
S103: and starting a target agent program corresponding to the target identification, wherein the target agent program calls a target callback event function of the virtual machine after starting.
After the start instruction corresponding to the application program to be monitored is determined and the target identifier is obtained through analysis in the start instruction, the target agent program corresponding to the target identifier can be directly started, wherein the target agent program calls the target callback event function of the virtual machine after the target agent program is started.
Optionally, in some embodiments, the target agent program corresponding to the target identifier may be started while the application program to be monitored is started, so that the target agent program can be started in time to call an analysis function of call chain information of the target agent program, and the call chain information related to the initial stage of starting the application program is avoided from being omitted, so that the integrity of generation of the call chain information can be effectively guaranteed, and automatic analysis of the call chain information can be realized.
In the embodiment of the present disclosure, a function capable of analyzing the call chain information of the corresponding application program may be configured for the target agent program in advance, and specific configuration may refer to the following embodiment, so that when the application program to be monitored is started, the target callback event function of the virtual machine may be directly called based on the target agent program, so as to dynamically analyze the call chain information of the application program to be monitored.
In some embodiments, when the application to be monitored is started, a target agent corresponding to the target identifier is started, and the target agent may call a target callback event function of the virtual machine in a direct call or indirect call manner.
For example, the target callback event function in the virtual machine may be directly called by the target agent program, or a preset instruction in the target agent program may be captured first, and then the target callback event function in the virtual machine may be indirectly called based on the preset instruction, which is not limited to this.
S104: and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
In the embodiment of the disclosure, a local Native function realized based on C language can be loaded in the target Agent, and then, a local Native interface provided by the jvm layer is called via the local Native function to realize interaction control on the jvm, so that interaction between the Agent and the virtual machine is completed to assist in realizing generation of call chain information, without pre-burying points or injecting byte codes for the source program code file of the application to be monitored, thereby avoiding influencing the business logic related to the source program code file.
In the embodiment of the present disclosure, the target agent interacts with the JVM layer to assist in generating the call chain information, so that the monitoring range can be effectively guaranteed, and any call situation can be sensed and recorded in an assisted manner.
In this embodiment, an application to be monitored is determined, a start instruction corresponding to the application to be monitored is determined, a target identifier is obtained through analysis in the start instruction, and a target agent corresponding to the target identifier is started, where the target agent calls a target callback event function of a virtual machine after being started, and call chain information among a plurality of functions of the application to be monitored is generated based on the target callback event function, so that the integrity of the call chain information can be effectively improved, and the generation efficiency and the generation effect of the call chain information are effectively improved.
Fig. 3 is a schematic diagram according to a second embodiment of the present disclosure.
As shown in fig. 3, before determining the application to be monitored, the method further includes:
s301: and acquiring an initial starting instruction corresponding to the application program to be monitored.
That is to say, the present embodiment provides a method for configuring a start instruction in advance for an application to be monitored, so that when the application to be monitored is started, a target identifier of a target agent can be quickly captured from the start instruction, and quick and accurate invocation of the target agent is assisted.
Before configuration, a start instruction for starting the application to be monitored may be referred to as an initial start instruction, and this embodiment supports performing corresponding optimization processing on the initial start instruction.
S302: and acquiring an access path corresponding to the target identifier.
The method includes configuring a plurality of agent programs in advance, correspondingly storing the agent programs into a storage space of the electronic device, or storing the agent programs into a cloud platform, and then configuring corresponding access paths for storage positions and associating the corresponding access paths with identifiers of the agent programs.
Therefore, when the initial starting instruction corresponding to the application program to be monitored is obtained, the target identification of the target agent program corresponding to the application program to be monitored can be determined, then, the access path corresponding to the target identification is obtained (the access path corresponding to the identification can be configured in advance), and then the subsequent steps are triggered.
S303: the call parameters are written into the initial startup instruction and the access path is associated with the initial startup instruction.
The invocation parameter may be used as a key field of the invocation target agent, and the invocation parameter is, for example, a java agent parameter, which is not limited to this.
Therefore, the calling parameter is written into the initial starting instruction, and the access path is associated with the initial starting instruction, so that the calling of the target agent program can be realized directly based on the access path corresponding to the target program when the application program to be monitored is started.
S304: and configuring the initial starting instruction obtained by association as a starting instruction corresponding to the application program to be monitored.
After the call parameter is written into the initial start instruction and the access path is associated with the initial start instruction, the associated initial start instruction can be directly configured as the start instruction corresponding to the application program to be monitored, so that the target agent program corresponding to the target identifier can be started while the application program to be monitored is started.
For example, a-java agent parameter may be added to an initial boot instruction corresponding to the application to be monitored, and an access path corresponding to the target agent program is directed to the target agent program, so as to complete loading of the target agent program into the boot processing logic of the application to be monitored.
When the application program to be monitored runs, the target Agent is started at the same time, so that the calling conditions among a plurality of functions in each module corresponding to the application program to be monitored can be observed in real time through the target Agent, and complete calling chain information is generated based on the calling conditions.
In the embodiment, the initial starting instruction corresponding to the application program to be monitored is obtained, the access path corresponding to the target identifier is obtained, the calling parameter is written into the initial starting instruction, the access path is associated with the initial starting instruction, and the associated initial starting instruction is configured to be the starting instruction corresponding to the application program to be monitored.
Fig. 4 is a schematic diagram according to a third embodiment of the present disclosure.
As shown in fig. 4, the method for generating call chain information includes:
s401: a target agent is created.
The Agent program, namely the Agent program Agent, can be constructed by using Agent technology, and the Agent program Agent can be used for assisting in monitoring, running and even replacing other programs.
The target agent program in the embodiment of the present disclosure may be generated in advance and registered, and the target agent program is configured to interact with a virtual machine in a background of the application program to assist in implementing a function of generating call chain information.
In the embodiment of the disclosure, a local Native function realized based on C language can be loaded in the target Agent, and then, a local Native interface provided by the jvm layer is called via the local Native function to realize interaction control on the jvm, so that interaction between the Agent and the virtual machine is completed to assist in realizing generation of call chain information, without pre-burying points or injecting byte codes for the source program code file of the application to be monitored, thereby avoiding influencing the business logic related to the source program code file.
S402: the target identity is configured for the target agent and associated with an access path of the target agent.
The method includes configuring a plurality of agent programs in advance, correspondingly storing the agent programs into a storage space of the electronic device, or storing the agent programs into a cloud platform, and then configuring corresponding access paths for storage positions and associating the corresponding access paths with identifiers of the agent programs.
That is, the access path of the target agent indicates the storage location of the target agent, so that the corresponding target agent can be acquired based on the access path.
The target identification is configured for the target agent program, and the target identification is associated with the access path of the target agent program, so that the storage position of the target agent program can be rapidly and accurately determined directly based on the target identification, and the storage position can be obtained through the access path route, so that the target agent program can be acquired in real time based on the target identification when the application program to be monitored is started, and the real-time starting of the target agent program is supported.
S403: configuring target permissions for a target agent, wherein the target agent may invoke a local programming interface of the virtual machine based on the target permissions.
In the embodiment of the present disclosure, a local Native function implemented based on C language may be loaded in a target Agent in advance, and then a local Native interface provided by the JVMTI layer is called via the local Native function to implement interaction control on the JVMTI, where the local Native interface may be referred to as a local programming interface.
That is, by loading a local Native function implemented based on C language in the target Agent, the target authority can be configured for the target Agent, so that the target Agent can call the local Native interface of the virtual machine based on the target authority.
S404: a target agent is employed to call a local programming interface to register a target callback event function with the virtual machine.
After the target authority is configured for the target Agent program, the target Agent program can be adopted to call the local programming interface to register a target callback event function for the virtual machine, so that the interactive control effect of interactive control of the target Agent program Agent and the JVMTI is guaranteed, the function of configuring call chain information generation for the target Agent program based on the interaction of the target Agent program Agent and the JVMTI is realized, the monitoring range can be effectively guaranteed, and any call condition can be sensed and recorded by the target Agent program Agent.
Optionally, in some embodiments, invoking the local programming interface with the target agent to register the target callback event function with the virtual machine may be adding a local function among the target agent; calling a local programming interface by adopting a local function, and associating the local function with a trigger event function in the virtual machine; and registering the trigger event function obtained by association by adopting an event notification mode function set in the virtual machine so as to obtain a target callback event function.
The local function is, for example, a local Native function implemented based on C language.
A local programming interface, such as the local Native interface provided by the JVMTI layer.
For example, the callback method entry and callback method exit functions may be predefined in the local Native function.
Then, event triggering logic (such as a function name of a print triggering event) can be respectively realized, logic when a target callback event triggers is respectively realized, and a callback method entry function and a callback method exit function which are defined in advance are respectively pointed to triggering event functions in the virtual machine.
Then, the trigger event function obtained by correlation may be registered by setting an event notification mode function (SetEventNotificationMode function) to obtain a target callback event function.
For example, the 2 function part tables are pointed to MethodEntry and MethodExit of jvmtieventcalbacks, and setup at the JVM layer is completed through seteventcalbacks. Thus, when the function in the application program to be monitored is triggered, the function can be triggered to be executed.
Through the steps, the registration setting of the target agent program in the JVM layer can be realized.
Therefore, in the embodiment, the local function is added in the target agent program; calling a local programming interface by adopting a local function, and associating the local function with a trigger event function in the virtual machine; the method has the advantages that the event notification mode function is set in the virtual machine, the trigger event function obtained through correlation is registered to obtain the target callback event function, the registration setting of the target agent program in the virtual machine can be realized, the convenience of registration of the target agent program is effectively assisted and improved, the target agent program can quickly respond after being started, and the call chain information is generated.
S405: and determining the application program to be monitored.
S406: and determining a starting instruction corresponding to the application program to be monitored, and analyzing the starting instruction to obtain a target identifier.
S407: and starting a target agent program corresponding to the target identification, wherein the target agent program calls a target callback event function of the virtual machine after starting.
S408: and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
For the description of S405-S408, reference may be made to the above embodiments, which are not described herein again.
In this embodiment, by creating the target agent, configuring the target identifier for the target agent, associating the target identifier with an access path of the target agent, configuring the target authority for the target agent, and calling the local programming interface by using the target agent to register the target callback event function with the virtual machine, it may be supported to directly and accurately determine the storage location of the target agent based on the target identifier, and the storage location may be obtained via the access path route, so as to assist in acquiring the target agent based on the target identifier in real time when starting the application to be monitored, and support real-time starting for the target agent. Therefore, the interaction control effect of the interaction control of the target Agent and the JVMTI is guaranteed, the function of generating the call chain information for the target Agent based on the interaction of the target Agent and the JVMTI is realized, the monitoring range can be effectively guaranteed, and the target Agent can sense and record any call condition.
Fig. 5 is a schematic diagram according to a fourth embodiment of the present disclosure.
As shown in fig. 5, the apparatus 50 for generating call chain information includes:
a first determining module 501, configured to determine an application to be monitored;
a second determining module 502, configured to determine a start instruction corresponding to the application to be monitored, and analyze the start instruction to obtain a target identifier;
a starting module 503, configured to start a target agent corresponding to the target identifier, where the target agent calls a target callback event function of the virtual machine after starting;
the generating module 504 is configured to generate call chain information between a plurality of functions of the application to be monitored based on the target callback event function.
In some embodiments of the present disclosure, as shown in fig. 6, the generation apparatus 60 of the call chain information includes: the device comprises a first determining module 601, a second determining module 602, a starting module 603 and a generating module 604, wherein the device further comprises:
a creating module 605 for creating a target agent;
a first configuration module 606, configured to configure a target identifier for the target agent and associate the target identifier with an access path of the target agent;
a second configuration module 607, configured to configure target permissions for the target agent, wherein the target agent may invoke the local programming interface of the virtual machine based on the target permissions; and
a calling module 608, configured to call the local programming interface with the target agent to register the target callback event function with the virtual machine.
In some embodiments of the present disclosure, as shown in fig. 6, further comprising:
the third configuration module 609 is configured to obtain an initial start instruction corresponding to the application program to be monitored, obtain an access path corresponding to the target identifier, write the call parameter into the initial start instruction, associate the access path with the initial start instruction, and configure the associated initial start instruction as the start instruction corresponding to the application program to be monitored.
In some embodiments of the present disclosure, the invoking module 608 is specifically configured to:
adding a local function in the target agent program;
calling the local programming interface by adopting a local function, and associating the local function with a trigger event function in the virtual machine;
and registering the trigger event function obtained by association by adopting an event notification mode function set in the virtual machine so as to obtain a target callback event function.
In some embodiments of the present disclosure, the starting module 603 is specifically configured to:
and starting the target agent program corresponding to the target identifier while starting the application program to be monitored.
In this embodiment, the application program to be monitored is determined, the start instruction corresponding to the application program to be monitored is determined, the target identifier is obtained through analysis in the start instruction, and the target agent program corresponding to the target identifier is started, wherein the target agent program calls the target callback event function of the virtual machine after being started, and the call chain information among the functions of the application program to be monitored is generated based on the target callback event function, so that the integrity of the call chain information can be effectively improved, and the generation efficiency and the generation effect of the call chain information are effectively improved.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure.
Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 executes the respective methods and processes described above, such as the generation method of the call chain information. For example, in some embodiments, the generation method of call chain information may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the generation method of call chain information described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured by any other suitable means (e.g., by means of firmware) to perform the generation method of call chain information.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure may be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and are not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (13)

1. A generation method of call chain information comprises the following steps:
determining an application program to be monitored;
determining a starting instruction corresponding to the application program to be monitored, and analyzing the starting instruction to obtain a target identifier;
starting a target agent program corresponding to the target identifier, wherein the target agent program calls a target callback event function of the virtual machine after being started; and
and generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
2. The method of claim 1, further comprising, prior to the determining applications to listen to:
creating a target agent program;
configuring the target identification for the target agent program and associating the target identification with an access path of the target agent program;
configuring target permissions for the target agent, wherein the target agent may invoke a local programming interface of the virtual machine based on the target permissions; and
and calling the local programming interface by adopting the target agent program to register the target callback event function for the virtual machine.
3. The method of claim 2, further comprising, prior to the determining applications to listen to:
acquiring an initial starting instruction corresponding to the application program to be monitored;
acquiring an access path corresponding to the target identifier;
writing a calling parameter into the initial starting instruction, and associating the access path with the initial starting instruction;
and configuring the initial starting instruction obtained by association as a starting instruction corresponding to the application program to be monitored.
4. The method of claim 2, wherein said invoking the local programming interface with the target agent to register the target callback event function with the virtual machine comprises:
adding a local function among the target agents;
calling the local programming interface by using the local function, and associating the local function with a trigger event function in the virtual machine;
and registering the trigger event function obtained by association by adopting an event notification mode function set in the virtual machine so as to obtain the target callback event function.
5. The method of claim 1, wherein the launching of the target agent corresponding to the target identifier comprises:
and starting the target agent program corresponding to the target identifier while starting the application program to be monitored.
6. An apparatus for generating call chain information, comprising:
the first determining module is used for determining the application program to be monitored;
the second determining module is used for determining a starting instruction corresponding to the application program to be monitored and analyzing the starting instruction to obtain a target identifier;
the starting module is used for starting a target agent program corresponding to the target identifier, wherein the target agent program calls a target callback event function of the virtual machine after being started; and
and the generation module is used for generating call chain information among a plurality of functions of the application program to be monitored based on the target callback event function.
7. The apparatus of claim 6, further comprising:
a creation module for creating a target agent;
a first configuration module, configured to configure the target identifier for the target agent and associate the target identifier with an access path of the target agent;
a second configuration module, configured to configure target permissions for the target agent, wherein the target agent may invoke a local programming interface of the virtual machine based on the target permissions; and
and the calling module is used for calling the local programming interface by adopting the target agent program so as to register the target callback event function to the virtual machine.
8. The apparatus of claim 7, further comprising:
a third configuration module, configured to obtain an initial start instruction corresponding to the application program to be monitored, obtain an access path corresponding to the target identifier, write a call parameter into the initial start instruction, associate the access path with the initial start instruction, and configure the initial start instruction obtained by association as a start instruction corresponding to the application program to be monitored.
9. The apparatus of claim 7, wherein the invoking module is specifically configured to:
adding a local function among the target agents;
calling the local programming interface by using the local function, and associating the local function with a trigger event function in the virtual machine;
and registering the trigger event function obtained by association by adopting an event notification mode function set in the virtual machine so as to obtain the target callback event function.
10. The apparatus according to claim 6, wherein the starting module is specifically configured to:
and starting the target agent program corresponding to the target identifier while starting the application program to be monitored.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-5.
CN202110637629.7A 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium Active CN113377614B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110637629.7A CN113377614B (en) 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110637629.7A CN113377614B (en) 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113377614A true CN113377614A (en) 2021-09-10
CN113377614B CN113377614B (en) 2023-07-25

Family

ID=77576550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110637629.7A Active CN113377614B (en) 2021-06-08 2021-06-08 Call chain information generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113377614B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885997A (en) * 2021-10-19 2022-01-04 深圳市元征科技股份有限公司 Dialog box display method and device, electronic equipment and storage medium
CN114911541A (en) * 2022-06-06 2022-08-16 北京百度网讯科技有限公司 Configuration information processing method and device, electronic equipment and storage medium
CN116302218A (en) * 2023-03-15 2023-06-23 北京百度网讯科技有限公司 Function information adding method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222037A (en) * 2010-04-15 2011-10-19 国际商业机器公司 Method and equipment for positioning bottleneck of JAVA program
US20150149554A1 (en) * 2012-02-02 2015-05-28 AppDynamics Inc. Automatic capture of detailed analysis information based on remote server analysis
US20170212775A1 (en) * 2016-01-25 2017-07-27 International Business Machines Corporation Program execution without the use of bytecode modification or injection
CN110007957A (en) * 2018-12-17 2019-07-12 阿里巴巴集团控股有限公司 Call link construction method, device and equipment
CN110069358A (en) * 2019-04-18 2019-07-30 彩讯科技股份有限公司 Call chain trace analysis method, apparatus, electronic equipment and storage medium
CN111026601A (en) * 2019-09-23 2020-04-17 拉扎斯网络科技(上海)有限公司 Monitoring method and device for Java application system, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222037A (en) * 2010-04-15 2011-10-19 国际商业机器公司 Method and equipment for positioning bottleneck of JAVA program
US20150149554A1 (en) * 2012-02-02 2015-05-28 AppDynamics Inc. Automatic capture of detailed analysis information based on remote server analysis
US20170212775A1 (en) * 2016-01-25 2017-07-27 International Business Machines Corporation Program execution without the use of bytecode modification or injection
CN110007957A (en) * 2018-12-17 2019-07-12 阿里巴巴集团控股有限公司 Call link construction method, device and equipment
CN110069358A (en) * 2019-04-18 2019-07-30 彩讯科技股份有限公司 Call chain trace analysis method, apparatus, electronic equipment and storage medium
CN111026601A (en) * 2019-09-23 2020-04-17 拉扎斯网络科技(上海)有限公司 Monitoring method and device for Java application system, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
温小斌;张达;诸映晴;: "轻量级分布式追踪系统的设计与实现", 计算机时代, no. 09, pages 68 - 70 *
陈蒙蒙;陈兴蜀;金鑫;: "基于进程生命周期的虚拟机隐藏进程检测技术", 计算机应用, no. 2, pages 44 - 48 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113885997A (en) * 2021-10-19 2022-01-04 深圳市元征科技股份有限公司 Dialog box display method and device, electronic equipment and storage medium
CN114911541A (en) * 2022-06-06 2022-08-16 北京百度网讯科技有限公司 Configuration information processing method and device, electronic equipment and storage medium
CN114911541B (en) * 2022-06-06 2023-09-01 北京百度网讯科技有限公司 Processing method and device of configuration information, electronic equipment and storage medium
CN116302218A (en) * 2023-03-15 2023-06-23 北京百度网讯科技有限公司 Function information adding method, device, equipment and storage medium
CN116302218B (en) * 2023-03-15 2024-05-10 北京百度网讯科技有限公司 Function information adding method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113377614B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN113377614B (en) Call chain information generation method and device, electronic equipment and storage medium
CN112527281B (en) Operator upgrading method and device based on artificial intelligence, electronic equipment and medium
CN111309343A (en) Development deployment method and device
CN114417780B (en) State synchronization method and device, electronic equipment and storage medium
CN114490126A (en) Page processing method and device, electronic equipment and storage medium
CN113778849A (en) Method, apparatus, device and storage medium for testing code
CN113377381B (en) Distribution method and device of small program package, electronic equipment and medium
CN113704256B (en) Data identification method, device, electronic equipment and storage medium
CN115495151A (en) Rule engine migration method, device, equipment, storage medium and program product
CN115269431A (en) Interface testing method and device, electronic equipment and storage medium
CN114881235A (en) Inference service calling method and device, electronic equipment and storage medium
CN114330221A (en) Score board implementation method, score board, electronic device and storage medium
CN113468260A (en) Data analysis method and device, electronic equipment and storage medium
CN110968519A (en) Game testing method, device, server and storage medium
CN113360365A (en) Flow testing method and flow testing system
CN113568797B (en) Testing method and device of intelligent interaction system, electronic equipment and medium
CN116302086A (en) Application processing method and device, electronic equipment and readable storage medium
CN114266037B (en) Sample detection method and device, electronic equipment and storage medium
CN113836712A (en) Indoor simulation method, device, equipment and medium for lane-level navigation
CN114327648B (en) Driving debugging method and device, electronic equipment and storage medium
CN113656268B (en) Performance test method and device for business service, electronic equipment and storage medium
CN114238075A (en) Method, device, equipment, medium and product for testing program component
CN114895898A (en) Instruction processing method, device, equipment and storage medium
CN117992417A (en) Log calling method, device and system
CN113849170A (en) Code sharing method and device, electronic 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
GR01 Patent grant
GR01 Patent grant