Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java flamegraph not complete #2101

Open
datavisorhenryzhao opened this issue Jan 28, 2025 · 3 comments
Open

java flamegraph not complete #2101

datavisorhenryzhao opened this issue Jan 28, 2025 · 3 comments

Comments

@datavisorhenryzhao
Copy link

Describe the bug
I deployed the pixie (self host), find the flame-graph is not complete

Image

To Reproduce
Steps to reproduce the behavior:

  1. Deploy pixie for k8s
    os: Ubuntu 22.04.3 LTS
    kernel: 6.2.0-1015-aws
    vizier-pem: gcr.io/pixie-oss/pixie-prod/vizier-pem_image:0.14.9
    java version
openjdk version "1.8.0-builds.shipilev.net-openjdk-shenandoah-jdk8-b798-20210222"
OpenJDK Runtime Environment (build 1.8.0-builds.shipilev.net-openjdk-shenandoah-jdk8-b798-20210222-testing-b00)
OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)
  1. Write java code
public class HelloWorld {
    public static void main(String[] args) {
        while (true) { 
                int i = 0;
                while (i < 1000000) {
                        f1();
                        i++;
                }
                try {
                // 暂停 5 毫秒
                        Thread.sleep(5);
                    } catch (InterruptedException e) {
                        System.out.println("Sleep was interrupted.");
                    }
        }
    }
    public static void f1() {
                try {
                // 暂停 5 毫秒
                        Thread.sleep(1);
                    } catch (InterruptedException e) {
                        System.out.println("Sleep was interrupted.");
                    }
        f2();
    }
    public static void f2() {
                try {
                // 暂停 5 毫秒
                        Thread.sleep(1);
                    } catch (InterruptedException e) {
                        System.out.println("Sleep was interrupted.");
                    }
        f3();
    }
    public static void f3() {
                try {
                // 暂停 5 毫秒
                        Thread.sleep(1);
                    } catch (InterruptedException e) {
                        System.out.println("Sleep was interrupted.");
                    }

    }

}
  1. set entry point of the container image; and run in pod
    java -XX:+PreserveFramePointer HelloWorld

  2. select the pod and lookup Flamegraph

but I can not see f1/f2/f3 symbol
Image

App information (please complete the following information):

  • Pixie version: gcr.io/pixie-oss/pixie-prod/vizier-pem_image:0.14.9
  • K8s : 1.24
  • Node Kernel version: 6.2.0-1015-aws
  • Browser version: Chrome 131.0.6778.266
@datavisorhenryzhao
Copy link
Author

I find only when i execute javac -g HelloWorld1.java, i can see the function f1(), by both the following cmd. So I think PreserveFramePointer have no effect

java -XX:+PreserveFramePointer HelloWorld1

Image

java HelloWorld1

Image

@ddelnano
Copy link
Member

ddelnano commented Jan 30, 2025

Hi @datavisorhenryzhao, thanks for the bug report.

Can you collect the PEM logs via px collect-logs while that workload is running? It would also be helpful (but not required) if you could add the following cli flag to the PEM DaemonSet before collecting the logs: --vmodule=px_jattach=1,perf_profile_connector=1,stringifier=1,elf_symbolizer=1

I will try to reproduce the issue on my own sometime this week as well, but having the logs would be very helpful.

@datavisorhenryzhao
Copy link
Author

  1. when compiled without '-g'
Image

2.when compiled with '-g', can find f1 symbol, but f2/f3 not found

Image
  1. info of pem-pod(where pod henry runs with same node)
Image

By the way how to add the flag for pem ds? Do you know the full args?
--vmodule=px_jattach=1,perf_profile_connector=1,stringifier=1,elf_symbolizer=1

Image

pixie_logs_20250130110549.zip

I also tried parca project (based on ebpf), it shows the full java stack (f1/f2/f3) only when compiled with '-g'

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants