java

package
v0.0.0-...-2feb83d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package java contains implementation for JavaTLS support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectAgent

func InjectAgent(pid int, agent, args string) error

InjectAgent injects the given agent into the given java process

Types

type Hotspot

type Hotspot struct {
	// contains filtered or unexported fields
}

Hotspot java has a specific protocol, described here:

o touch .attach_pid<pid-of-java>
o kill -SIGQUIT <pid-of-java>
o java process check if .attach_pid<his-pid> exit
o then create a unix socket .java_pid<his-pid>
o we can write command through the unix socket
<pid-of-java> refers to the namespaced pid of the process.

Public documentation https://openjdk.org/groups/hotspot/docs/Serviceability.html#battach

func NewHotspot

func NewHotspot(pid int, nsPid int) (*Hotspot, error)

NewHotspot create an object to connect to a JVM hotspot pid (host pid) and nsPid (within the namespace pid)

NSPid field was introduced in kernel >= 4.1 So we can't support container on Centos 7 (kernel 3.10)

func (*Hotspot) Attach

func (h *Hotspot) Attach(agentPath string, args string, uid int, gid int) error

Attach an agent to the hotspot, uid/gid must be accessible read-only by the targeted hotspot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL