Skip to content

Instantly share code, notes, and snippets.

Avatar

Yasumasa Suenaga YaSuenag

View GitHub Profile
@YaSuenag
YaSuenag / README.md
Last active Nov 7, 2020
Unified Logging for network
View README.md

outline

Abstract

-Xlog:all=info:host=127.0.0.1,port=9999

Log message is sent to the consumer in plain text each time it is issued. The user can configure it with -Xlog option.

  1. Log message is issued from the code in HotSpot
  2. Log message is stored in message buffer
@YaSuenag
YaSuenag / Makefile
Last active Apr 20, 2017
Example code of HeapStats realtime deadlock detector
View Makefile
.PHONY: clean
CFLAGS = -fPIC -g
LDFLAGS = -lpthread
CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
TARGETS = libdltest.so libdltest-jmm.so
all: $(TARGETS)
libdltest.so: deadlockDetector.o
View JMXClient.java
import java.io.*;
import java.util.*;
import java.util.stream.*;
import java.lang.reflect.*;
import javax.management.*;
import sun.tools.jconsole.*;
public class JMXClient implements AutoCloseable{
@YaSuenag
YaSuenag / error1.log
Created Jun 26, 2016
Build JDK 9 with GCC 6.1.1
View error1.log
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:227:43: error: narrowing conversion of '2206368128u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing]
static const jint ONE_INT[] = { 0x83828180};
^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:238:55: error: narrowing conversion of '2206368128u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing]
static const jint TWO_INT[] = { 0x83828180, 0x87868584};
^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:238:55: error: narrowing conversion of '2273740164u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing]
lib/CompileJvm.gmk:193: recipe for target '/home/ysuenaga/OpenJDK/hs/build/linux-x86_64-normal-server-fastdebug/hotspot/variant-server/libjvm/objs/altHashing.o' failed
gmake[4]: *** [/home/ysuenaga/OpenJDK/hs/build/linux-x86_64-normal-server-fastde
@YaSuenag
YaSuenag / gist:a4bea7922bd0790550d4
Last active May 19, 2017
JVMCIを使ってみよう(メソッドプロファイル取得編)
View gist:a4bea7922bd0790550d4

とりあえず、JVMCI経由でメソッドプロファイル情報を取得してみます。

方針

  • プロファイルを取得したいクラスを予め決めておき、シャットダウンフック実行時に一気にダンプします。
  • JVMCIではメソッド単位でコントロール可能ですが、とりあえずクラス内定義メソッド全部をダンプするようにします。

JVMCI取得部

/*
 * Copyright (C) 2015 Yasumasa Suenaga
@YaSuenag
YaSuenag / gist:382ab8855905600e735c
Last active May 12, 2017
Raspbian/Pidoraをvirt-managerから使ってみる
View gist:382ab8855905600e735c

環境

  • Fedora21
    • libvirt
    • virt-manager
    • qemu-system-arm
    • libguestfs-tools-c
  • Raspbian
  • Pidora20

下準備