xref: /linux/tools/perf/jvmti/jvmti_agent.h (revision 664b0bae0b87f69bc9deb098f5e0158b9cf18e04)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2209045adSStephane Eranian #ifndef __JVMTI_AGENT_H__
3209045adSStephane Eranian #define __JVMTI_AGENT_H__
4209045adSStephane Eranian 
5209045adSStephane Eranian #include <sys/types.h>
6209045adSStephane Eranian #include <stdint.h>
7209045adSStephane Eranian #include <jvmti.h>
8209045adSStephane Eranian 
9209045adSStephane Eranian #if defined(__cplusplus)
10209045adSStephane Eranian extern "C" {
11209045adSStephane Eranian #endif
12209045adSStephane Eranian 
13598b7c69SStephane Eranian typedef struct {
14598b7c69SStephane Eranian 	unsigned long	pc;
15598b7c69SStephane Eranian 	int		line_number;
16598b7c69SStephane Eranian 	int		discrim; /* discriminator -- 0 for now */
17*ca58d7e6SBen Gainey 	jmethodID	methodID;
18598b7c69SStephane Eranian } jvmti_line_info_t;
19598b7c69SStephane Eranian 
20209045adSStephane Eranian void *jvmti_open(void);
21209045adSStephane Eranian int   jvmti_close(void *agent);
22209045adSStephane Eranian int   jvmti_write_code(void *agent, char const *symbol_name,
23209045adSStephane Eranian 		       uint64_t vma, void const *code,
24209045adSStephane Eranian 		       const unsigned int code_size);
25598b7c69SStephane Eranian 
26*ca58d7e6SBen Gainey int   jvmti_write_debug_info(void *agent, uint64_t code, int nr_lines,
27598b7c69SStephane Eranian 			     jvmti_line_info_t *li,
28*ca58d7e6SBen Gainey 			     const char * const * file_names);
29209045adSStephane Eranian 
30209045adSStephane Eranian #if defined(__cplusplus)
31209045adSStephane Eranian }
32209045adSStephane Eranian 
33209045adSStephane Eranian #endif
34209045adSStephane Eranian #endif /* __JVMTI_H__ */
35