* Using Intel PT with JIT
@ 2023-07-11 13:54 Roman Lozko
2023-07-11 19:05 ` Adrian Hunter
0 siblings, 1 reply; 2+ messages in thread
From: Roman Lozko @ 2023-07-11 13:54 UTC (permalink / raw)
To: linux-perf-users
Hi, I tried to use `perf record` with Intel PT but afterwards I can't
inject JIT dump to trace, `perf inject` says:
error, jitted code must be sampled with perf record -k 1
0x59d8 [0xb0]: failed to process type: 10 [Operation not permitted]
On the other hand, `-k 1` cannot be passed to `perf record`:
Cannot use clockid (-k option) with intel_pt
Is there a way to use Intel PT with jitted code? I am using perf
5.13.8, maybe it is already implemented in later versions?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Using Intel PT with JIT
2023-07-11 13:54 Using Intel PT with JIT Roman Lozko
@ 2023-07-11 19:05 ` Adrian Hunter
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Hunter @ 2023-07-11 19:05 UTC (permalink / raw)
To: Roman Lozko, linux-perf-users
On 11/07/23 16:54, Roman Lozko wrote:
> Hi, I tried to use `perf record` with Intel PT but afterwards I can't
> inject JIT dump to trace, `perf inject` says:
>
> error, jitted code must be sampled with perf record -k 1
> 0x59d8 [0xb0]: failed to process type: 10 [Operation not permitted]
>
> On the other hand, `-k 1` cannot be passed to `perf record`:
>
> Cannot use clockid (-k option) with intel_pt
>
> Is there a way to use Intel PT with jitted code? I am using perf
> 5.13.8, maybe it is already implemented in later versions?
>
Seems to work:
$ cat HelloWorldApp.java
import java.util.*;
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}
$ javac HelloWorldApp.java
$ perf version
perf version 5.13.8.g3cfdd7252e00
$ perf record -e intel_pt//u -o java.perf.data java -agentpath:/home/ahunter/git/linux-stable/tools/perf/libperf-jvmti.so HelloWorldApp
java: jvmti: jitdump in /home/ahunter/.debug/jit/java-jit-20230711.XXgKfxna/jit-75025.dump
Hello World!
[ perf record: Woken up 3 times to write data ]
[ perf record: Captured and wrote 4.072 MB java.perf.data ]
$ perf inject -i java.perf.data --jit -o java.perf.data.jitted
$
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-11 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11 13:54 Using Intel PT with JIT Roman Lozko
2023-07-11 19:05 ` Adrian Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).